@feugene/granularity 0.20.0 → 0.22.0

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 (210) hide show
  1. package/dist/chunks/{config-BJ7Bv_G2.js → config-BC8d_smz.js} +10 -2
  2. package/dist/chunks/config-BC8d_smz.js.map +1 -0
  3. package/dist/chunks/config-BDfTXHo1.js.map +1 -0
  4. package/dist/chunks/config-BEVBsvni2.js.map +1 -0
  5. package/dist/chunks/config-BTCOJO5z2.js.map +1 -0
  6. package/dist/chunks/config-B_qi4Fma.js +92 -0
  7. package/dist/chunks/config-B_qi4Fma.js.map +1 -0
  8. package/dist/chunks/{config-gwro_7yn.js → config-Bm_Sovla.js} +6 -2
  9. package/dist/chunks/config-Bm_Sovla.js.map +1 -0
  10. package/dist/chunks/{config-BKvX0q10.js → config-C5mO5DYZ.js} +10 -1
  11. package/dist/chunks/config-C5mO5DYZ.js.map +1 -0
  12. package/dist/chunks/config-CIcynHGr.js +96 -0
  13. package/dist/chunks/config-CIcynHGr.js.map +1 -0
  14. package/dist/chunks/{config-BsuDM3Hb.js → config-CKULiuvc.js} +15 -1
  15. package/dist/chunks/config-CKULiuvc.js.map +1 -0
  16. package/dist/chunks/config-COpuWGr_.js.map +1 -0
  17. package/dist/chunks/config-DBQQT-WP.js +66 -0
  18. package/dist/chunks/config-DBQQT-WP.js.map +1 -0
  19. package/dist/chunks/config-DU2DNSRx.js.map +1 -0
  20. package/dist/chunks/config-QJ54_fcM.js +61 -0
  21. package/dist/chunks/config-QJ54_fcM.js.map +1 -0
  22. package/dist/chunks/config-ScuvHw6k.js.map +1 -0
  23. package/dist/chunks/config-eXB87DOi.js.map +1 -0
  24. package/dist/chunks/config-jyZq8XKL.js +58 -0
  25. package/dist/chunks/config-jyZq8XKL.js.map +1 -0
  26. package/dist/chunks/copy-DChChcq-.js +29 -0
  27. package/dist/chunks/copy-DChChcq-.js.map +1 -0
  28. package/dist/chunks/{en-COdzxgAX.js → en-DCCFP4qu.js} +18 -2
  29. package/dist/chunks/{en-COdzxgAX.js.map → en-DCCFP4qu.js.map} +1 -1
  30. package/dist/chunks/{es-ClqJ-4hr.js → es-CT34HBVM.js} +18 -2
  31. package/dist/chunks/{es-ClqJ-4hr.js.map → es-CT34HBVM.js.map} +1 -1
  32. package/dist/chunks/{es-DGMHwknJ.js → es-DdJsxlUr.js} +3 -3
  33. package/dist/chunks/{es-DGMHwknJ.js.map → es-DdJsxlUr.js.map} +1 -1
  34. package/dist/chunks/{generated-BRkbhyxk.js → generated-CiCrGDQO.js} +147 -0
  35. package/dist/chunks/{generated-BRkbhyxk.js.map → generated-CiCrGDQO.js.map} +1 -1
  36. package/dist/chunks/{granular-provider-CZYm70Pm.js → granular-provider-CYroWMjO.js} +21 -11
  37. package/dist/chunks/granular-provider-CYroWMjO.js.map +1 -0
  38. package/dist/chunks/{ru-9z8ix45c.js → ru-CLiAMwrx.js} +18 -2
  39. package/dist/chunks/{ru-9z8ix45c.js.map → ru-CLiAMwrx.js.map} +1 -1
  40. package/dist/chunks/trending-up-Bf9AQmoq.js +42 -0
  41. package/dist/chunks/trending-up-Bf9AQmoq.js.map +1 -0
  42. package/dist/components/GrCard/chunks/GrCard-Bc7nRfbe.js +144 -0
  43. package/dist/components/GrCard/chunks/GrCard-Bc7nRfbe.js.map +1 -0
  44. package/dist/components/GrCard/index.js +2 -2
  45. package/dist/components/GrCodeBlock/chunks/GrCodeBlock-BmXCLgLS.js +315 -0
  46. package/dist/components/GrCodeBlock/chunks/GrCodeBlock-BmXCLgLS.js.map +1 -0
  47. package/dist/components/GrCodeBlock/index.js +3 -0
  48. package/dist/components/GrCodeBlock/styles.css +1 -0
  49. package/dist/components/GrCollapse/chunks/{GrCollapse-KFcrji1L.js → GrCollapse-C1rCfbc0.js} +2 -2
  50. package/dist/components/GrCollapse/chunks/{GrCollapse-KFcrji1L.js.map → GrCollapse-C1rCfbc0.js.map} +1 -1
  51. package/dist/components/GrCollapse/index.js +2 -2
  52. package/dist/components/GrDataTable/chunks/{GrDataTable-CNvZg2HZ.js → GrDataTable-B5MmZFUg.js} +67 -5
  53. package/dist/components/GrDataTable/chunks/GrDataTable-B5MmZFUg.js.map +1 -0
  54. package/dist/components/GrDataTable/index.js +2 -2
  55. package/dist/components/GrDelta/chunks/GrDelta-BMmpYz8K.js +0 -0
  56. package/dist/components/GrDelta/chunks/GrDelta-BMmpYz8K.js.map +1 -0
  57. package/dist/components/GrDelta/index.js +3 -0
  58. package/dist/components/GrDescriptionList/chunks/GrDescriptionList-pXh1LZEe.js +103 -0
  59. package/dist/components/GrDescriptionList/chunks/GrDescriptionList-pXh1LZEe.js.map +1 -0
  60. package/dist/components/GrDescriptionList/index.js +3 -0
  61. package/dist/components/GrDropdownMenu/chunks/{GrDropdownMenu-LOaFSCyd.js → GrDropdownMenu-DyS6dWDp.js} +2 -2
  62. package/dist/components/GrDropdownMenu/chunks/{GrDropdownMenu-LOaFSCyd.js.map → GrDropdownMenu-DyS6dWDp.js.map} +1 -1
  63. package/dist/components/GrDropdownMenu/index.js +2 -2
  64. package/dist/components/GrFilePreview/chunks/GrFilePreview-rbE3zL9w.js +315 -0
  65. package/dist/components/GrFilePreview/chunks/GrFilePreview-rbE3zL9w.js.map +1 -0
  66. package/dist/components/GrFilePreview/index.js +3 -0
  67. package/dist/components/GrForm/chunks/{GrForm-DdJw23Pz.js → GrForm-B_Qq_13k.js} +14 -7
  68. package/dist/components/GrForm/chunks/GrForm-B_Qq_13k.js.map +1 -0
  69. package/dist/components/GrForm/index.js +1 -1
  70. package/dist/components/GrImageViewer/chunks/{GrImageViewer-CMO10TS7.js.map → GrImageViewer-ng7el4wn.js.map} +1 -1
  71. package/dist/components/GrImageViewer/index.js +1 -1
  72. package/dist/components/GrInputTag/chunks/{GrInputTag-Dghhg03-.js.map → GrInputTag-C7QVPijj.js.map} +1 -1
  73. package/dist/components/GrInputTag/index.js +1 -1
  74. package/dist/components/GrJsonViewer/chunks/GrJsonViewer-DFUppRNb.js +389 -0
  75. package/dist/components/GrJsonViewer/chunks/GrJsonViewer-DFUppRNb.js.map +1 -0
  76. package/dist/components/GrJsonViewer/index.js +3 -0
  77. package/dist/components/GrList/chunks/{GrList-CHibO0xA.js → GrList-BRYhpqIe.js} +4 -4
  78. package/dist/components/GrList/chunks/GrList-BRYhpqIe.js.map +1 -0
  79. package/dist/components/GrList/index.js +2 -2
  80. package/dist/components/GrList/styles.css +1 -1
  81. package/dist/components/GrRadio/index.js +1 -1
  82. package/dist/components/GrSegmented/chunks/{GrSegmented-DP9WMAbm.js → GrSegmented-D1mjxF_O.js} +1 -1
  83. package/dist/components/GrSegmented/chunks/GrSegmented-D1mjxF_O.js.map +1 -0
  84. package/dist/components/GrSegmented/index.js +2 -2
  85. package/dist/components/GrSidebar/chunks/{GrSidebar-DG_t4aPE.js → GrSidebar-D7WxRtIu.js} +7 -1
  86. package/dist/components/GrSidebar/chunks/{GrSidebar-DG_t4aPE.js.map → GrSidebar-D7WxRtIu.js.map} +1 -1
  87. package/dist/components/GrSidebar/index.js +1 -1
  88. package/dist/components/GrSortableList/chunks/{GrSortableList-DJFPdUVv.js → GrSortableList-DPjxilmN.js} +1 -1
  89. package/dist/components/GrSortableList/chunks/{GrSortableList-DJFPdUVv.js.map → GrSortableList-DPjxilmN.js.map} +1 -1
  90. package/dist/components/GrSortableList/index.js +1 -1
  91. package/dist/components/GrStatistic/chunks/{GrStatistic-C3VpykHo.js → GrStatistic-DkzWUAw1.js} +8 -41
  92. package/dist/components/GrStatistic/chunks/GrStatistic-DkzWUAw1.js.map +1 -0
  93. package/dist/components/GrStatistic/index.js +1 -1
  94. package/dist/components/GrTabPanels/index.js +1 -1
  95. package/dist/components/GrTextarea/index.js +1 -1
  96. package/dist/components/GrTimeline/chunks/{GrTimeline-DlTraRn5.js → GrTimeline-Ch9sHzwL.js} +1 -1
  97. package/dist/components/GrTimeline/chunks/GrTimeline-Ch9sHzwL.js.map +1 -0
  98. package/dist/components/GrTimeline/index.js +2 -2
  99. package/dist/components/GrTimeline/styles.css +1 -1
  100. package/dist/components/GrToaster/chunks/{GrToaster-Db2NgrXu.js → GrToaster-DJUzx3sR.js} +1 -1
  101. package/dist/components/GrToaster/chunks/{GrToaster-Db2NgrXu.js.map → GrToaster-DJUzx3sR.js.map} +1 -1
  102. package/dist/components/GrToaster/index.js +2 -2
  103. package/dist/composables/useToast.js +14 -2
  104. package/dist/composables/useToast.js.map +1 -1
  105. package/dist/granular-provider-node.js +1 -1
  106. package/dist/granular-provider.js +1 -1
  107. package/dist/i18n/all.js +1 -1
  108. package/dist/i18n/index.js +1 -1
  109. package/dist/index.js +38 -28
  110. package/dist/theme.js +1 -1
  111. package/dist/tokens.js +1 -1
  112. package/dist/types/components/GrButton/GrButton.vue.d.ts +1 -1
  113. package/dist/types/components/GrCard/GrCard.vue.d.ts +25 -6
  114. package/dist/types/components/GrCard/defaults.d.ts +2 -1
  115. package/dist/types/components/GrCard/grCardStyles.d.ts +8 -0
  116. package/dist/types/components/GrCard/index.d.ts +1 -1
  117. package/dist/types/components/GrCodeBlock/GrCodeBlock.vue.d.ts +79 -0
  118. package/dist/types/components/GrCodeBlock/config.d.ts +1 -0
  119. package/dist/types/components/GrCodeBlock/defaults.d.ts +21 -0
  120. package/dist/types/components/GrCodeBlock/grCodeBlockStyles.d.ts +53 -0
  121. package/dist/types/components/GrCodeBlock/index.d.ts +6 -0
  122. package/dist/types/components/GrCodeBlock/safelist.d.ts +1 -0
  123. package/dist/types/components/GrCodeBlock/serializeCode.d.ts +19 -0
  124. package/dist/types/components/GrCodeBlock/tokenizeJson.d.ts +24 -0
  125. package/dist/types/components/GrCollapse/GrCollapse.vue.d.ts +2 -2
  126. package/dist/types/components/GrCommandPalette/GrCommandPalette.vue.d.ts +2 -2
  127. package/dist/types/components/GrDataTable/GrDataTable.vue.d.ts +38 -1
  128. package/dist/types/components/GrDataTable/grDataTableStyles.d.ts +7 -0
  129. package/dist/types/components/GrDataTable/index.d.ts +1 -1
  130. package/dist/types/components/GrDelta/GrDelta.vue.d.ts +84 -0
  131. package/dist/types/components/GrDelta/config.d.ts +1 -0
  132. package/dist/types/components/GrDelta/defaults.d.ts +22 -0
  133. package/dist/types/components/GrDelta/deltaTone.d.ts +24 -0
  134. package/dist/types/components/GrDelta/grDeltaStyles.d.ts +38 -0
  135. package/dist/types/components/GrDelta/index.d.ts +6 -0
  136. package/dist/types/components/GrDelta/safelist.d.ts +1 -0
  137. package/dist/types/components/GrDescriptionList/GrDescriptionList.vue.d.ts +107 -0
  138. package/dist/types/components/GrDescriptionList/config.d.ts +1 -0
  139. package/dist/types/components/GrDescriptionList/defaults.d.ts +21 -0
  140. package/dist/types/components/GrDescriptionList/grDescriptionListStyles.d.ts +25 -0
  141. package/dist/types/components/GrDescriptionList/index.d.ts +6 -0
  142. package/dist/types/components/GrDescriptionList/safelist.d.ts +1 -0
  143. package/dist/types/components/GrDropdownMenu/GrDropdownMenu.vue.d.ts +1 -1
  144. package/dist/types/components/GrDropdownMenu/grDropdownMenuStyles.d.ts +10 -1
  145. package/dist/types/components/GrFilePreview/GrFilePreview.vue.d.ts +100 -0
  146. package/dist/types/components/GrFilePreview/config.d.ts +1 -0
  147. package/dist/types/components/GrFilePreview/defaults.d.ts +20 -0
  148. package/dist/types/components/GrFilePreview/fileKindOf.d.ts +14 -0
  149. package/dist/types/components/GrFilePreview/grFilePreviewStyles.d.ts +37 -0
  150. package/dist/types/components/GrFilePreview/index.d.ts +6 -0
  151. package/dist/types/components/GrFilePreview/safelist.d.ts +1 -0
  152. package/dist/types/components/GrForm/GrForm.vue.d.ts +47 -86
  153. package/dist/types/components/GrFormField/GrFormField.vue.d.ts +2 -2
  154. package/dist/types/components/GrImageViewer/GrImageViewer.vue.d.ts +1 -1
  155. package/dist/types/components/GrInput/GrInput.vue.d.ts +1 -1
  156. package/dist/types/components/GrInputTag/GrInputTag.vue.d.ts +1 -1
  157. package/dist/types/components/GrJsonViewer/GrJsonViewer.vue.d.ts +129 -0
  158. package/dist/types/components/GrJsonViewer/config.d.ts +1 -0
  159. package/dist/types/components/GrJsonViewer/defaults.d.ts +23 -0
  160. package/dist/types/components/GrJsonViewer/grJsonViewerStyles.d.ts +57 -0
  161. package/dist/types/components/GrJsonViewer/index.d.ts +9 -0
  162. package/dist/types/components/GrJsonViewer/jsonToNodes.d.ts +47 -0
  163. package/dist/types/components/GrJsonViewer/safelist.d.ts +1 -0
  164. package/dist/types/components/GrList/grListStyles.d.ts +13 -0
  165. package/dist/types/components/GrNumberInput/GrNumberInput.vue.d.ts +1 -1
  166. package/dist/types/components/GrRating/GrRating.vue.d.ts +1 -1
  167. package/dist/types/components/GrSegmented/GrSegmented.vue.d.ts +1 -1
  168. package/dist/types/components/GrStatistic/GrStatistic.vue.d.ts +2 -2
  169. package/dist/types/components/GrSwitch/GrSwitch.vue.d.ts +1 -1
  170. package/dist/types/components/GrTable/GrTable.vue.d.ts +2 -2
  171. package/dist/types/components/GrTabs/GrTabs.vue.d.ts +1 -1
  172. package/dist/types/components/GrTimeline/GrTimelineItem.vue.d.ts +3 -3
  173. package/dist/types/components/shared/sizes.d.ts +5 -1
  174. package/dist/types/composables/useToast.d.ts +11 -0
  175. package/dist/types/granular-provider/shared.d.ts +5 -0
  176. package/dist/types/i18n/messages/en.d.ts +28 -0
  177. package/dist/types/i18n/messages/es.d.ts +28 -0
  178. package/dist/types/i18n/messages/ru.d.ts +28 -0
  179. package/dist/types/index.d.ts +5 -0
  180. package/dist/web-types.json +661 -124
  181. package/package.json +22 -1
  182. package/dist/chunks/config-BDfTXHo12.js.map +0 -1
  183. package/dist/chunks/config-BEVBsvni.js.map +0 -1
  184. package/dist/chunks/config-BJ7Bv_G2.js.map +0 -1
  185. package/dist/chunks/config-BKvX0q10.js.map +0 -1
  186. package/dist/chunks/config-BTCOJO5z.js.map +0 -1
  187. package/dist/chunks/config-BsuDM3Hb.js.map +0 -1
  188. package/dist/chunks/config-COpuWGr_2.js.map +0 -1
  189. package/dist/chunks/config-DU2DNSRx2.js.map +0 -1
  190. package/dist/chunks/config-ScuvHw6k2.js.map +0 -1
  191. package/dist/chunks/config-eXB87DOi2.js.map +0 -1
  192. package/dist/chunks/config-gwro_7yn.js.map +0 -1
  193. package/dist/chunks/granular-provider-CZYm70Pm.js.map +0 -1
  194. package/dist/components/GrCard/chunks/GrCard-DfIZOP5N.js +0 -89
  195. package/dist/components/GrCard/chunks/GrCard-DfIZOP5N.js.map +0 -1
  196. package/dist/components/GrDataTable/chunks/GrDataTable-CNvZg2HZ.js.map +0 -1
  197. package/dist/components/GrForm/chunks/GrForm-DdJw23Pz.js.map +0 -1
  198. package/dist/components/GrList/chunks/GrList-CHibO0xA.js.map +0 -1
  199. package/dist/components/GrSegmented/chunks/GrSegmented-DP9WMAbm.js.map +0 -1
  200. package/dist/components/GrStatistic/chunks/GrStatistic-C3VpykHo.js.map +0 -1
  201. package/dist/components/GrTimeline/chunks/GrTimeline-DlTraRn5.js.map +0 -1
  202. package/dist/chunks/{config-BDfTXHo12.js → config-BDfTXHo1.js} +0 -0
  203. package/dist/chunks/{config-BEVBsvni.js → config-BEVBsvni2.js} +0 -0
  204. package/dist/chunks/{config-BTCOJO5z.js → config-BTCOJO5z2.js} +0 -0
  205. package/dist/chunks/{config-COpuWGr_2.js → config-COpuWGr_.js} +0 -0
  206. package/dist/chunks/{config-DU2DNSRx2.js → config-DU2DNSRx.js} +0 -0
  207. package/dist/chunks/{config-ScuvHw6k2.js → config-ScuvHw6k.js} +0 -0
  208. package/dist/chunks/{config-eXB87DOi2.js → config-eXB87DOi.js} +0 -0
  209. package/dist/components/GrImageViewer/chunks/{GrImageViewer-CMO10TS7.js → GrImageViewer-ng7el4wn.js} +1 -1
  210. package/dist/components/GrInputTag/chunks/{GrInputTag-Dghhg03-.js → GrInputTag-C7QVPijj.js} +1 -1
@@ -9,6 +9,14 @@ export type GrDataColumnKey<TRow extends Record<string, unknown> = Record<string
9
9
  export type GrDataColumn<TRow extends Record<string, unknown> = Record<string, unknown>> = {
10
10
  key: GrDataColumnKey<TRow>;
11
11
  label: string;
12
+ /**
13
+ * Заголовок колонки сортирует.
14
+ *
15
+ * Сортируется **переданный массив `rows`**, и только он. Над серверной
16
+ * пагинацией это врёт: «максимальное списание» покажет максимум по текущей
17
+ * странице, а прочитается как максимум по журналу. Данные приходят
18
+ * постранично — включайте `externalSort` и сортируйте запросом.
19
+ */
12
20
  sortable?: boolean;
13
21
  align?: 'left' | 'center' | 'right';
14
22
  /**
@@ -27,6 +35,14 @@ export type GrDataColumn<TRow extends Record<string, unknown> = Record<string, u
27
35
  */
28
36
  pinned?: 'left' | 'right';
29
37
  };
38
+ /**
39
+ * Значения итоговой строки по ключам колонок.
40
+ *
41
+ * Не строка набора: у итога нет ключа, он не сортируется и не выбирается.
42
+ * Колонка, для которой значения нет, остаётся пустой ячейкой — заполнять все
43
+ * колонки итог не обязан.
44
+ */
45
+ export type GrDataTableSummary<TRow extends Record<string, unknown> = Record<string, unknown>> = Partial<Record<GrDataColumnKey<TRow>, unknown>>;
30
46
  export type GrDataTableRowKey<TRow extends Record<string, unknown> = Record<string, unknown>> = string | ((row: TRow) => string | number);
31
47
  /** Порядок обхода состояний сортировки по клику на заголовок. */
32
48
  export type GrDataTableSortCycle = 'asc-desc' | 'asc-desc-none';
@@ -73,6 +89,21 @@ export interface GrDataTableProps<TRow extends Record<string, unknown> = Record<
73
89
  rowClass?: string | ((row: TRow, index: number) => string | undefined);
74
90
  /** Произвольные атрибуты строки (`data-*`, `title`, …). */
75
91
  rowProps?: (row: TRow, index: number) => Record<string, unknown> | undefined;
92
+ /**
93
+ * Итоговая строка в `<tfoot>`: значения по ключам колонок.
94
+ *
95
+ * Встаёт по той же колоночной сетке, что и тело, — с теми же паддингами,
96
+ * выравниванием, ширинами и закреплением. Собранная руками в `#footer`, она
97
+ * этих классов не получает (`GrTable` их принципиально не даёт) и разъезжается
98
+ * с телом на первой же смене `size`.
99
+ *
100
+ * Итог не суммируется компонентом: что считать итогом — знает приложение.
101
+ * Оформление ячейки — слот `#summary-<key>`.
102
+ *
103
+ * `null` равнозначен отсутствию: `totals ?? null` — обычная запись там, где
104
+ * итог считается не всегда.
105
+ */
106
+ summaryRow?: GrDataTableSummary<TRow> | null;
76
107
  /**
77
108
  * Размер таблицы: кегль, паддинги ячеек, стрелки сортировки и чекбоксы.
78
109
  * Прокидывается в `GrTable`.
@@ -191,6 +222,9 @@ declare const __VLS_export: <TRow extends Record<string, unknown> = Record<strin
191
222
  }) => any) | undefined; } & { [K_2 in NonNullable<`cell-${string & {}}` | `cell-${Extract<keyof TRow, string>}`>]?: ((props: {
192
223
  row: TRow;
193
224
  index: number;
225
+ }) => any) | undefined; } & { [K_3 in NonNullable<`summary-${string & {}}` | `summary-${Extract<keyof TRow, string>}`>]?: ((props: {
226
+ value: unknown;
227
+ column: GrDataColumn<TRow>;
194
228
  }) => any) | undefined; } & {
195
229
  caption?: (props: {}) => any;
196
230
  } & {
@@ -198,7 +232,10 @@ declare const __VLS_export: <TRow extends Record<string, unknown> = Record<strin
198
232
  } & {
199
233
  empty?: (props: {}) => any;
200
234
  } & {
201
- footer?: (props: {}) => any;
235
+ footer?: (props: {
236
+ columns: GrDataColumn<TRow>[];
237
+ totalColumns: number;
238
+ }) => any;
202
239
  };
203
240
  emit: GrDataTableEmits<TRow>;
204
241
  }>) => import("vue").VNode & {
@@ -32,6 +32,13 @@ export declare const columnDropAfterClass = "after:absolute after:inset-y-0 afte
32
32
  * сквозь него не видна.
33
33
  */
34
34
  export declare const rowSelectedClass = "bg-[color-mix(in_srgb,var(--gr-primary)_8%,transparent)]";
35
+ /**
36
+ * Итоговая строка. Отбивка та же, что между строками тела, плюс вес: итог —
37
+ * вывод из набора, а не ещё одна его запись, и читатель должен видеть это до
38
+ * того, как разберёт цифры. Тон оставлен потребителю: «возвраты» и «прибыль» —
39
+ * разные сообщения, и выбирать за него компонент не должен.
40
+ */
41
+ export declare const summaryRowClass = "border-t border-[var(--gr-brd)] font-600";
35
42
  /**
36
43
  * Ручка ширины — полоса у правого края заголовка. Видима она узкой линией, а
37
44
  * ловится широкой зоной: попасть в двухпиксельную границу мышью тяжело.
@@ -2,7 +2,7 @@ import type { ComponentExposed } from '../shared/instance';
2
2
  import type GrDataTableComponent from './GrDataTable.vue';
3
3
  export { default } from './GrDataTable.vue';
4
4
  export { default as GrDataTable } from './GrDataTable.vue';
5
- export type { GrDataColumn, GrDataColumnKey, GrDataTableProps, GrDataTableRowKey, GrDataTableSortCycle, } from './GrDataTable.vue';
5
+ export type { GrDataColumn, GrDataColumnKey, GrDataTableProps, GrDataTableRowKey, GrDataTableSortCycle, GrDataTableSummary, } from './GrDataTable.vue';
6
6
  export type { GrDataTableSortDir } from './grDataTableSort';
7
7
  export { grDataTableConfig } from './config';
8
8
  export type { GrDataTableConfigurableProps } from './defaults';
@@ -0,0 +1,84 @@
1
+ import { type GrDeltaPolarity } from './deltaTone';
2
+ import type { GrComponentSize } from '../shared/sizes';
3
+ export type { GrDeltaPolarity, GrDeltaTone } from './deltaTone';
4
+ /**
5
+ * Величина со знаком и тоном **внутри строки текста**: «Дельта: +$0.004».
6
+ *
7
+ * Компонент презентационный: дельту не считает и периоды не сравнивает —
8
+ * «к чему сравнивать» знает приложение. Блочная плитка показателя — `GrStatistic`.
9
+ */
10
+ export interface GrDeltaProps {
11
+ /** Величина. `null` — её нет; это не ноль. */
12
+ value: number | null;
13
+ /** Знаков после запятой. Не задано — как отдаст локаль. */
14
+ precision?: number;
15
+ /** Приписка перед числом: валюта, единица. */
16
+ prefix?: string;
17
+ /** Приписка после числа: `%`, `мс`. */
18
+ suffix?: string;
19
+ /**
20
+ * Что считать хорошим. Для выручки рост — успех, для себестоимости и времени
21
+ * отклика — наоборот; без этого компонент врал бы в половине случаев.
22
+ */
23
+ polarity?: GrDeltaPolarity;
24
+ /** Ставить `+` у положительных. Минус подставляет `Intl` сам. */
25
+ showSign?: boolean;
26
+ /** Стрелка направления. Декоративна: направление уже в знаке. */
27
+ showArrow?: boolean;
28
+ /** Чем печатать отсутствующую величину. */
29
+ emptyText?: string;
30
+ /** Локаль форматирования. Не задана — локаль i18n-адаптера. */
31
+ locale?: string;
32
+ size?: GrComponentSize;
33
+ }
34
+ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<GrDeltaProps>, {
35
+ precision: undefined;
36
+ prefix: undefined;
37
+ suffix: undefined;
38
+ polarity: undefined;
39
+ showSign: undefined;
40
+ showArrow: undefined;
41
+ emptyText: undefined;
42
+ locale: undefined;
43
+ size: undefined;
44
+ }>>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<GrDeltaProps>, {
45
+ precision: undefined;
46
+ prefix: undefined;
47
+ suffix: undefined;
48
+ polarity: undefined;
49
+ showSign: undefined;
50
+ showArrow: undefined;
51
+ emptyText: undefined;
52
+ locale: undefined;
53
+ size: undefined;
54
+ }>>> & Readonly<{}>, {
55
+ size: GrComponentSize;
56
+ polarity: GrDeltaPolarity;
57
+ showSign: boolean;
58
+ showArrow: boolean;
59
+ emptyText: string;
60
+ prefix: string;
61
+ suffix: string;
62
+ locale: string;
63
+ precision: number;
64
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
65
+ declare const _default: typeof __VLS_export;
66
+ export default _default;
67
+ type __VLS_TypePropsToOption<T> = {
68
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
69
+ type: import('vue').PropType<Required<T>[K]>;
70
+ } : {
71
+ type: import('vue').PropType<T[K]>;
72
+ required: true;
73
+ };
74
+ };
75
+ type __VLS_WithDefaults<P, D> = {
76
+ [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_PrettifyLocal<P[K] & {
77
+ default: D[K];
78
+ }> : P[K];
79
+ };
80
+ type __VLS_PrettifyLocal<T> = (T extends any ? {
81
+ [K in keyof T]: T[K];
82
+ } : {
83
+ [K in keyof T as K]: T[K];
84
+ }) & {};
@@ -0,0 +1 @@
1
+ export declare const grDeltaConfig: import("@feugene/unocss-preset-granular/contract").GranularComponentDescriptor<"GrDelta">;
@@ -0,0 +1,22 @@
1
+ import type { GrComponentSize } from '../shared/sizes';
2
+ import type { GrDeltaPolarity } from './deltaTone';
3
+ /**
4
+ * Пропы `GrDelta`, настраиваемые глобально через
5
+ * `<GrConfigProvider :component-defaults="{ GrDelta: { … } }">`.
6
+ *
7
+ * `polarity` здесь наравне с оформлением не случайно: в отчёте по расходам
8
+ * «рост — плохо» верно для всех величин сразу, и повторять это на каждой
9
+ * значит однажды забыть.
10
+ */
11
+ export interface GrDeltaConfigurableProps {
12
+ size: GrComponentSize;
13
+ polarity: GrDeltaPolarity;
14
+ showSign: boolean;
15
+ showArrow: boolean;
16
+ emptyText: string;
17
+ }
18
+ declare module '../../composables/useGrComponentConfig' {
19
+ interface GrComponentDefaultsRegistry {
20
+ GrDelta: GrDeltaConfigurableProps;
21
+ }
22
+ }
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Выбор тона для величины со знаком.
3
+ *
4
+ * Чистая функция, а не `switch` внутри компонента: ровно этот `switch`
5
+ * расходился по приложениям копиями, и в одной из них нулевое движение
6
+ * красилось зелёным — как поступление.
7
+ */
8
+ /** Что считать хорошим ростом. */
9
+ export type GrDeltaPolarity = 'positive-good'
10
+ /** Рост — проблема: себестоимость, время отклика, отток. */
11
+ | 'negative-good'
12
+ /** Знак ничего не говорит о качестве: сальдо, смещение, разница координат. */
13
+ | 'none';
14
+ export type GrDeltaTone = 'success' | 'danger' | 'neutral';
15
+ /**
16
+ * Тон величины по её знаку и полярности.
17
+ *
18
+ * Ноль нейтрален при любой полярности: «не изменилось» — третье состояние, и
19
+ * двумя цветами его не выразить. `null` величины нет вовсе — тона у неё тоже
20
+ * нет, это решает вызывающий.
21
+ */
22
+ export declare function deltaTone(value: number, polarity?: GrDeltaPolarity): GrDeltaTone;
23
+ /** Направление стрелки. Ноль стрелки не получает: двигаться было некуда. */
24
+ export declare function deltaDirection(value: number): 'up' | 'down' | 'flat';
@@ -0,0 +1,38 @@
1
+ import type { GrComponentSize } from '../shared/sizes';
2
+ import type { GrDeltaTone } from './deltaTone';
3
+ /**
4
+ * Классы `GrDelta`.
5
+ *
6
+ * Тон перечислен целиком по одному литералу на ветку: UnoCSS сканирует исходный
7
+ * текст файла, и собранное шаблонной строкой имя (`text-[var(--gr-${tone}-text)]`)
8
+ * уехало бы в CSS литералом.
9
+ */
10
+ /**
11
+ * Величина стоит в строке текста, поэтому наследует её кегль и выравнивание.
12
+ *
13
+ * Общего `gap` нет намеренно: префикс — это валюта, и «$ 12,50» с зазором
14
+ * читается как опечатка. Отбивку получают только стрелка и суффикс.
15
+ */
16
+ export declare const deltaRootClass = "inline-flex items-baseline tabular-nums";
17
+ /** Суффикс — единица измерения, и от числа он отбивается: «−15 %», «120 мс». */
18
+ export declare const deltaSuffixClass = "ml-1";
19
+ /**
20
+ * Стрелка выравнивается по строке, а не по базовой линии: у svg её нет.
21
+ *
22
+ * Размер — в `em`, потому что на ступени `md` кегля у величины нет вовсе:
23
+ * пиксельная лестница оставила бы стрелку 14-пиксельной внутри заголовка.
24
+ * Чуть меньше единицы: стрелка декоративна, и равный вес спорил бы с самим
25
+ * числом.
26
+ */
27
+ export declare const deltaArrowClass = "mr-0.5 self-center shrink-0 h-[0.875em] w-[0.875em]";
28
+ export declare const deltaToneClass: Record<GrDeltaTone, string>;
29
+ /** Прочерк вместо величины: тона у него нет, но и цвет основного текста ему не нужен. */
30
+ export declare const deltaEmptyClass = "text-[var(--gr-muted-fg)]";
31
+ /**
32
+ * `md` пуст намеренно: на ступени по умолчанию величина набирается кеглем той
33
+ * строки, в которой стоит. Фиксированные 13 px разъезжаются и вверх, и вниз —
34
+ * внутри заголовка величина оставалась бы мелкой, в подписи под графиком
35
+ * крупной. Ступени по краям остаются явными: они нужны, когда величина стоит
36
+ * не в предложении, а в ряду с контролами.
37
+ */
38
+ export declare const deltaSizeClass: Record<GrComponentSize, string>;
@@ -0,0 +1,6 @@
1
+ export { default } from './GrDelta.vue';
2
+ export { default as GrDelta } from './GrDelta.vue';
3
+ export { grDeltaConfig } from './config';
4
+ export type { GrDeltaPolarity, GrDeltaProps, GrDeltaTone } from './GrDelta.vue';
5
+ export type { GrDeltaConfigurableProps } from './defaults';
6
+ export { grDeltaSafelist } from './safelist';
@@ -0,0 +1 @@
1
+ export declare const grDeltaSafelist: string[];
@@ -0,0 +1,107 @@
1
+ import { type GrDescriptionColumns, type GrDescriptionDensity, type GrDescriptionLayout } from './grDescriptionListStyles';
2
+ import type { GrComponentSize } from '../shared/sizes';
3
+ import type { GrTone } from '../shared/tones';
4
+ export type { GrDescriptionColumns, GrDescriptionDensity, GrDescriptionLayout, } from './grDescriptionListStyles';
5
+ export interface GrDescriptionItem {
6
+ label: string;
7
+ /** Значение. `null` и `''` печатаются прочерком — строка не исчезает. */
8
+ value?: string | number | null;
9
+ /** Ключ слотов `#value-<name>` и `#label-<name>`. */
10
+ name?: string;
11
+ /** Тон значения. Подпись остаётся нейтральной всегда. */
12
+ tone?: GrTone;
13
+ }
14
+ /**
15
+ * Список пар «характеристика → значение»: настоящий `<dl>` с выравниванием
16
+ * значений в колонку.
17
+ *
18
+ * В отличие от `GrList`, где пункт — это «заголовок с подзаголовком», здесь
19
+ * два разных по роли элемента: термин и его значение.
20
+ */
21
+ export interface GrDescriptionListProps {
22
+ items: readonly GrDescriptionItem[];
23
+ /** `inline` — подпись слева колонкой; `stacked` — над значением. */
24
+ layout?: GrDescriptionLayout;
25
+ /** Ширина колонки подписей при `inline`. */
26
+ labelWidth?: string;
27
+ /**
28
+ * Ниже какой ширины контейнера (px) `inline` переключается на `stacked`.
29
+ * В узкой колонке фиксированная подпись выжимает значение в букву на строку.
30
+ */
31
+ stackBelow?: number;
32
+ density?: GrDescriptionDensity;
33
+ /** Отбивать пары линиями. */
34
+ divided?: boolean;
35
+ columns?: GrDescriptionColumns;
36
+ /** Чем печатать пустое значение. */
37
+ emptyText?: string;
38
+ size?: GrComponentSize;
39
+ }
40
+ declare var __VLS_2: `label-${string}`, __VLS_3: {
41
+ item: GrDescriptionItem;
42
+ }, __VLS_6: `value-${string}`, __VLS_7: {
43
+ item: GrDescriptionItem;
44
+ }, __VLS_9: {
45
+ item: GrDescriptionItem;
46
+ };
47
+ type __VLS_Slots = {} & {
48
+ [K in NonNullable<typeof __VLS_2>]?: (props: typeof __VLS_3) => any;
49
+ } & {
50
+ [K in NonNullable<typeof __VLS_6>]?: (props: typeof __VLS_7) => any;
51
+ } & {
52
+ empty?: (props: typeof __VLS_9) => any;
53
+ };
54
+ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<GrDescriptionListProps>, {
55
+ layout: undefined;
56
+ labelWidth: undefined;
57
+ stackBelow: undefined;
58
+ density: undefined;
59
+ divided: undefined;
60
+ columns: undefined;
61
+ emptyText: undefined;
62
+ size: undefined;
63
+ }>>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<GrDescriptionListProps>, {
64
+ layout: undefined;
65
+ labelWidth: undefined;
66
+ stackBelow: undefined;
67
+ density: undefined;
68
+ divided: undefined;
69
+ columns: undefined;
70
+ emptyText: undefined;
71
+ size: undefined;
72
+ }>>> & Readonly<{}>, {
73
+ size: GrComponentSize;
74
+ divided: boolean;
75
+ emptyText: string;
76
+ layout: GrDescriptionLayout;
77
+ labelWidth: string;
78
+ density: GrDescriptionDensity;
79
+ columns: GrDescriptionColumns;
80
+ stackBelow: number;
81
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
82
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
83
+ declare const _default: typeof __VLS_export;
84
+ export default _default;
85
+ type __VLS_TypePropsToOption<T> = {
86
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
87
+ type: import('vue').PropType<Required<T>[K]>;
88
+ } : {
89
+ type: import('vue').PropType<T[K]>;
90
+ required: true;
91
+ };
92
+ };
93
+ type __VLS_WithDefaults<P, D> = {
94
+ [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_PrettifyLocal<P[K] & {
95
+ default: D[K];
96
+ }> : P[K];
97
+ };
98
+ type __VLS_WithSlots<T, S> = T & {
99
+ new (): {
100
+ $slots: S;
101
+ };
102
+ };
103
+ type __VLS_PrettifyLocal<T> = (T extends any ? {
104
+ [K in keyof T]: T[K];
105
+ } : {
106
+ [K in keyof T as K]: T[K];
107
+ }) & {};
@@ -0,0 +1 @@
1
+ export declare const grDescriptionListConfig: import("@feugene/unocss-preset-granular/contract").GranularComponentDescriptor<"GrDescriptionList">;
@@ -0,0 +1,21 @@
1
+ import type { GrComponentSize } from '../shared/sizes';
2
+ import type { GrDescriptionColumns, GrDescriptionDensity, GrDescriptionLayout } from './grDescriptionListStyles';
3
+ /**
4
+ * Пропы `GrDescriptionList`, настраиваемые глобально через
5
+ * `<GrConfigProvider :component-defaults="{ GrDescriptionList: { … } }">`.
6
+ * Только оформление — данные принадлежат экземпляру.
7
+ */
8
+ export interface GrDescriptionListConfigurableProps {
9
+ size: GrComponentSize;
10
+ layout: GrDescriptionLayout;
11
+ labelWidth: string;
12
+ density: GrDescriptionDensity;
13
+ divided: boolean;
14
+ columns: GrDescriptionColumns;
15
+ emptyText: string;
16
+ }
17
+ declare module '../../composables/useGrComponentConfig' {
18
+ interface GrComponentDefaultsRegistry {
19
+ GrDescriptionList: GrDescriptionListConfigurableProps;
20
+ }
21
+ }
@@ -0,0 +1,25 @@
1
+ import type { GrComponentSize } from '../shared/sizes';
2
+ import type { GrTone } from '../shared/tones';
3
+ /**
4
+ * Классы `GrDescriptionList`.
5
+ *
6
+ * Тон перечислен целиком по одному литералу на ветку: UnoCSS сканирует исходный
7
+ * текст файла, и собранное шаблонной строкой имя уехало бы в CSS литералом.
8
+ */
9
+ /** `inline` — подпись колонкой слева; `stacked` — над значением. */
10
+ export type GrDescriptionLayout = 'inline' | 'stacked';
11
+ export type GrDescriptionDensity = 'regular' | 'compact';
12
+ /** Сколько колонок пар. Длинный список читается в две. */
13
+ export type GrDescriptionColumns = 1 | 2;
14
+ export declare const descriptionRootClass = "m-0 grid gap-x-4 [row-gap:var(--gr-description-list-row-gap,0.375rem)]";
15
+ export declare const descriptionColumnsClass: Record<GrDescriptionColumns, string>;
16
+ export declare const descriptionPairInlineClass = "flex min-w-0 items-baseline gap-2";
17
+ export declare const descriptionPairStackedClass = "min-w-0";
18
+ export declare const descriptionDividedClass = "border-b border-[var(--gr-description-list-divider,var(--gr-brd))] pb-1 last:border-b-0 last:pb-0";
19
+ export declare const descriptionLabelInlineClass = "shrink-0 text-[var(--gr-description-list-label-color,var(--gr-muted-fg))]";
20
+ export declare const descriptionLabelStackedClass = "text-[var(--gr-description-list-label-color,var(--gr-muted-fg))]";
21
+ export declare const descriptionValueClass = "m-0 min-w-0 break-words";
22
+ /** Тон — только у значения: красная подпись читается как «поле сломано». */
23
+ export declare const descriptionValueToneClass: Record<GrTone, string>;
24
+ export declare const descriptionSizeClass: Record<GrComponentSize, string>;
25
+ export declare const descriptionDensityClass: Record<GrDescriptionDensity, string>;
@@ -0,0 +1,6 @@
1
+ export { default } from './GrDescriptionList.vue';
2
+ export { default as GrDescriptionList } from './GrDescriptionList.vue';
3
+ export { grDescriptionListConfig } from './config';
4
+ export type { GrDescriptionColumns, GrDescriptionDensity, GrDescriptionItem, GrDescriptionLayout, GrDescriptionListProps, } from './GrDescriptionList.vue';
5
+ export type { GrDescriptionListConfigurableProps } from './defaults';
6
+ export { grDescriptionListSafelist } from './safelist';
@@ -0,0 +1 @@
1
+ export declare const grDescriptionListSafelist: string[];
@@ -22,7 +22,7 @@ export interface GrDropdownMenuProps {
22
22
  teleportTo?: string | HTMLElement;
23
23
  /** Закрывать по клику внутри content. */
24
24
  closeOnContentClick?: boolean;
25
- /** Дополнительные классы content-контейнера; по умолчанию `p-0`. */
25
+ /** Дополнительные классы content-контейнера. */
26
26
  contentClass?: string;
27
27
  /**
28
28
  * Декларативное меню: пункты, группы и разделители массивом. Слот по
@@ -6,7 +6,16 @@ export type GrDropdownMenuColumnsCount = 2 | 3 | 4;
6
6
  export declare const alignClass: Record<GrDropdownMenuItemAlign, string>;
7
7
  export declare const textAlignClass: Record<GrDropdownMenuHeaderAlign, string>;
8
8
  export declare const colsClass: Record<GrDropdownMenuColumnsCount, string>;
9
- export declare const itemBaseClass = "w-full min-h-10 px-4 py-2.5 flex items-center gap-2 text-[length:var(--gr-text-sm)] transition-colors duration-[var(--gr-duration-fast)] focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--gr-ring)]";
9
+ /**
10
+ * Радиус здесь не украшение: фон подсветки лежит на самом пункте, а панель
11
+ * `GrDropdown` скруглена на 16 px и содержимое не обрезает. Прямоугольник во всю
12
+ * ширину заливал бы угловые сегменты, вырезанные этим радиусом. Восемь
13
+ * пикселей — та же ступень, что у опций `GrSelect` и `GrAutocomplete`; внутренний
14
+ * угол панели после рамки и поля ≈ 11 px, так что подсветка до скругления не
15
+ * достаёт. Радиус в базовом классе, а не отдельной константой: hover, disabled и
16
+ * кольцо фокуса висят на одном элементе.
17
+ */
18
+ export declare const itemBaseClass = "w-full min-h-10 px-4 py-2.5 rounded-[var(--gr-radius-md)] flex items-center gap-2 text-[length:var(--gr-text-sm)] transition-colors duration-[var(--gr-duration-fast)] focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--gr-ring)]";
10
19
  export declare const itemVariantClass: Record<GrDropdownMenuItemVariant, string>;
11
20
  export declare const itemInteractiveClass = "cursor-pointer hover:bg-[var(--gr-accent)] hover:text-[var(--gr-accent-fg)]";
12
21
  export declare const itemDisabledClass = "cursor-not-allowed pointer-events-none bg-[var(--gr-muted)] text-[var(--gr-muted-fg)]";
@@ -0,0 +1,100 @@
1
+ import { type Component } from 'vue';
2
+ import type { GrSizeWithPx } from '../shared/sizes';
3
+ import { type GrFilePreviewRatio } from './grFilePreviewStyles';
4
+ export type { GrFileKind } from './fileKindOf';
5
+ export type { GrFilePreviewRatio } from './grFilePreviewStyles';
6
+ /**
7
+ * Плитка превью файла с фолбэком по типу.
8
+ *
9
+ * Показывает **сохранённый** файл, а не отправляет новый: отправка — это
10
+ * `GrFormFile` и `GrFileUpload`. Просмотрщик во весь экран открывает
11
+ * потребитель по событию `click`.
12
+ */
13
+ export interface GrFilePreviewProps {
14
+ /** Адрес превью. Пусто — сразу заглушка по типу. */
15
+ src?: string | null;
16
+ /** MIME-тип. Он решает, картинка это или файл. */
17
+ mime?: string | null;
18
+ /** Имя файла: доступное имя картинки и подпись заглушки. */
19
+ name?: string | null;
20
+ /**
21
+ * Ступень канонической шкалы либо произвольная ширина в пикселях. Число —
22
+ * escape-hatch, как диаметр у GrAvatar: плитка 96px в ленте вложений в
23
+ * четыре ступени не укладывается.
24
+ */
25
+ tileSize?: GrSizeWithPx;
26
+ ratio?: GrFilePreviewRatio;
27
+ /** Ссылка на оригинал — для не-картинок и для перехода мимо просмотрщика. */
28
+ href?: string;
29
+ /** Свой корневой тег (`RouterLink`, `Link` от Inertia). Сильнее `href`. */
30
+ as?: string | Component;
31
+ /** Плитка кликабельна и эмитит `click` — обычно чтобы открыть просмотрщик. */
32
+ clickable?: boolean;
33
+ loading?: 'lazy' | 'eager';
34
+ /**
35
+ * Доступное имя интерактивной плитки. Не задано — имя приходит из содержимого:
36
+ * `alt` картинки или подписи заглушки.
37
+ */
38
+ ariaLabel?: string;
39
+ }
40
+ export interface GrFilePreviewEmits {
41
+ (e: 'click', event: MouseEvent): void;
42
+ }
43
+ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<GrFilePreviewProps>, {
44
+ src: undefined;
45
+ mime: undefined;
46
+ name: undefined;
47
+ tileSize: undefined;
48
+ ratio: undefined;
49
+ href: undefined;
50
+ as: undefined;
51
+ clickable: boolean;
52
+ loading: undefined;
53
+ ariaLabel: undefined;
54
+ }>>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
55
+ click: (event: MouseEvent) => void;
56
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<GrFilePreviewProps>, {
57
+ src: undefined;
58
+ mime: undefined;
59
+ name: undefined;
60
+ tileSize: undefined;
61
+ ratio: undefined;
62
+ href: undefined;
63
+ as: undefined;
64
+ clickable: boolean;
65
+ loading: undefined;
66
+ ariaLabel: undefined;
67
+ }>>> & Readonly<{
68
+ onClick?: ((event: MouseEvent) => any) | undefined;
69
+ }>, {
70
+ tileSize: GrSizeWithPx;
71
+ ratio: GrFilePreviewRatio;
72
+ loading: "lazy" | "eager";
73
+ name: string | null;
74
+ href: string;
75
+ ariaLabel: string;
76
+ src: string | null;
77
+ as: string | Component;
78
+ clickable: boolean;
79
+ mime: string | null;
80
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
81
+ declare const _default: typeof __VLS_export;
82
+ export default _default;
83
+ type __VLS_TypePropsToOption<T> = {
84
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
85
+ type: import('vue').PropType<Required<T>[K]>;
86
+ } : {
87
+ type: import('vue').PropType<T[K]>;
88
+ required: true;
89
+ };
90
+ };
91
+ type __VLS_WithDefaults<P, D> = {
92
+ [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_PrettifyLocal<P[K] & {
93
+ default: D[K];
94
+ }> : P[K];
95
+ };
96
+ type __VLS_PrettifyLocal<T> = (T extends any ? {
97
+ [K in keyof T]: T[K];
98
+ } : {
99
+ [K in keyof T as K]: T[K];
100
+ }) & {};
@@ -0,0 +1 @@
1
+ export declare const grFilePreviewConfig: import("@feugene/unocss-preset-granular/contract").GranularComponentDescriptor<"GrFilePreview">;
@@ -0,0 +1,20 @@
1
+ import type { GrSizeWithPx } from '../shared/sizes';
2
+ import type { GrFilePreviewRatio } from './grFilePreviewStyles';
3
+ /**
4
+ * Пропы `GrFilePreview`, настраиваемые глобально через
5
+ * `<GrConfigProvider :component-defaults="{ GrFilePreview: { … } }">`.
6
+ *
7
+ * Только оформление: `src`, `mime` и `name` принадлежат файлу. Размер и
8
+ * пропорции здесь потому, что лента вложений выглядит одинаково на всех
9
+ * страницах, и повторять решение у каждой плитки значит однажды разойтись.
10
+ */
11
+ export interface GrFilePreviewConfigurableProps {
12
+ tileSize: GrSizeWithPx;
13
+ ratio: GrFilePreviewRatio;
14
+ loading: 'lazy' | 'eager';
15
+ }
16
+ declare module '../../composables/useGrComponentConfig' {
17
+ interface GrComponentDefaultsRegistry {
18
+ GrFilePreview: GrFilePreviewConfigurableProps;
19
+ }
20
+ }
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Вид файла по MIME-типу.
3
+ *
4
+ * Тип решает **`mime`, а не расширение**: расширение врёт (`.dat` у выгрузки,
5
+ * `.pdf` у переименованного архива), а бэкенд отдаёт настоящий тип — брать надо
6
+ * его. От вида зависит единственное решение компонента: рисовать `<img>` или
7
+ * иконку.
8
+ */
9
+ export type GrFileKind = 'image' | 'pdf' | 'document' | 'spreadsheet' | 'archive'
10
+ /** Тип не опознан, пуст или это `application/octet-stream`. */
11
+ | 'unknown';
12
+ export declare function fileKindOf(mime: string | null | undefined): GrFileKind;
13
+ /** Картинку показываем, остальное — подписываем иконкой. */
14
+ export declare function isPreviewableKind(kind: GrFileKind): boolean;