@portnet/ui 6.0.1 → 6.0.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 (158) hide show
  1. package/CHANGELOG.md +85 -0
  2. package/dist/esm/index.js +18 -0
  3. package/dist/esm/index.js.map +1 -1
  4. package/dist/esm/v2/__tests__/FieldError.test.js +0 -1
  5. package/dist/esm/v2/__tests__/FieldError.test.js.map +1 -1
  6. package/dist/esm/v2/__tests__/FieldWidth.test.js +146 -0
  7. package/dist/esm/v2/__tests__/FieldWidth.test.js.map +1 -0
  8. package/dist/esm/v2/__tests__/FileCard.test.js +0 -1
  9. package/dist/esm/v2/__tests__/FileCard.test.js.map +1 -1
  10. package/dist/esm/v2/__tests__/FormikCheckbox.test.js +265 -0
  11. package/dist/esm/v2/__tests__/FormikCheckbox.test.js.map +1 -0
  12. package/dist/esm/v2/__tests__/FormikDateTimePicker.test.js +248 -0
  13. package/dist/esm/v2/__tests__/FormikDateTimePicker.test.js.map +1 -0
  14. package/dist/esm/v2/__tests__/FormikRadioGroup.test.js +380 -0
  15. package/dist/esm/v2/__tests__/FormikRadioGroup.test.js.map +1 -0
  16. package/dist/esm/v2/__tests__/MobileRowCard.test.js +0 -1
  17. package/dist/esm/v2/__tests__/MobileRowCard.test.js.map +1 -1
  18. package/dist/esm/v2/__tests__/SectionErrorBoundary.test.js.map +1 -1
  19. package/dist/esm/v2/__tests__/labels-merge.test.js +0 -1
  20. package/dist/esm/v2/__tests__/labels-merge.test.js.map +1 -1
  21. package/dist/esm/v2/components/DateTimePicker.js +37 -4
  22. package/dist/esm/v2/components/DateTimePicker.js.map +1 -1
  23. package/dist/esm/v2/components/Field.js +63 -1
  24. package/dist/esm/v2/components/Field.js.map +1 -1
  25. package/dist/esm/v2/components/index.js +27 -0
  26. package/dist/esm/v2/components/index.js.map +1 -1
  27. package/dist/esm/v2/index.js +12 -1
  28. package/dist/esm/v2/index.js.map +1 -1
  29. package/dist/esm/v2/patterns/FavoriteColumn.js +14 -61
  30. package/dist/esm/v2/patterns/FavoriteColumn.js.map +1 -1
  31. package/dist/esm/v2/patterns/FormikCheckbox.js +140 -0
  32. package/dist/esm/v2/patterns/FormikCheckbox.js.map +1 -0
  33. package/dist/esm/v2/patterns/FormikCombobox.js +5 -2
  34. package/dist/esm/v2/patterns/FormikCombobox.js.map +1 -1
  35. package/dist/esm/v2/patterns/FormikDatePicker.js +13 -47
  36. package/dist/esm/v2/patterns/FormikDatePicker.js.map +1 -1
  37. package/dist/esm/v2/patterns/FormikDateTimePicker.js +150 -0
  38. package/dist/esm/v2/patterns/FormikDateTimePicker.js.map +1 -0
  39. package/dist/esm/v2/patterns/FormikInput.js +5 -2
  40. package/dist/esm/v2/patterns/FormikInput.js.map +1 -1
  41. package/dist/esm/v2/patterns/FormikRadioGroup.js +141 -0
  42. package/dist/esm/v2/patterns/FormikRadioGroup.js.map +1 -0
  43. package/dist/esm/v2/patterns/FormikSelect.js +5 -2
  44. package/dist/esm/v2/patterns/FormikSelect.js.map +1 -1
  45. package/dist/esm/v2/patterns/FormikTextarea.js +5 -2
  46. package/dist/esm/v2/patterns/FormikTextarea.js.map +1 -1
  47. package/dist/esm/v2/patterns/KeyboardShortcutsHelp.js +25 -8
  48. package/dist/esm/v2/patterns/KeyboardShortcutsHelp.js.map +1 -1
  49. package/dist/esm/v2/patterns/RowFavoriteToggle.js +122 -0
  50. package/dist/esm/v2/patterns/RowFavoriteToggle.js.map +1 -0
  51. package/dist/esm/v2/patterns/_pickerSerialisation.js +74 -0
  52. package/dist/esm/v2/patterns/_pickerSerialisation.js.map +1 -0
  53. package/dist/esm/v2/patterns/index.js +83 -0
  54. package/dist/esm/v2/patterns/index.js.map +1 -1
  55. package/dist/esm/v2/personalization/capabilities/gridPreferences.js +209 -0
  56. package/dist/esm/v2/personalization/capabilities/gridPreferences.js.map +1 -0
  57. package/dist/esm/v2/personalization/capabilities/index.js +5 -0
  58. package/dist/esm/v2/personalization/capabilities/index.js.map +1 -1
  59. package/dist/esm/v2/personalization/index.js +18 -0
  60. package/dist/esm/v2/personalization/index.js.map +1 -1
  61. package/dist/index.d.ts +2 -0
  62. package/dist/index.d.ts.map +1 -1
  63. package/dist/index.js +14 -0
  64. package/dist/index.js.map +1 -1
  65. package/dist/v2/__tests__/FieldError.test.js +26 -30
  66. package/dist/v2/__tests__/FieldError.test.js.map +1 -1
  67. package/dist/v2/__tests__/FieldWidth.test.js +150 -0
  68. package/dist/v2/__tests__/FieldWidth.test.js.map +1 -0
  69. package/dist/v2/__tests__/FileCard.test.js +25 -29
  70. package/dist/v2/__tests__/FileCard.test.js.map +1 -1
  71. package/dist/v2/__tests__/FormikCheckbox.test.js +268 -0
  72. package/dist/v2/__tests__/FormikCheckbox.test.js.map +1 -0
  73. package/dist/v2/__tests__/FormikDateTimePicker.test.js +247 -0
  74. package/dist/v2/__tests__/FormikDateTimePicker.test.js.map +1 -0
  75. package/dist/v2/__tests__/FormikRadioGroup.test.js +381 -0
  76. package/dist/v2/__tests__/FormikRadioGroup.test.js.map +1 -0
  77. package/dist/v2/__tests__/MobileRowCard.test.js +52 -56
  78. package/dist/v2/__tests__/MobileRowCard.test.js.map +1 -1
  79. package/dist/v2/__tests__/SectionErrorBoundary.test.js.map +1 -1
  80. package/dist/v2/__tests__/labels-merge.test.js +20 -24
  81. package/dist/v2/__tests__/labels-merge.test.js.map +1 -1
  82. package/dist/v2/components/DateTimePicker.d.ts.map +1 -1
  83. package/dist/v2/components/DateTimePicker.js +37 -4
  84. package/dist/v2/components/DateTimePicker.js.map +1 -1
  85. package/dist/v2/components/Field.d.ts +59 -1
  86. package/dist/v2/components/Field.d.ts.map +1 -1
  87. package/dist/v2/components/Field.js +62 -2
  88. package/dist/v2/components/Field.js.map +1 -1
  89. package/dist/v2/components/index.d.ts +27 -0
  90. package/dist/v2/components/index.d.ts.map +1 -1
  91. package/dist/v2/components/index.js.map +1 -1
  92. package/dist/v2/index.d.ts.map +1 -1
  93. package/dist/v2/index.js.map +1 -1
  94. package/dist/v2/patterns/FavoriteColumn.d.ts +9 -9
  95. package/dist/v2/patterns/FavoriteColumn.d.ts.map +1 -1
  96. package/dist/v2/patterns/FavoriteColumn.js +14 -61
  97. package/dist/v2/patterns/FavoriteColumn.js.map +1 -1
  98. package/dist/v2/patterns/FormikCheckbox.d.ts +77 -0
  99. package/dist/v2/patterns/FormikCheckbox.d.ts.map +1 -0
  100. package/dist/v2/patterns/FormikCheckbox.js +147 -0
  101. package/dist/v2/patterns/FormikCheckbox.js.map +1 -0
  102. package/dist/v2/patterns/FormikCombobox.d.ts +7 -1
  103. package/dist/v2/patterns/FormikCombobox.d.ts.map +1 -1
  104. package/dist/v2/patterns/FormikCombobox.js +5 -2
  105. package/dist/v2/patterns/FormikCombobox.js.map +1 -1
  106. package/dist/v2/patterns/FormikDatePicker.d.ts +13 -1
  107. package/dist/v2/patterns/FormikDatePicker.d.ts.map +1 -1
  108. package/dist/v2/patterns/FormikDatePicker.js +33 -66
  109. package/dist/v2/patterns/FormikDatePicker.js.map +1 -1
  110. package/dist/v2/patterns/FormikDateTimePicker.d.ts +111 -0
  111. package/dist/v2/patterns/FormikDateTimePicker.d.ts.map +1 -0
  112. package/dist/v2/patterns/FormikDateTimePicker.js +158 -0
  113. package/dist/v2/patterns/FormikDateTimePicker.js.map +1 -0
  114. package/dist/v2/patterns/FormikInput.d.ts +11 -1
  115. package/dist/v2/patterns/FormikInput.d.ts.map +1 -1
  116. package/dist/v2/patterns/FormikInput.js +5 -2
  117. package/dist/v2/patterns/FormikInput.js.map +1 -1
  118. package/dist/v2/patterns/FormikRadioGroup.d.ts +80 -0
  119. package/dist/v2/patterns/FormikRadioGroup.d.ts.map +1 -0
  120. package/dist/v2/patterns/FormikRadioGroup.js +148 -0
  121. package/dist/v2/patterns/FormikRadioGroup.js.map +1 -0
  122. package/dist/v2/patterns/FormikSelect.d.ts +9 -1
  123. package/dist/v2/patterns/FormikSelect.d.ts.map +1 -1
  124. package/dist/v2/patterns/FormikSelect.js +5 -2
  125. package/dist/v2/patterns/FormikSelect.js.map +1 -1
  126. package/dist/v2/patterns/FormikTextarea.d.ts +9 -1
  127. package/dist/v2/patterns/FormikTextarea.d.ts.map +1 -1
  128. package/dist/v2/patterns/FormikTextarea.js +5 -2
  129. package/dist/v2/patterns/FormikTextarea.js.map +1 -1
  130. package/dist/v2/patterns/KeyboardShortcutsHelp.d.ts +14 -1
  131. package/dist/v2/patterns/KeyboardShortcutsHelp.d.ts.map +1 -1
  132. package/dist/v2/patterns/KeyboardShortcutsHelp.js +25 -8
  133. package/dist/v2/patterns/KeyboardShortcutsHelp.js.map +1 -1
  134. package/dist/v2/patterns/RowFavoriteToggle.d.ts +92 -0
  135. package/dist/v2/patterns/RowFavoriteToggle.d.ts.map +1 -0
  136. package/dist/v2/patterns/RowFavoriteToggle.js +127 -0
  137. package/dist/v2/patterns/RowFavoriteToggle.js.map +1 -0
  138. package/dist/v2/patterns/_pickerSerialisation.d.ts +44 -0
  139. package/dist/v2/patterns/_pickerSerialisation.d.ts.map +1 -0
  140. package/dist/v2/patterns/_pickerSerialisation.js +81 -0
  141. package/dist/v2/patterns/_pickerSerialisation.js.map +1 -0
  142. package/dist/v2/patterns/index.d.ts +87 -0
  143. package/dist/v2/patterns/index.d.ts.map +1 -1
  144. package/dist/v2/patterns/index.js +34 -0
  145. package/dist/v2/patterns/index.js.map +1 -1
  146. package/dist/v2/personalization/capabilities/gridPreferences.d.ts +100 -0
  147. package/dist/v2/personalization/capabilities/gridPreferences.d.ts.map +1 -0
  148. package/dist/v2/personalization/capabilities/gridPreferences.js +215 -0
  149. package/dist/v2/personalization/capabilities/gridPreferences.js.map +1 -0
  150. package/dist/v2/personalization/capabilities/index.d.ts +6 -0
  151. package/dist/v2/personalization/capabilities/index.d.ts.map +1 -1
  152. package/dist/v2/personalization/capabilities/index.js +13 -0
  153. package/dist/v2/personalization/capabilities/index.js.map +1 -1
  154. package/dist/v2/personalization/index.d.ts +18 -0
  155. package/dist/v2/personalization/index.d.ts.map +1 -1
  156. package/dist/v2/personalization/index.js +13 -0
  157. package/dist/v2/personalization/index.js.map +1 -1
  158. package/package.json +1 -1
@@ -0,0 +1,74 @@
1
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
+ import moment from "moment";
3
+
4
+ /**
5
+ * _pickerSerialisation — lecture / ecriture partagees des ponts Formik de date.
6
+ *
7
+ * ── POURQUOI CE MODULE EXISTE ────────────────────────────────────────
8
+ *
9
+ * `FormikDatePicker` portait ces deux fonctions en prive. L'arrivee d'un
10
+ * SECOND pont (`FormikDateTimePicker`, gap G-E) posait le choix : les recopier,
11
+ * ou les partager.
12
+ *
13
+ * Les recopier aurait reproduit exactement la situation que la note S-03 de
14
+ * `FormikDatePicker` raconte. Rappel de ce qu'elle dit : ce pont serialisait
15
+ * VERS moment mais relisait DEPUIS `new Date(raw)`, en ignorant
16
+ * `outputFormat`. L'asymetrie corrompait silencieusement tout format non ISO —
17
+ * `new Date("31-12-2026")` donne Invalid Date, `new Date("05-03-2026")` donne
18
+ * le 3 mai au lieu du 5 mars. Le chemin d'ECRITURE fonctionnait, donc un
19
+ * formulaire rempli puis soumis se comportait correctement : le degat
20
+ * n'apparaissait qu'a la RELECTURE, c'est-a-dire en modification. Un module a
21
+ * livre ce defaut pendant sept lots sous un typecheck strict.
22
+ *
23
+ * Une asymetrie de ce genre entre DEUX ponts serait encore moins visible : ils
24
+ * se ressemblent, personne ne les compare, et chacun a l'air correct
25
+ * isolement. La seule garantie est qu'il n'y ait qu'un exemplaire du couple
26
+ * lecture / ecriture.
27
+ *
28
+ * Module INTERNE : non exporte par la surface publique (prefixe `_`).
29
+ */
30
+
31
+ /**
32
+ * Relit une valeur stockee par Formik vers un `Date`.
33
+ *
34
+ * `outputFormat` est passe pour que la lecture soit SYMETRIQUE de
35
+ * `serialiseDate` : on parse avec le format qui a servi a ecrire, en mode
36
+ * STRICT. Une valeur stockee qui ne correspond pas rend `null` plutot que la
37
+ * meilleure approximation de moment — une date absente est recuperable, une
38
+ * date fausse de deux mois ne l'est pas.
39
+ */
40
+ export var coerceToDate = function coerceToDate(raw, outputFormat) {
41
+ if (raw == null || raw === "") return null;
42
+ if (raw instanceof Date) return raw;
43
+ if (_typeof(raw) === "object" && typeof raw.toDate === "function") {
44
+ var _d$getTime;
45
+ var _d = raw.toDate();
46
+ return isNaN(_d === null || _d === void 0 ? void 0 : (_d$getTime = _d.getTime) === null || _d$getTime === void 0 ? void 0 : _d$getTime.call(_d)) ? null : _d;
47
+ }
48
+ /* Garde sur `typeof raw === "string"` : un horodatage numerique garde le
49
+ * chemin `new Date(number)`, `moment(number, format)` n'ayant pas de sens.
50
+ * "iso" est exclu : ce n'est pas un jeton moment, et `new Date(isoString)`
51
+ * est deja correct. */
52
+ if (typeof raw === "string" && outputFormat !== undefined && outputFormat !== "iso") {
53
+ var parsed = moment(raw, outputFormat, true);
54
+ return parsed.isValid() ? parsed.toDate() : null;
55
+ }
56
+ var d = new Date(raw);
57
+ return isNaN(d.getTime()) ? null : d;
58
+ };
59
+
60
+ /**
61
+ * Serialise un `Date` vers le format demande.
62
+ * undefined -> rend le `Date` tel quel (defaut, compatible)
63
+ * "iso" -> `Date.toISOString()`
64
+ * toute autre chaine -> `moment(date).format(outputFormat)`
65
+ */
66
+ export function serialiseDate(date, outputFormat) {
67
+ if (!date || !(date instanceof Date) || isNaN(date.getTime())) {
68
+ return outputFormat ? "" : null;
69
+ }
70
+ if (!outputFormat) return date;
71
+ if (outputFormat === "iso") return date.toISOString();
72
+ return moment(date).format(outputFormat);
73
+ }
74
+ //# sourceMappingURL=_pickerSerialisation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_pickerSerialisation.js","names":["moment","coerceToDate","raw","outputFormat","Date","_typeof","toDate","_d$getTime","d","isNaN","getTime","call","undefined","parsed","isValid","serialiseDate","date","toISOString","format"],"sources":["../../../../src/lib/v2/patterns/_pickerSerialisation.ts"],"sourcesContent":["import moment from \"moment\";\r\n\r\n/**\r\n * _pickerSerialisation — lecture / ecriture partagees des ponts Formik de date.\r\n *\r\n * ── POURQUOI CE MODULE EXISTE ────────────────────────────────────────\r\n *\r\n * `FormikDatePicker` portait ces deux fonctions en prive. L'arrivee d'un\r\n * SECOND pont (`FormikDateTimePicker`, gap G-E) posait le choix : les recopier,\r\n * ou les partager.\r\n *\r\n * Les recopier aurait reproduit exactement la situation que la note S-03 de\r\n * `FormikDatePicker` raconte. Rappel de ce qu'elle dit : ce pont serialisait\r\n * VERS moment mais relisait DEPUIS `new Date(raw)`, en ignorant\r\n * `outputFormat`. L'asymetrie corrompait silencieusement tout format non ISO —\r\n * `new Date(\"31-12-2026\")` donne Invalid Date, `new Date(\"05-03-2026\")` donne\r\n * le 3 mai au lieu du 5 mars. Le chemin d'ECRITURE fonctionnait, donc un\r\n * formulaire rempli puis soumis se comportait correctement : le degat\r\n * n'apparaissait qu'a la RELECTURE, c'est-a-dire en modification. Un module a\r\n * livre ce defaut pendant sept lots sous un typecheck strict.\r\n *\r\n * Une asymetrie de ce genre entre DEUX ponts serait encore moins visible : ils\r\n * se ressemblent, personne ne les compare, et chacun a l'air correct\r\n * isolement. La seule garantie est qu'il n'y ait qu'un exemplaire du couple\r\n * lecture / ecriture.\r\n *\r\n * Module INTERNE : non exporte par la surface publique (prefixe `_`).\r\n */\r\n\r\n/**\r\n * Relit une valeur stockee par Formik vers un `Date`.\r\n *\r\n * `outputFormat` est passe pour que la lecture soit SYMETRIQUE de\r\n * `serialiseDate` : on parse avec le format qui a servi a ecrire, en mode\r\n * STRICT. Une valeur stockee qui ne correspond pas rend `null` plutot que la\r\n * meilleure approximation de moment — une date absente est recuperable, une\r\n * date fausse de deux mois ne l'est pas.\r\n */\r\nexport const coerceToDate = (\r\n raw: unknown,\r\n outputFormat?: string\r\n): Date | null => {\r\n if (raw == null || raw === \"\") return null;\r\n if (raw instanceof Date) return raw;\r\n if (\r\n typeof raw === \"object\" &&\r\n typeof (raw as { toDate?: () => Date }).toDate === \"function\"\r\n ) {\r\n const d = (raw as { toDate: () => Date }).toDate();\r\n return isNaN(d?.getTime?.()) ? null : d;\r\n }\r\n /* Garde sur `typeof raw === \"string\"` : un horodatage numerique garde le\r\n * chemin `new Date(number)`, `moment(number, format)` n'ayant pas de sens.\r\n * \"iso\" est exclu : ce n'est pas un jeton moment, et `new Date(isoString)`\r\n * est deja correct. */\r\n if (\r\n typeof raw === \"string\" &&\r\n outputFormat !== undefined &&\r\n outputFormat !== \"iso\"\r\n ) {\r\n const parsed = moment(raw, outputFormat, true);\r\n return parsed.isValid() ? parsed.toDate() : null;\r\n }\r\n const d = new Date(raw as string | number);\r\n return isNaN(d.getTime()) ? null : d;\r\n};\r\n\r\n/**\r\n * Serialise un `Date` vers le format demande.\r\n * undefined -> rend le `Date` tel quel (defaut, compatible)\r\n * \"iso\" -> `Date.toISOString()`\r\n * toute autre chaine -> `moment(date).format(outputFormat)`\r\n */\r\nexport function serialiseDate(\r\n date: Date | null,\r\n outputFormat: string | undefined\r\n): Date | string | null {\r\n if (!date || !(date instanceof Date) || isNaN(date.getTime())) {\r\n return outputFormat ? \"\" : null;\r\n }\r\n if (!outputFormat) return date;\r\n if (outputFormat === \"iso\") return date.toISOString();\r\n return moment(date).format(outputFormat);\r\n}\r\n"],"mappings":";AAAA,OAAOA,MAAM,MAAM,QAAQ;;AAE3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,IAAMC,YAAY,GAAG,SAAfA,YAAYA,CACvBC,GAAY,EACZC,YAAqB,EACL;EAChB,IAAID,GAAG,I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,KAAK,KAAK,EAAE,OAAOa,IAAI,CAACC,WAAW,CAAC,CAAC;EACrD,OAAOjB,MAAM,CAACgB,IAAI,CAAC,CAACE,MAAM,CAACf,YAAY,CAAC;AAC1C","ignoreList":[]}
@@ -12,6 +12,29 @@ export { default as DataGrid, applySort } from "./DataGrid";
12
12
  export { default as DataGridVirtualized } from "./DataGridVirtualized";
13
13
  export { default as DataGridSettingsMenu } from "./DataGridSettingsMenu";
14
14
  export { default as DataGridToolbar } from "./DataGridToolbar";
15
+ /**
16
+ * DataGridToolbar contracts — public typed surface (gap G-I).
17
+ *
18
+ * Meme defaut que les blocs `StepStatus`, `FieldHelp`, `Status` et `Field` :
19
+ * la barre d'outils etait exportee comme VALEUR, sans les types de ses props.
20
+ * `DataGridToolbarFilterChip` est celui qui manque le plus : §Filters et
21
+ * §Search des Platform Mandatory UX Patterns imposent des criteres actifs
22
+ * retirables, `filterChips` est la capacite qui les rend, et un hote qui
23
+ * construit ce tableau a besoin de la forme d'une entree.
24
+ *
25
+ * Sans le type, il redeclare `{ key, label, onRemove }` au point d'appel — ce
26
+ * que les Platform TypeScript Guidelines interdisent (« Reusable types belong
27
+ * inside Shared UI Library … Never duplicate »). Releve depuis
28
+ * `refonte-frontend` (lot 8, ecart A9), ou dix listings doivent construire ces
29
+ * pastilles a partir d'une brique partagee.
30
+ *
31
+ * `DataGridToolbarLabels` voyage avec : un hote qui traduit la barre d'outils
32
+ * en a besoin, et c'est la meme duplication un niveau plus bas.
33
+ *
34
+ * FLAT-ONLY, per the policy note in src/lib/index.ts.
35
+ * Additive and type-only: no runtime change, no existing export altered.
36
+ */
37
+
15
38
  export { default as CollapsibleDataGrid } from "./CollapsibleDataGrid";
16
39
  export { default as SortableHeader, getAriaSort } from "./SortableHeader";
17
40
  export { default as NetworkErrorBanner } from "./NetworkErrorBanner";
@@ -52,6 +75,26 @@ export { default as SavedFiltersMenu } from "./SavedFiltersMenu";
52
75
  // FavoritesFilter is the all/favorites-only segmented control.
53
76
  export { default as makeFavoriteColumn } from "./FavoriteColumn";
54
77
  export { default as FavoritesFilter } from "./FavoritesFilter";
78
+ /**
79
+ * RowFavoriteToggle — the per-row follow star, standalone (gap G-36).
80
+ *
81
+ * It already existed as a PRIVATE `FavoriteCell` inside `makeFavoriteColumn`,
82
+ * which made the follow control reachable as a DataGrid column and nowhere
83
+ * else. The other place a row always appears is the mobile card: `DataGrid`
84
+ * swaps to `renderMobileCard` below its `mobileBreakpoint`, and
85
+ * `MobileRowCard` has a `leading` slot for exactly this — but a column
86
+ * definition cannot be rendered into a slot, so hosts rebuilt the star by
87
+ * hand (`onssa-export-fe`'s `MobileFavoriteToggle`; `ms-ti-fe` destructures
88
+ * the same MobileRowCard + FavoriteToggle + useIsFavorite trio).
89
+ *
90
+ * Same failure mode as G-10: the library owned the behaviour but exposed it at
91
+ * one composition point only. And the copies drifted where it is least visible
92
+ * and matters most — the local twin announced "Ajouter aux favoris" while the
93
+ * grid column on the same page said "Suivre", and it dropped the status
94
+ * tooltip. `makeFavoriteColumn` now renders this component, so the two agree
95
+ * by construction.
96
+ */
97
+ export { default as RowFavoriteToggle, DEFAULT_ROW_FAVORITE_LABELS } from "./RowFavoriteToggle";
55
98
  // ── Formik bridges ────────────────────────────────────────────────────────────
56
99
  export { default as FormikInput } from "./FormikInput";
57
100
  export { default as FormikTextarea } from "./FormikTextarea";
@@ -87,6 +130,46 @@ export { default as FormikCombobox } from "./FormikCombobox";
87
130
  export { default as FormikDatePicker } from "./FormikDatePicker";
88
131
  export { default as FormikFile } from "./FormikFile";
89
132
  export { default as FormikCheckboxGroup } from "./FormikCheckboxGroup";
133
+ /**
134
+ * FormikCheckbox — pont pour une case a cocher BOOLEENNE simple (gap G-A).
135
+ *
136
+ * `FormikCheckboxGroup` porte un TABLEAU de valeurs selectionnees : un hote
137
+ * dont l'etat est un booleen (`autreInfo.fabrication`,
138
+ * `objectDeclaration.premiereDeclaration`) ne peut pas l'adopter sans changer
139
+ * ce que son payload envoie. Faute de pont, les modules recablaient
140
+ * `Checkbox` + `useField` a la main — duplication interdite par R-2.1, et qui
141
+ * perdait systematiquement le rendu de l'erreur (R-4.1 MUST).
142
+ *
143
+ * Le type de props est expose : meme classe que Gap-TS-003 ci-dessus.
144
+ */
145
+ export { default as FormikCheckbox } from "./FormikCheckbox";
146
+ /**
147
+ * FormikRadioGroup — pont pour un groupe de radios (gap G-C).
148
+ *
149
+ * R-Sel.2 est un MUST : 2-3 options -> Radio ou Segmented, jamais un Select.
150
+ * Toute question metier binaire passe donc par `RadioGroup`, qui n'avait aucun
151
+ * pont Formik la ou `FormikSelect`, `FormikCombobox`, `FormikCheckboxGroup` et
152
+ * les autres en ont un. Les hotes recablaient `useField` + `RadioGroup` a la
153
+ * main, et y perdaient `FieldError`.
154
+ *
155
+ * Contrat invisible a connaitre : la valeur ECRITE est celle DECLAREE dans
156
+ * `options`, pas la chaine que rapporte le DOM — un hote aux options
157
+ * numeriques continue de stocker des nombres.
158
+ */
159
+ export { default as FormikRadioGroup } from "./FormikRadioGroup";
160
+ /**
161
+ * FormikDateTimePicker — pont date + HEURE (gap G-E).
162
+ *
163
+ * `FormikDatePicker` etait le seul pont de date de la library, et il est
164
+ * date-seule. Un hote ayant besoin de l'heure devait soit la perdre — ce qui
165
+ * change ce que recoit le backend, pas seulement l'affichage — soit recabler
166
+ * `useField` + le `DateTimePicker` nu, donc dupliquer.
167
+ *
168
+ * Les deux ponts PARTAGENT `coerceToDate` / `serialiseDate`
169
+ * (`./_pickerSerialisation`) : voir la note S-03 de `FormikDatePicker` pour ce
170
+ * qui arrive quand la lecture et l'ecriture d'une date divergent.
171
+ */
172
+ export { default as FormikDateTimePicker } from "./FormikDateTimePicker";
90
173
  export { default as FormikReferentielField } from "./FormikReferentielField";
91
174
  /** Affichage valeur système — fond grisé, aucune interaction.
92
175
  * Utiliser à la place de FormikInput disabled pour les champs
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["default","ActionBar","BulkActionBar","ColumnsToggle","FormSection","FormPageShell","FormErrorSummary","FormikErrorFocus","PageContent","DataGrid","applySort","DataGridVirtualized","DataGridSettingsMenu","DataGridToolbar","CollapsibleDataGrid","SortableHeader","getAriaSort","NetworkErrorBanner","ReferentielField","Tour","KeyboardShortcutsHelp","DeleteResourceConfirmDialog","SaveFilterDialog","SavedFiltersMenu","makeFavoriteColumn","FavoritesFilter","FormikInput","FormikTextarea","FormikSelect","FormikCombobox","FormikDatePicker","FormikFile","FormikCheckboxGroup","FormikReferentielField","FormikDisplay"],"sources":["../../../../src/lib/v2/patterns/index.ts"],"sourcesContent":["export { default as ActionBar } from \"./ActionBar\";\r\nexport type { ActionBarProps, ActionBarAction, ActionBarLabels, BreadcrumbItem, CrumbEntry } from \"./ActionBar\";\r\nexport { default as BulkActionBar } from \"./BulkActionBar\";\r\nexport { default as ColumnsToggle } from \"./ColumnsToggle\";\r\nexport { default as FormSection } from \"./FormSection\";\r\nexport { default as FormPageShell } from \"./FormPageShell\";\r\nexport { default as FormErrorSummary } from \"./FormErrorSummary\";\r\nexport type { FormErrorSummaryProps, FormErrorSummaryError } from \"./FormErrorSummary\";\r\n// R-FV.3 companion to FormErrorSummary (R-FV.2) — renders nothing, moves\r\n// focus to the first field in error after a failed submit. Adopt both.\r\nexport { default as FormikErrorFocus } from \"./FormikErrorFocus\";\r\nexport type { FormikErrorFocusProps } from \"./FormikErrorFocus\";\r\nexport { default as PageContent } from \"./PageContent\";\r\nexport { default as DataGrid, applySort } from \"./DataGrid\";\r\nexport { default as DataGridVirtualized } from \"./DataGridVirtualized\";\r\nexport { default as DataGridSettingsMenu } from \"./DataGridSettingsMenu\";\r\nexport { default as DataGridToolbar } from \"./DataGridToolbar\";\r\nexport { default as CollapsibleDataGrid } from \"./CollapsibleDataGrid\";\r\nexport { default as SortableHeader, getAriaSort } from \"./SortableHeader\";\r\nexport { default as NetworkErrorBanner } from \"./NetworkErrorBanner\";\r\nexport { default as ReferentielField } from \"./ReferentielField\";\r\n/**\r\n * ReferentielField configuration types — public typed surface.\r\n *\r\n * Same class of gap as Gap-TS-003 (component types), which was fixed for\r\n * `./components` but never extended to `./patterns`: the VALUE above was\r\n * exported while the types describing its own REQUIRED props were not.\r\n * `columns` and `criteria` are mandatory-to-configure, so a consumer had no\r\n * way to type them without either deep-importing\r\n * `@portnet/ui/dist/v2/patterns/…` (fragile, bypasses the `exports` map) or\r\n * declaring a local twin — which the Platform TypeScript Guidelines forbid\r\n * (\"Reusable types belong inside Shared UI Library … Never duplicate\").\r\n *\r\n * `ReferentielSearchResult` and `ReferentielSearchParams` are deliberately\r\n * NOT re-exported here: identically-named types are already surfaced from\r\n * `./referentiel` (useReferentielSearch) and `./v2/models` respectively, and\r\n * `src/lib/index.ts` star-exports all three barrels — a second named export of\r\n * either identifier is a hard TS2308 ambiguity at the library root.\r\n *\r\n * Additive and type-only: no runtime change, no existing export altered.\r\n */\r\nexport type {\r\n ReferentielFieldProps,\r\n ReferentielCriterion,\r\n ReferentielFieldLabels,\r\n} from \"./ReferentielField\";\r\nexport { default as Tour } from \"./Tour\";\r\nexport { default as KeyboardShortcutsHelp } from \"./KeyboardShortcutsHelp\";\r\nexport { default as DeleteResourceConfirmDialog } from \"./DeleteResourceConfirmDialog\";\r\n\r\n// ── Personalization · Saved Filters framework (v2/personalization) ────────────\r\n// SaveFilterDialog is presentational; SavedFiltersMenu is connected to the\r\n// savedFilters capability via useSavedFilters.\r\nexport { default as SaveFilterDialog } from \"./SaveFilterDialog\";\r\nexport { default as SavedFiltersMenu } from \"./SavedFiltersMenu\";\r\n\r\n// ── Personalization · Favorites DataGrid integration (v2/personalization) ─────\r\n// makeFavoriteColumn builds an always-visible favorites column for v2.DataGrid;\r\n// FavoritesFilter is the all/favorites-only segmented control.\r\nexport { default as makeFavoriteColumn } from \"./FavoriteColumn\";\r\nexport { default as FavoritesFilter } from \"./FavoritesFilter\";\r\nexport type { FavoritesFilterProps, FavoritesFilterLabels } from \"./FavoritesFilter\";\r\n\r\n// ── Formik bridges ────────────────────────────────────────────────────────────\r\nexport { default as FormikInput } from \"./FormikInput\";\r\nexport { default as FormikTextarea } from \"./FormikTextarea\";\r\nexport { default as FormikSelect } from \"./FormikSelect\";\r\nexport { default as FormikCombobox } from \"./FormikCombobox\";\r\n/**\r\n * FormikCombobox props — public typed surface.\r\n *\r\n * SAME GAP-TS-003 CLASS as the ReferentielField note above. That fix covered\r\n * `ReferentielField` and `FormikReferentielField` but was not extended to the\r\n * other Formik bridges: the VALUE is exported while the type describing its props\r\n * is not, so a consumer cannot write `Omit<FormikComboboxProps<T>, …>`.\r\n *\r\n * REQUESTED BY bmdav-fe (TypeScript migration, batch 6f). That module stores the\r\n * OPTION OBJECT in Formik rather than a primitive key, because its payload mapper\r\n * reads `values.typeDemande.id` and sends `delegationTraitement` as a whole\r\n * object — so it cannot adopt the primitive-key model without changing the\r\n * request body sent to bmdav-be. It contains the resulting variance in ONE local\r\n * adapter (`ObjectValuedFormikCombobox`) rather than scattering assertions across\r\n * call sites, and that adapter must restate this component's prop contract minus\r\n * `getOptionValue`. The deep-import fallback is unavailable under\r\n * `moduleResolution: \"bundler\"`, since the package `exports` map does not expose\r\n * `dist/v2/patterns/*`.\r\n *\r\n * `ComboboxOptionValue` is deliberately NOT re-exported here — it is already\r\n * surfaced from `./components` (Combobox), and a second named export at the\r\n * library root would be a TS2308 ambiguity, exactly as recorded above for\r\n * `ReferentielSearchResult` / `ReferentielSearchParams`.\r\n *\r\n * Additive and type-only: no runtime change, no existing export altered.\r\n */\r\nexport type { FormikComboboxProps } from \"./FormikCombobox\";\r\nexport { default as FormikDatePicker } from \"./FormikDatePicker\";\r\nexport { default as FormikFile } from \"./FormikFile\";\r\nexport { default as FormikCheckboxGroup } from \"./FormikCheckboxGroup\";\r\nexport { default as FormikReferentielField } from \"./FormikReferentielField\";\r\nexport type { FormikReferentielFieldProps } from \"./FormikReferentielField\";\r\n\r\n/** Affichage valeur système — fond grisé, aucune interaction.\r\n * Utiliser à la place de FormikInput disabled pour les champs\r\n * auto-générés ou non modifiables par l'utilisateur. */\r\nexport { default as FormikDisplay } from \"../components/FormikDisplay\";\r\n"],"mappings":"AAAA,SAASA,OAAO,IAAIC,SAAS,QAAmB,aAAa;AAE7D,SAASD,OAAO,IAAIE,aAAa,QAAe,iBAAiB;AACjE,SAASF,OAAO,IAAIG,aAAa,QAAe,iBAAiB;AACjE,SAASH,OAAO,IAAII,WAAW,QAAiB,eAAe;AAC/D,SAASJ,OAAO,IAAIK,aAAa,QAAe,iBAAiB;AACjE,SAASL,OAAO,IAAIM,gBAAgB,QAAY,oBAAoB;AAEpE;AACA;AACA,SAASN,OAAO,IAAIO,gBAAgB,QAAY,oBAAoB;AAEpE,SAASP,OAAO,IAAIQ,WAAW,QAAiB,eAAe;AAC/D,SAASR,OAAO,IAAIS,QAAQ,EAAEC,SAAS,QAAS,YAAY;AAC5D,SAASV,OAAO,IAAIW,mBAAmB,QAAS,uBAAuB;AACvE,SAASX,OAAO,IAAIY,oBAAoB,QAAQ,wBAAwB;AACxE,SAASZ,OAAO,IAAIa,eAAe,QAAa,mBAAmB;AACnE,SAASb,OAAO,IAAIc,mBAAmB,QAAS,uBAAuB;AACvE,SAASd,OAAO,IAAIe,cAAc,EAAEC,WAAW,QAAQ,kBAAkB;AACzE,SAAShB,OAAO,IAAIiB,kBAAkB,QAAU,sBAAsB;AACtE,SAASjB,OAAO,IAAIkB,gBAAgB,QAAY,oBAAoB;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAMA,SAASlB,OAAO,IAAImB,IAAI,QAAwB,QAAQ;AACxD,SAASnB,OAAO,IAAIoB,qBAAqB,QAAQ,yBAAyB;AAC1E,SAASpB,OAAO,IAAIqB,2BAA2B,QAAQ,+BAA+B;;AAEtF;AACA;AACA;AACA,SAASrB,OAAO,IAAIsB,gBAAgB,QAAY,oBAAoB;AACpE,SAAStB,OAAO,IAAIuB,gBAAgB,QAAY,oBAAoB;;AAEpE;AACA;AACA;AACA,SAASvB,OAAO,IAAIwB,kBAAkB,QAAU,kBAAkB;AAClE,SAASxB,OAAO,IAAIyB,eAAe,QAAa,mBAAmB;AAGnE;AACA,SAASzB,OAAO,IAAI0B,WAAW,QAAiB,eAAe;AAC/D,SAAS1B,OAAO,IAAI2B,cAAc,QAAc,kBAAkB;AAClE,SAAS3B,OAAO,IAAI4B,YAAY,QAAgB,gBAAgB;AAChE,SAAS5B,OAAO,IAAI6B,cAAc,QAAc,kBAAkB;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAAS7B,OAAO,IAAI8B,gBAAgB,QAAY,oBAAoB;AACpE,SAAS9B,OAAO,IAAI+B,UAAU,QAAkB,cAAc;AAC9D,SAAS/B,OAAO,IAAIgC,mBAAmB,QAAS,uBAAuB;AACvE,SAAShC,OAAO,IAAIiC,sBAAsB,QAAQ,0BAA0B;AAG5E;AACA;AACA;AACA,SAASjC,OAAO,IAAIkC,aAAa,QAAe,6BAA6B","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["default","ActionBar","BulkActionBar","ColumnsToggle","FormSection","FormPageShell","FormErrorSummary","FormikErrorFocus","PageContent","DataGrid","applySort","DataGridVirtualized","DataGridSettingsMenu","DataGridToolbar","CollapsibleDataGrid","SortableHeader","getAriaSort","NetworkErrorBanner","ReferentielField","Tour","KeyboardShortcutsHelp","DeleteResourceConfirmDialog","SaveFilterDialog","SavedFiltersMenu","makeFavoriteColumn","FavoritesFilter","RowFavoriteToggle","DEFAULT_ROW_FAVORITE_LABELS","FormikInput","FormikTextarea","FormikSelect","FormikCombobox","FormikDatePicker","FormikFile","FormikCheckboxGroup","FormikCheckbox","FormikRadioGroup","FormikDateTimePicker","FormikReferentielField","FormikDisplay"],"sources":["../../../../src/lib/v2/patterns/index.ts"],"sourcesContent":["export { default as ActionBar } from \"./ActionBar\";\r\nexport type { ActionBarProps, ActionBarAction, ActionBarLabels, BreadcrumbItem, CrumbEntry } from \"./ActionBar\";\r\nexport { default as BulkActionBar } from \"./BulkActionBar\";\r\nexport { default as ColumnsToggle } from \"./ColumnsToggle\";\r\nexport { default as FormSection } from \"./FormSection\";\r\nexport { default as FormPageShell } from \"./FormPageShell\";\r\nexport { default as FormErrorSummary } from \"./FormErrorSummary\";\r\nexport type { FormErrorSummaryProps, FormErrorSummaryError } from \"./FormErrorSummary\";\r\n// R-FV.3 companion to FormErrorSummary (R-FV.2) — renders nothing, moves\r\n// focus to the first field in error after a failed submit. Adopt both.\r\nexport { default as FormikErrorFocus } from \"./FormikErrorFocus\";\r\nexport type { FormikErrorFocusProps } from \"./FormikErrorFocus\";\r\nexport { default as PageContent } from \"./PageContent\";\r\nexport { default as DataGrid, applySort } from \"./DataGrid\";\r\nexport { default as DataGridVirtualized } from \"./DataGridVirtualized\";\r\nexport { default as DataGridSettingsMenu } from \"./DataGridSettingsMenu\";\r\nexport { default as DataGridToolbar } from \"./DataGridToolbar\";\r\n/**\r\n * DataGridToolbar contracts — public typed surface (gap G-I).\r\n *\r\n * Meme defaut que les blocs `StepStatus`, `FieldHelp`, `Status` et `Field` :\r\n * la barre d'outils etait exportee comme VALEUR, sans les types de ses props.\r\n * `DataGridToolbarFilterChip` est celui qui manque le plus : §Filters et\r\n * §Search des Platform Mandatory UX Patterns imposent des criteres actifs\r\n * retirables, `filterChips` est la capacite qui les rend, et un hote qui\r\n * construit ce tableau a besoin de la forme d'une entree.\r\n *\r\n * Sans le type, il redeclare `{ key, label, onRemove }` au point d'appel — ce\r\n * que les Platform TypeScript Guidelines interdisent (« Reusable types belong\r\n * inside Shared UI Library … Never duplicate »). Releve depuis\r\n * `refonte-frontend` (lot 8, ecart A9), ou dix listings doivent construire ces\r\n * pastilles a partir d'une brique partagee.\r\n *\r\n * `DataGridToolbarLabels` voyage avec : un hote qui traduit la barre d'outils\r\n * en a besoin, et c'est la meme duplication un niveau plus bas.\r\n *\r\n * FLAT-ONLY, per the policy note in src/lib/index.ts.\r\n * Additive and type-only: no runtime change, no existing export altered.\r\n */\r\nexport type {\r\n DataGridToolbarProps,\r\n DataGridToolbarFilterChip,\r\n DataGridToolbarLabels,\r\n} from \"./DataGridToolbar\";\r\nexport { default as CollapsibleDataGrid } from \"./CollapsibleDataGrid\";\r\nexport { default as SortableHeader, getAriaSort } from \"./SortableHeader\";\r\nexport { default as NetworkErrorBanner } from \"./NetworkErrorBanner\";\r\nexport { default as ReferentielField } from \"./ReferentielField\";\r\n/**\r\n * ReferentielField configuration types — public typed surface.\r\n *\r\n * Same class of gap as Gap-TS-003 (component types), which was fixed for\r\n * `./components` but never extended to `./patterns`: the VALUE above was\r\n * exported while the types describing its own REQUIRED props were not.\r\n * `columns` and `criteria` are mandatory-to-configure, so a consumer had no\r\n * way to type them without either deep-importing\r\n * `@portnet/ui/dist/v2/patterns/…` (fragile, bypasses the `exports` map) or\r\n * declaring a local twin — which the Platform TypeScript Guidelines forbid\r\n * (\"Reusable types belong inside Shared UI Library … Never duplicate\").\r\n *\r\n * `ReferentielSearchResult` and `ReferentielSearchParams` are deliberately\r\n * NOT re-exported here: identically-named types are already surfaced from\r\n * `./referentiel` (useReferentielSearch) and `./v2/models` respectively, and\r\n * `src/lib/index.ts` star-exports all three barrels — a second named export of\r\n * either identifier is a hard TS2308 ambiguity at the library root.\r\n *\r\n * Additive and type-only: no runtime change, no existing export altered.\r\n */\r\nexport type {\r\n ReferentielFieldProps,\r\n ReferentielCriterion,\r\n ReferentielFieldLabels,\r\n} from \"./ReferentielField\";\r\nexport { default as Tour } from \"./Tour\";\r\nexport { default as KeyboardShortcutsHelp } from \"./KeyboardShortcutsHelp\";\r\nexport { default as DeleteResourceConfirmDialog } from \"./DeleteResourceConfirmDialog\";\r\n\r\n// ── Personalization · Saved Filters framework (v2/personalization) ────────────\r\n// SaveFilterDialog is presentational; SavedFiltersMenu is connected to the\r\n// savedFilters capability via useSavedFilters.\r\nexport { default as SaveFilterDialog } from \"./SaveFilterDialog\";\r\nexport { default as SavedFiltersMenu } from \"./SavedFiltersMenu\";\r\n\r\n// ── Personalization · Favorites DataGrid integration (v2/personalization) ─────\r\n// makeFavoriteColumn builds an always-visible favorites column for v2.DataGrid;\r\n// FavoritesFilter is the all/favorites-only segmented control.\r\nexport { default as makeFavoriteColumn } from \"./FavoriteColumn\";\r\nexport { default as FavoritesFilter } from \"./FavoritesFilter\";\r\nexport type { FavoritesFilterProps, FavoritesFilterLabels } from \"./FavoritesFilter\";\r\n\r\n/**\r\n * RowFavoriteToggle — the per-row follow star, standalone (gap G-36).\r\n *\r\n * It already existed as a PRIVATE `FavoriteCell` inside `makeFavoriteColumn`,\r\n * which made the follow control reachable as a DataGrid column and nowhere\r\n * else. The other place a row always appears is the mobile card: `DataGrid`\r\n * swaps to `renderMobileCard` below its `mobileBreakpoint`, and\r\n * `MobileRowCard` has a `leading` slot for exactly this — but a column\r\n * definition cannot be rendered into a slot, so hosts rebuilt the star by\r\n * hand (`onssa-export-fe`'s `MobileFavoriteToggle`; `ms-ti-fe` destructures\r\n * the same MobileRowCard + FavoriteToggle + useIsFavorite trio).\r\n *\r\n * Same failure mode as G-10: the library owned the behaviour but exposed it at\r\n * one composition point only. And the copies drifted where it is least visible\r\n * and matters most — the local twin announced \"Ajouter aux favoris\" while the\r\n * grid column on the same page said \"Suivre\", and it dropped the status\r\n * tooltip. `makeFavoriteColumn` now renders this component, so the two agree\r\n * by construction.\r\n */\r\nexport { default as RowFavoriteToggle, DEFAULT_ROW_FAVORITE_LABELS } from \"./RowFavoriteToggle\";\r\nexport type {\r\n RowFavoriteToggleProps,\r\n RowFavoriteToggleLabels,\r\n FavoriteToggleSize,\r\n} from \"./RowFavoriteToggle\";\r\n\r\n// ── Formik bridges ────────────────────────────────────────────────────────────\r\nexport { default as FormikInput } from \"./FormikInput\";\r\nexport { default as FormikTextarea } from \"./FormikTextarea\";\r\nexport { default as FormikSelect } from \"./FormikSelect\";\r\nexport { default as FormikCombobox } from \"./FormikCombobox\";\r\n/**\r\n * FormikCombobox props — public typed surface.\r\n *\r\n * SAME GAP-TS-003 CLASS as the ReferentielField note above. That fix covered\r\n * `ReferentielField` and `FormikReferentielField` but was not extended to the\r\n * other Formik bridges: the VALUE is exported while the type describing its props\r\n * is not, so a consumer cannot write `Omit<FormikComboboxProps<T>, …>`.\r\n *\r\n * REQUESTED BY bmdav-fe (TypeScript migration, batch 6f). That module stores the\r\n * OPTION OBJECT in Formik rather than a primitive key, because its payload mapper\r\n * reads `values.typeDemande.id` and sends `delegationTraitement` as a whole\r\n * object — so it cannot adopt the primitive-key model without changing the\r\n * request body sent to bmdav-be. It contains the resulting variance in ONE local\r\n * adapter (`ObjectValuedFormikCombobox`) rather than scattering assertions across\r\n * call sites, and that adapter must restate this component's prop contract minus\r\n * `getOptionValue`. The deep-import fallback is unavailable under\r\n * `moduleResolution: \"bundler\"`, since the package `exports` map does not expose\r\n * `dist/v2/patterns/*`.\r\n *\r\n * `ComboboxOptionValue` is deliberately NOT re-exported here — it is already\r\n * surfaced from `./components` (Combobox), and a second named export at the\r\n * library root would be a TS2308 ambiguity, exactly as recorded above for\r\n * `ReferentielSearchResult` / `ReferentielSearchParams`.\r\n *\r\n * Additive and type-only: no runtime change, no existing export altered.\r\n */\r\nexport type { FormikComboboxProps } from \"./FormikCombobox\";\r\nexport { default as FormikDatePicker } from \"./FormikDatePicker\";\r\nexport { default as FormikFile } from \"./FormikFile\";\r\nexport { default as FormikCheckboxGroup } from \"./FormikCheckboxGroup\";\r\n/**\r\n * FormikCheckbox — pont pour une case a cocher BOOLEENNE simple (gap G-A).\r\n *\r\n * `FormikCheckboxGroup` porte un TABLEAU de valeurs selectionnees : un hote\r\n * dont l'etat est un booleen (`autreInfo.fabrication`,\r\n * `objectDeclaration.premiereDeclaration`) ne peut pas l'adopter sans changer\r\n * ce que son payload envoie. Faute de pont, les modules recablaient\r\n * `Checkbox` + `useField` a la main — duplication interdite par R-2.1, et qui\r\n * perdait systematiquement le rendu de l'erreur (R-4.1 MUST).\r\n *\r\n * Le type de props est expose : meme classe que Gap-TS-003 ci-dessus.\r\n */\r\nexport { default as FormikCheckbox } from \"./FormikCheckbox\";\r\nexport type { FormikCheckboxProps } from \"./FormikCheckbox\";\r\n/**\r\n * FormikRadioGroup — pont pour un groupe de radios (gap G-C).\r\n *\r\n * R-Sel.2 est un MUST : 2-3 options -> Radio ou Segmented, jamais un Select.\r\n * Toute question metier binaire passe donc par `RadioGroup`, qui n'avait aucun\r\n * pont Formik la ou `FormikSelect`, `FormikCombobox`, `FormikCheckboxGroup` et\r\n * les autres en ont un. Les hotes recablaient `useField` + `RadioGroup` a la\r\n * main, et y perdaient `FieldError`.\r\n *\r\n * Contrat invisible a connaitre : la valeur ECRITE est celle DECLAREE dans\r\n * `options`, pas la chaine que rapporte le DOM — un hote aux options\r\n * numeriques continue de stocker des nombres.\r\n */\r\nexport { default as FormikRadioGroup } from \"./FormikRadioGroup\";\r\nexport type { FormikRadioGroupProps } from \"./FormikRadioGroup\";\r\n/**\r\n * FormikDateTimePicker — pont date + HEURE (gap G-E).\r\n *\r\n * `FormikDatePicker` etait le seul pont de date de la library, et il est\r\n * date-seule. Un hote ayant besoin de l'heure devait soit la perdre — ce qui\r\n * change ce que recoit le backend, pas seulement l'affichage — soit recabler\r\n * `useField` + le `DateTimePicker` nu, donc dupliquer.\r\n *\r\n * Les deux ponts PARTAGENT `coerceToDate` / `serialiseDate`\r\n * (`./_pickerSerialisation`) : voir la note S-03 de `FormikDatePicker` pour ce\r\n * qui arrive quand la lecture et l'ecriture d'une date divergent.\r\n */\r\nexport { default as FormikDateTimePicker } from \"./FormikDateTimePicker\";\r\nexport type { FormikDateTimePickerProps } from \"./FormikDateTimePicker\";\r\nexport { default as FormikReferentielField } from \"./FormikReferentielField\";\r\nexport type { FormikReferentielFieldProps } from \"./FormikReferentielField\";\r\n\r\n/** Affichage valeur système — fond grisé, aucune interaction.\r\n * Utiliser à la place de FormikInput disabled pour les champs\r\n * auto-générés ou non modifiables par l'utilisateur. */\r\nexport { default as FormikDisplay } from \"../components/FormikDisplay\";\r\n"],"mappings":"AAAA,SAASA,OAAO,IAAIC,SAAS,QAAmB,aAAa;AAE7D,SAASD,OAAO,IAAIE,aAAa,QAAe,iBAAiB;AACjE,SAASF,OAAO,IAAIG,aAAa,QAAe,iBAAiB;AACjE,SAASH,OAAO,IAAII,WAAW,QAAiB,eAAe;AAC/D,SAASJ,OAAO,IAAIK,aAAa,QAAe,iBAAiB;AACjE,SAASL,OAAO,IAAIM,gBAAgB,QAAY,oBAAoB;AAEpE;AACA;AACA,SAASN,OAAO,IAAIO,gBAAgB,QAAY,oBAAoB;AAEpE,SAASP,OAAO,IAAIQ,WAAW,QAAiB,eAAe;AAC/D,SAASR,OAAO,IAAIS,QAAQ,EAAEC,SAAS,QAAS,YAAY;AAC5D,SAASV,OAAO,IAAIW,mBAAmB,QAAS,uBAAuB;AACvE,SAASX,OAAO,IAAIY,oBAAoB,QAAQ,wBAAwB;AACxE,SAASZ,OAAO,IAAIa,eAAe,QAAa,mBAAmB;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAMA,SAASb,OAAO,IAAIc,mBAAmB,QAAS,uBAAuB;AACvE,SAASd,OAAO,IAAIe,cAAc,EAAEC,WAAW,QAAQ,kBAAkB;AACzE,SAAShB,OAAO,IAAIiB,kBAAkB,QAAU,sBAAsB;AACtE,SAASjB,OAAO,IAAIkB,gBAAgB,QAAY,oBAAoB;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAMA,SAASlB,OAAO,IAAImB,IAAI,QAAwB,QAAQ;AACxD,SAASnB,OAAO,IAAIoB,qBAAqB,QAAQ,yBAAyB;AAC1E,SAASpB,OAAO,IAAIqB,2BAA2B,QAAQ,+BAA+B;;AAEtF;AACA;AACA;AACA,SAASrB,OAAO,IAAIsB,gBAAgB,QAAY,oBAAoB;AACpE,SAAStB,OAAO,IAAIuB,gBAAgB,QAAY,oBAAoB;;AAEpE;AACA;AACA;AACA,SAASvB,OAAO,IAAIwB,kBAAkB,QAAU,kBAAkB;AAClE,SAASxB,OAAO,IAAIyB,eAAe,QAAa,mBAAmB;AAGnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASzB,OAAO,IAAI0B,iBAAiB,EAAEC,2BAA2B,QAAQ,qBAAqB;AAO/F;AACA,SAAS3B,OAAO,IAAI4B,WAAW,QAAiB,eAAe;AAC/D,SAAS5B,OAAO,IAAI6B,cAAc,QAAc,kBAAkB;AAClE,SAAS7B,OAAO,IAAI8B,YAAY,QAAgB,gBAAgB;AAChE,SAAS9B,OAAO,IAAI+B,cAAc,QAAc,kBAAkB;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAAS/B,OAAO,IAAIgC,gBAAgB,QAAY,oBAAoB;AACpE,SAAShC,OAAO,IAAIiC,UAAU,QAAkB,cAAc;AAC9D,SAASjC,OAAO,IAAIkC,mBAAmB,QAAS,uBAAuB;AACvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASlC,OAAO,IAAImC,cAAc,QAAc,kBAAkB;AAElE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASnC,OAAO,IAAIoC,gBAAgB,QAAY,oBAAoB;AAEpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASpC,OAAO,IAAIqC,oBAAoB,QAAQ,wBAAwB;AAExE,SAASrC,OAAO,IAAIsC,sBAAsB,QAAQ,0BAA0B;AAG5E;AACA;AACA;AACA,SAAStC,OAAO,IAAIuC,aAAa,QAAe,6BAA6B","ignoreList":[]}
@@ -0,0 +1,209 @@
1
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
2
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
3
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
4
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
5
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
6
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
7
+ /**
8
+ * gridPreferences — Portnet UI v2 · personalization capability
9
+ *
10
+ * Per-user, per-resource DataGrid preferences. Self-registers the
11
+ * "gridPreferences" capability with the schema registry at import time, so the
12
+ * capability-agnostic foundation discovers its schemaVersion / defaultState /
13
+ * migrate without any hardcoding.
14
+ *
15
+ * State model (the capability payload):
16
+ * { [resourceKey]: { hiddenColumns: string[] } }
17
+ *
18
+ * ─────────────────────────────────────────────────────────────────────────────
19
+ * WHY THIS BELONGS IN THE LIBRARY (capability gap G-35)
20
+ *
21
+ * `DataGridToolbar` owns the column-visibility UI (`hiddenColumns` +
22
+ * `onHiddenColumnsChange`) but deliberately holds no state, so PERSISTING the
23
+ * choice is left to the host. Every listing screen therefore reached for raw
24
+ * `localStorage` — observed in onssa-export-fe as
25
+ * `"onssaCertificates:listing:hiddenColumns"`, hand-written JSON.parse
26
+ * included.
27
+ *
28
+ * That is not merely duplication. A bare `localStorage` key is NOT USER-SCOPED,
29
+ * while this foundation's own key scheme is:
30
+ *
31
+ * portnet-ui:perso:v1:{tenantId?}:{userId}:{capabilityId}
32
+ *
33
+ * So on a shared workstation — the norm at a port — user B inherited user A's
34
+ * hidden columns, and a column A had hidden stayed invisible to B with no
35
+ * affordance explaining why. Favorites and saved filters were already immune
36
+ * because they route through this foundation; column visibility was the one
37
+ * grid preference that did not.
38
+ *
39
+ * It could not be fixed in a host, either. `registerCapability` is exported as
40
+ * a "capability registration seam — for custom/host-defined capabilities", but
41
+ * the two primitives every capability hook needs — `usePersonalizationStore`
42
+ * and `useStoreSelector` — are deliberately private ("architecture doc §2.8 —
43
+ * minimum API surface"). A host could register a descriptor and then had no way
44
+ * to read or write its payload. The seam was advertised but not complete, so
45
+ * the slice has to live here, exactly like favorites and savedFilters.
46
+ *
47
+ * DENSITY IS DELIBERATELY NOT PART OF THIS. `useDensity` (v2/hooks) owns the
48
+ * density preference as a GLOBAL, non-resource-scoped value on its own
49
+ * `portnet-ui-density` key, and it applies `data-density` to <html>. Folding it
50
+ * in here would give one preference two owners. Note however that it is
51
+ * unscoped for the same reason this capability exists — tracked separately,
52
+ * since moving it into the foundation changes its storage key and would make it
53
+ * require a provider (a breaking change for current callers).
54
+ * ─────────────────────────────────────────────────────────────────────────────
55
+ *
56
+ * Usage:
57
+ *
58
+ * const { hiddenColumns, setHiddenColumns } = useGridPreferences("ti:list");
59
+ *
60
+ * <DataGridToolbar
61
+ * columns={columns}
62
+ * hiddenColumns={hiddenColumns}
63
+ * onHiddenColumnsChange={setHiddenColumns}
64
+ * … />
65
+ * <DataGrid columns={columns} hiddenColumns={hiddenColumns} … />
66
+ *
67
+ * `resourceKey` namespaces preferences per list (e.g. "ti:list",
68
+ * "declarations:list") so two grids in one app never collide. Requires a
69
+ * <UserPersonalizationProvider> ancestor.
70
+ *
71
+ * Performance: the pure helpers rebuild only the touched resourceKey's entry
72
+ * and shallow-copy the map, so the store's structural sharing keeps every OTHER
73
+ * resource's preferences referentially stable — and the exposed `Set` is
74
+ * memoised on the stored array, so its identity survives re-renders and does
75
+ * not defeat DataGrid's memoisation.
76
+ */
77
+
78
+ import * as React from "react";
79
+ import { registerCapability } from "../schema";
80
+ import { usePersonalizationStore, useStoreSelector } from "../personalizationContext";
81
+
82
+ /** One resource's grid preferences. Optional members so the shape can grow
83
+ * (column order, widths) without a schemaVersion bump. */
84
+
85
+ /** The gridPreferences capability payload: entries keyed by resourceKey. */
86
+
87
+ export var GRID_PREFERENCES_CAPABILITY_ID = "gridPreferences";
88
+ var SCHEMA_VERSION = 1;
89
+ var EMPTY_LIST = Object.freeze([]);
90
+ var EMPTY_MAP = Object.freeze({});
91
+ function isString(value) {
92
+ return typeof value === "string";
93
+ }
94
+
95
+ /* Register at import time — the foundation reads this at hydration. */
96
+ registerCapability({
97
+ id: GRID_PREFERENCES_CAPABILITY_ID,
98
+ schemaVersion: SCHEMA_VERSION,
99
+ defaultState: EMPTY_MAP,
100
+ // { [resourceKey]: { hiddenColumns: string[] } }
101
+ migrate: function migrateGridPreferences(_fromVersion, payload) {
102
+ /* v1 is the initial schema, so there is no version to upgrade FROM — but
103
+ * this is the load-time trust boundary for a payload that came back from
104
+ * storage, and it is the right place to normalise it. A column key is used
105
+ * to hide grid columns; a number or an object arriving from an older build
106
+ * (or from hand-edited devtools storage) must not reach the DataGrid as if
107
+ * it were one. Anything unrecognised is dropped rather than repaired. */
108
+ if (!payload || _typeof(payload) !== "object") return {};
109
+ var source = payload;
110
+ var next = {};
111
+ for (var _i = 0, _Object$keys = Object.keys(source); _i < _Object$keys.length; _i++) {
112
+ var resourceKey = _Object$keys[_i];
113
+ var entry = source[resourceKey];
114
+ if (!entry || _typeof(entry) !== "object") continue;
115
+ var raw = entry["hiddenColumns"];
116
+ if (!Array.isArray(raw)) continue;
117
+ var keys = raw.filter(isString);
118
+ if (keys.length > 0) next[resourceKey] = {
119
+ hiddenColumns: keys
120
+ };
121
+ }
122
+ return next;
123
+ }
124
+ });
125
+
126
+ /* ── pure, resourceKey-scoped state helpers (structural sharing) ────── */
127
+
128
+ function listFor(map, resourceKey) {
129
+ var entry = map ? map[resourceKey] : undefined;
130
+ var list = entry ? entry.hiddenColumns : undefined;
131
+ return Array.isArray(list) ? list : EMPTY_LIST;
132
+ }
133
+ function sameMembers(a, b) {
134
+ if (a.length !== b.length) return false;
135
+ for (var i = 0; i < a.length; i++) {
136
+ if (a[i] !== b[i]) return false;
137
+ }
138
+ return true;
139
+ }
140
+ function setList(map, resourceKey, keys) {
141
+ var base = map || EMPTY_MAP;
142
+ // No-op when unchanged → the store short-circuits and nothing re-renders.
143
+ if (sameMembers(listFor(base, resourceKey), keys)) return base;
144
+ var next = Object.assign({}, base);
145
+ if (keys.length === 0) {
146
+ // Nothing hidden is the default; drop the entry rather than persist an
147
+ // empty array, so the payload stays tidy and a reset leaves no residue.
148
+ delete next[resourceKey];
149
+ } else {
150
+ // Spread, not Object.assign: `base[resourceKey]` is
151
+ // `GridPreferencesEntry | undefined` under noUncheckedIndexedAccess, and
152
+ // passing undefined as an Object.assign source yields an intersection
153
+ // containing undefined. Spreading undefined is well-defined ({}), and it
154
+ // preserves any sibling preference a future schema adds alongside
155
+ // hiddenColumns.
156
+ next[resourceKey] = _objectSpread(_objectSpread({}, base[resourceKey]), {}, {
157
+ hiddenColumns: keys.slice()
158
+ });
159
+ }
160
+ return next;
161
+ }
162
+
163
+ /* ── hook ───────────────────────────────────────────────────────────── */
164
+
165
+ function useEnsureGridPreferences(store) {
166
+ React.useEffect(function ensure() {
167
+ store.ensureCapability(GRID_PREFERENCES_CAPABILITY_ID);
168
+ }, [store]);
169
+ }
170
+ /**
171
+ * useGridPreferences(resourceKey) — persisted, per-user grid preferences for
172
+ * one resource.
173
+ */
174
+ export function useGridPreferences(resourceKey) {
175
+ var store = usePersonalizationStore();
176
+ useEnsureGridPreferences(store);
177
+ var selectList = React.useCallback(function selectList(snapshot) {
178
+ var slice = snapshot[GRID_PREFERENCES_CAPABILITY_ID];
179
+ return slice ? listFor(slice, resourceKey) : EMPTY_LIST;
180
+ }, [resourceKey]);
181
+ var keys = useStoreSelector(selectList);
182
+
183
+ // Stable while `keys` is stable (structural sharing), so the Set identity
184
+ // does not churn on every render and DataGrid's memoisation still holds.
185
+ var hiddenColumns = React.useMemo(function buildSet() {
186
+ return new Set(keys);
187
+ }, [keys]);
188
+ var setHiddenColumns = React.useCallback(function setHiddenColumns(hidden) {
189
+ // Normalise at the write boundary too: the caller is UI code, but the
190
+ // value is about to be persisted and re-read by a later session.
191
+ var nextKeys = Array.from(hidden).filter(isString);
192
+ store.write(GRID_PREFERENCES_CAPABILITY_ID, function (prev) {
193
+ return setList(prev, resourceKey, nextKeys);
194
+ });
195
+ }, [store, resourceKey]);
196
+ var resetHiddenColumns = React.useCallback(function resetHiddenColumns() {
197
+ store.write(GRID_PREFERENCES_CAPABILITY_ID, function (prev) {
198
+ return setList(prev, resourceKey, EMPTY_LIST);
199
+ });
200
+ }, [store, resourceKey]);
201
+ return React.useMemo(function value() {
202
+ return {
203
+ hiddenColumns: hiddenColumns,
204
+ setHiddenColumns: setHiddenColumns,
205
+ resetHiddenColumns: resetHiddenColumns
206
+ };
207
+ }, [hiddenColumns, setHiddenColumns, resetHiddenColumns]);
208
+ }
209
+ //# sourceMappingURL=gridPreferences.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gridPreferences.js","names":["React","registerCapability","usePersonalizationStore","useStoreSelector","GRID_PREFERENCES_CAPABILITY_ID","SCHEMA_VERSION","EMPTY_LIST","Object","freeze","EMPTY_MAP","isString","value","id","schemaVersion","defaultState","migrate","migrateGridPreferences","_fromVersion","payload","_typeof","source","next","_i","_Object$keys","keys","length","resourceKey","entry","raw","Array","isArray","filter","hiddenColumns","listFor","map","undefined","list","sameMembers","a","b","i","setList","base","assign","_objectSpread","slice","useEnsureGridPreferences","store","useEffect","ensure","ensureCapability","useGridPreferences","selectList","useCallback","snapshot","useMemo","buildSet","Set","setHiddenColumns","hidden","nextKeys","from","write","prev","resetHiddenColumns"],"sources":["../../../../../src/lib/v2/personalization/capabilities/gridPreferences.ts"],"sourcesContent":["/**\r\n * gridPreferences — Portnet UI v2 · personalization capability\r\n *\r\n * Per-user, per-resource DataGrid preferences. Self-registers the\r\n * \"gridPreferences\" capability with the schema registry at import time, so the\r\n * capability-agnostic foundation discovers its schemaVersion / defaultState /\r\n * migrate without any hardcoding.\r\n *\r\n * State model (the capability payload):\r\n * { [resourceKey]: { hiddenColumns: string[] } }\r\n *\r\n * ─────────────────────────────────────────────────────────────────────────────\r\n * WHY THIS BELONGS IN THE LIBRARY (capability gap G-35)\r\n *\r\n * `DataGridToolbar` owns the column-visibility UI (`hiddenColumns` +\r\n * `onHiddenColumnsChange`) but deliberately holds no state, so PERSISTING the\r\n * choice is left to the host. Every listing screen therefore reached for raw\r\n * `localStorage` — observed in onssa-export-fe as\r\n * `\"onssaCertificates:listing:hiddenColumns\"`, hand-written JSON.parse\r\n * included.\r\n *\r\n * That is not merely duplication. A bare `localStorage` key is NOT USER-SCOPED,\r\n * while this foundation's own key scheme is:\r\n *\r\n * portnet-ui:perso:v1:{tenantId?}:{userId}:{capabilityId}\r\n *\r\n * So on a shared workstation — the norm at a port — user B inherited user A's\r\n * hidden columns, and a column A had hidden stayed invisible to B with no\r\n * affordance explaining why. Favorites and saved filters were already immune\r\n * because they route through this foundation; column visibility was the one\r\n * grid preference that did not.\r\n *\r\n * It could not be fixed in a host, either. `registerCapability` is exported as\r\n * a \"capability registration seam — for custom/host-defined capabilities\", but\r\n * the two primitives every capability hook needs — `usePersonalizationStore`\r\n * and `useStoreSelector` — are deliberately private (\"architecture doc §2.8 —\r\n * minimum API surface\"). A host could register a descriptor and then had no way\r\n * to read or write its payload. The seam was advertised but not complete, so\r\n * the slice has to live here, exactly like favorites and savedFilters.\r\n *\r\n * DENSITY IS DELIBERATELY NOT PART OF THIS. `useDensity` (v2/hooks) owns the\r\n * density preference as a GLOBAL, non-resource-scoped value on its own\r\n * `portnet-ui-density` key, and it applies `data-density` to <html>. Folding it\r\n * in here would give one preference two owners. Note however that it is\r\n * unscoped for the same reason this capability exists — tracked separately,\r\n * since moving it into the foundation changes its storage key and would make it\r\n * require a provider (a breaking change for current callers).\r\n * ─────────────────────────────────────────────────────────────────────────────\r\n *\r\n * Usage:\r\n *\r\n * const { hiddenColumns, setHiddenColumns } = useGridPreferences(\"ti:list\");\r\n *\r\n * <DataGridToolbar\r\n * columns={columns}\r\n * hiddenColumns={hiddenColumns}\r\n * onHiddenColumnsChange={setHiddenColumns}\r\n * … />\r\n * <DataGrid columns={columns} hiddenColumns={hiddenColumns} … />\r\n *\r\n * `resourceKey` namespaces preferences per list (e.g. \"ti:list\",\r\n * \"declarations:list\") so two grids in one app never collide. Requires a\r\n * <UserPersonalizationProvider> ancestor.\r\n *\r\n * Performance: the pure helpers rebuild only the touched resourceKey's entry\r\n * and shallow-copy the map, so the store's structural sharing keeps every OTHER\r\n * resource's preferences referentially stable — and the exposed `Set` is\r\n * memoised on the stored array, so its identity survives re-renders and does\r\n * not defeat DataGrid's memoisation.\r\n */\r\n\r\nimport * as React from \"react\";\r\n\r\nimport { registerCapability } from \"../schema\";\r\nimport {\r\n usePersonalizationStore,\r\n useStoreSelector,\r\n} from \"../personalizationContext\";\r\nimport type {\r\n PersonalizationSnapshot,\r\n PersonalizationStore,\r\n} from \"../createPersonalizationStore\";\r\n\r\n/** One resource's grid preferences. Optional members so the shape can grow\r\n * (column order, widths) without a schemaVersion bump. */\r\nexport interface GridPreferencesEntry {\r\n hiddenColumns?: string[] | undefined;\r\n}\r\n\r\n/** The gridPreferences capability payload: entries keyed by resourceKey. */\r\ntype GridPreferencesState = Record<string, GridPreferencesEntry>;\r\n\r\nexport const GRID_PREFERENCES_CAPABILITY_ID = \"gridPreferences\";\r\nconst SCHEMA_VERSION = 1;\r\n\r\nconst EMPTY_LIST: readonly string[] = Object.freeze([]);\r\nconst EMPTY_MAP: GridPreferencesState = Object.freeze({});\r\n\r\nfunction isString(value: unknown): value is string {\r\n return typeof value === \"string\";\r\n}\r\n\r\n/* Register at import time — the foundation reads this at hydration. */\r\nregisterCapability({\r\n id: GRID_PREFERENCES_CAPABILITY_ID,\r\n schemaVersion: SCHEMA_VERSION,\r\n defaultState: EMPTY_MAP, // { [resourceKey]: { hiddenColumns: string[] } }\r\n migrate: function migrateGridPreferences(\r\n _fromVersion: number,\r\n payload: unknown\r\n ): unknown {\r\n /* v1 is the initial schema, so there is no version to upgrade FROM — but\r\n * this is the load-time trust boundary for a payload that came back from\r\n * storage, and it is the right place to normalise it. A column key is used\r\n * to hide grid columns; a number or an object arriving from an older build\r\n * (or from hand-edited devtools storage) must not reach the DataGrid as if\r\n * it were one. Anything unrecognised is dropped rather than repaired. */\r\n if (!payload || typeof payload !== \"object\") return {};\r\n const source = payload as Record<string, unknown>;\r\n const next: GridPreferencesState = {};\r\n for (const resourceKey of Object.keys(source)) {\r\n const entry = source[resourceKey];\r\n if (!entry || typeof entry !== \"object\") continue;\r\n const raw = (entry as Record<string, unknown>)[\"hiddenColumns\"];\r\n if (!Array.isArray(raw)) continue;\r\n const keys = raw.filter(isString);\r\n if (keys.length > 0) next[resourceKey] = { hiddenColumns: keys };\r\n }\r\n return next;\r\n },\r\n});\r\n\r\n/* ── pure, resourceKey-scoped state helpers (structural sharing) ────── */\r\n\r\nfunction listFor(\r\n map: GridPreferencesState | null | undefined,\r\n resourceKey: string\r\n): readonly string[] {\r\n const entry = map ? map[resourceKey] : undefined;\r\n const list = entry ? entry.hiddenColumns : undefined;\r\n return Array.isArray(list) ? list : EMPTY_LIST;\r\n}\r\n\r\nfunction sameMembers(a: readonly string[], b: readonly string[]): boolean {\r\n if (a.length !== b.length) return false;\r\n for (let i = 0; i < a.length; i++) {\r\n if (a[i] !== b[i]) return false;\r\n }\r\n return true;\r\n}\r\n\r\nfunction setList(\r\n map: GridPreferencesState | null | undefined,\r\n resourceKey: string,\r\n keys: readonly string[]\r\n): GridPreferencesState {\r\n const base = map || EMPTY_MAP;\r\n // No-op when unchanged → the store short-circuits and nothing re-renders.\r\n if (sameMembers(listFor(base, resourceKey), keys)) return base;\r\n\r\n const next: GridPreferencesState = Object.assign({}, base);\r\n if (keys.length === 0) {\r\n // Nothing hidden is the default; drop the entry rather than persist an\r\n // empty array, so the payload stays tidy and a reset leaves no residue.\r\n delete next[resourceKey];\r\n } else {\r\n // Spread, not Object.assign: `base[resourceKey]` is\r\n // `GridPreferencesEntry | undefined` under noUncheckedIndexedAccess, and\r\n // passing undefined as an Object.assign source yields an intersection\r\n // containing undefined. Spreading undefined is well-defined ({}), and it\r\n // preserves any sibling preference a future schema adds alongside\r\n // hiddenColumns.\r\n next[resourceKey] = {\r\n ...base[resourceKey],\r\n hiddenColumns: keys.slice(),\r\n };\r\n }\r\n return next;\r\n}\r\n\r\n/* ── hook ───────────────────────────────────────────────────────────── */\r\n\r\nfunction useEnsureGridPreferences(store: PersonalizationStore): void {\r\n React.useEffect(\r\n function ensure() {\r\n store.ensureCapability(GRID_PREFERENCES_CAPABILITY_ID);\r\n },\r\n [store]\r\n );\r\n}\r\n\r\nexport interface UseGridPreferencesResult {\r\n /**\r\n * Hidden column keys, ready to hand straight to DataGrid /\r\n * DataGridToolbar.\r\n *\r\n * A mutable `Set`, not a `ReadonlySet`, on purpose: both components declare\r\n * `hiddenColumns?: Set<string> | string[]`, and `ReadonlySet` is not\r\n * assignable to `Set` (no add/delete/clear), so a readonly type would force\r\n * every call site into a cast. This mirrors `useFavorites().ids`. Treat it\r\n * as read-only regardless — it is memoised and shared, so mutating it in\r\n * place would desynchronise the store without persisting anything.\r\n */\r\n hiddenColumns: Set<string>;\r\n /** Replace the hidden-column set. Accepts a Set or an array. */\r\n setHiddenColumns: (hidden: Iterable<string>) => void;\r\n /** Show every column again (drops this resource's entry). */\r\n resetHiddenColumns: () => void;\r\n}\r\n\r\n/**\r\n * useGridPreferences(resourceKey) — persisted, per-user grid preferences for\r\n * one resource.\r\n */\r\nexport function useGridPreferences(\r\n resourceKey: string\r\n): UseGridPreferencesResult {\r\n const store = usePersonalizationStore();\r\n useEnsureGridPreferences(store);\r\n\r\n const selectList = React.useCallback(\r\n function selectList(snapshot: PersonalizationSnapshot): readonly string[] {\r\n const slice = snapshot[GRID_PREFERENCES_CAPABILITY_ID] as\r\n | GridPreferencesState\r\n | undefined;\r\n return slice ? listFor(slice, resourceKey) : EMPTY_LIST;\r\n },\r\n [resourceKey]\r\n );\r\n const keys = useStoreSelector(selectList);\r\n\r\n // Stable while `keys` is stable (structural sharing), so the Set identity\r\n // does not churn on every render and DataGrid's memoisation still holds.\r\n const hiddenColumns = React.useMemo(\r\n function buildSet(): Set<string> {\r\n return new Set<string>(keys);\r\n },\r\n [keys]\r\n );\r\n\r\n const setHiddenColumns = React.useCallback(\r\n function setHiddenColumns(hidden: Iterable<string>): void {\r\n // Normalise at the write boundary too: the caller is UI code, but the\r\n // value is about to be persisted and re-read by a later session.\r\n const nextKeys = Array.from(hidden).filter(isString);\r\n store.write<GridPreferencesState>(\r\n GRID_PREFERENCES_CAPABILITY_ID,\r\n function (prev) {\r\n return setList(prev, resourceKey, nextKeys);\r\n }\r\n );\r\n },\r\n [store, resourceKey]\r\n );\r\n\r\n const resetHiddenColumns = React.useCallback(\r\n function resetHiddenColumns(): void {\r\n store.write<GridPreferencesState>(\r\n GRID_PREFERENCES_CAPABILITY_ID,\r\n function (prev) {\r\n return setList(prev, resourceKey, EMPTY_LIST);\r\n }\r\n );\r\n },\r\n [store, resourceKey]\r\n );\r\n\r\n return React.useMemo(\r\n function value(): UseGridPreferencesResult {\r\n return {\r\n hiddenColumns: hiddenColumns,\r\n setHiddenColumns: setHiddenColumns,\r\n resetHiddenColumns: resetHiddenColumns,\r\n };\r\n },\r\n [hiddenColumns, setHiddenColumns, resetHiddenColumns]\r\n );\r\n}\r\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAE9B,SAASC,kBAAkB,QAAQ,WAAW;AAC9C,SACEC,uBAAuB,EACvBC,gBAAgB,QACX,2BAA2B;;AAMlC;AACA;;AAKA;;AAGA,OAAO,IAAMC,8BAA8B,GAAG,iBAAiB;AAC/D,IAAMC,cAAc,GAAG,CAAC;AAExB,IAAMC,UAA6B,GAAGC,MAAM,CAACC,MAAM,CAAC,EAAE,CAAC;AACvD,IAAMC,SAA+B,GAAGF,MAAM,CAACC,MAAM,CAAC,CAAC,CAAC,CAAC;AAEzD,SAASE,QAAQA,CAACC,KAAc,EAAmB;EACjD,OAAO,OAAOA,KAAK,KAAK,QAAQ;AAClC;;AAEA;AACAV,kBAAkB,CAAC;EACjBW,EA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sB,IAAI,EAAErC,WAAW,EAAEpB,UAAU,CAAC;IAC/C,CACF,CAAC;EACH,CAAC,EACD,CAACyC,KAAK,EAAErB,WAAW,CACrB,CAAC;EAED,OAAO1B,KAAK,CAACuD,OAAO,CAClB,SAAS5C,KAAKA,CAAA,EAA6B;IACzC,OAAO;MACLqB,aAAa,EAAEA,aAAa;MAC5B0B,gBAAgB,EAAEA,gBAAgB;MAClCM,kBAAkB,EAAEA;IACtB,CAAC;EACH,CAAC,EACD,CAAChC,aAAa,EAAE0B,gBAAgB,EAAEM,kBAAkB,CACtD,CAAC;AACH","ignoreList":[]}
@@ -9,9 +9,14 @@
9
9
  * (Batch 5) — useFavoritesView + filter/sort helpers
10
10
  * - savedFilters (Batch 4) — useSavedFilters (+ SaveFilterDialog,
11
11
  * SavedFiltersMenu in patterns/)
12
+ * - gridPreferences — useGridPreferences (hidden columns; the
13
+ * DataGridToolbar column-visibility UI holds
14
+ * no state, so hosts were persisting it in
15
+ * unscoped localStorage — gap G-35)
12
16
  */
13
17
 
14
18
  export { useFavorites, useIsFavorite, FAVORITES_CAPABILITY_ID } from "./favorites";
15
19
  export { useSavedFilters, SAVED_FILTERS_CAPABILITY_ID } from "./savedFilters";
20
+ export { useGridPreferences, GRID_PREFERENCES_CAPABILITY_ID } from "./gridPreferences";
16
21
  export { useFavoritesView, filterRowsByFavorites, sortRowsByFavorites, FAVORITES_FILTER, FAVORITES_SORT } from "./favoritesView";
17
22
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["useFavorites","useIsFavorite","FAVORITES_CAPABILITY_ID","useSavedFilters","SAVED_FILTERS_CAPABILITY_ID","useFavoritesView","filterRowsByFavorites","sortRowsByFavorites","FAVORITES_FILTER","FAVORITES_SORT"],"sources":["../../../../../src/lib/v2/personalization/capabilities/index.ts"],"sourcesContent":["/**\r\n * capabilities — Portnet UI v2 · personalization\r\n *\r\n * Capability slices. Each slice self-registers with the schema registry\r\n * at import time, so importing a slice's hook is enough to activate its\r\n * capability — no manual wiring on the host.\r\n *\r\n * - favorites (Batch 3) — useFavorites, useIsFavorite\r\n * (Batch 5) — useFavoritesView + filter/sort helpers\r\n * - savedFilters (Batch 4) — useSavedFilters (+ SaveFilterDialog,\r\n * SavedFiltersMenu in patterns/)\r\n */\r\n\r\nexport {\r\n useFavorites,\r\n useIsFavorite,\r\n FAVORITES_CAPABILITY_ID,\r\n} from \"./favorites\";\r\nexport { useSavedFilters, SAVED_FILTERS_CAPABILITY_ID } from \"./savedFilters\";\r\nexport {\r\n useFavoritesView,\r\n filterRowsByFavorites,\r\n sortRowsByFavorites,\r\n FAVORITES_FILTER,\r\n FAVORITES_SORT,\r\n} from \"./favoritesView\";\r\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SACEA,YAAY,EACZC,aAAa,EACbC,uBAAuB,QAClB,aAAa;AACpB,SAASC,eAAe,EAAEC,2BAA2B,QAAQ,gBAAgB;AAC7E,SACEC,gBAAgB,EAChBC,qBAAqB,EACrBC,mBAAmB,EACnBC,gBAAgB,EAChBC,cAAc,QACT,iBAAiB","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["useFavorites","useIsFavorite","FAVORITES_CAPABILITY_ID","useSavedFilters","SAVED_FILTERS_CAPABILITY_ID","useGridPreferences","GRID_PREFERENCES_CAPABILITY_ID","useFavoritesView","filterRowsByFavorites","sortRowsByFavorites","FAVORITES_FILTER","FAVORITES_SORT"],"sources":["../../../../../src/lib/v2/personalization/capabilities/index.ts"],"sourcesContent":["/**\r\n * capabilities — Portnet UI v2 · personalization\r\n *\r\n * Capability slices. Each slice self-registers with the schema registry\r\n * at import time, so importing a slice's hook is enough to activate its\r\n * capability — no manual wiring on the host.\r\n *\r\n * - favorites (Batch 3) — useFavorites, useIsFavorite\r\n * (Batch 5) — useFavoritesView + filter/sort helpers\r\n * - savedFilters (Batch 4) — useSavedFilters (+ SaveFilterDialog,\r\n * SavedFiltersMenu in patterns/)\r\n * - gridPreferences — useGridPreferences (hidden columns; the\r\n * DataGridToolbar column-visibility UI holds\r\n * no state, so hosts were persisting it in\r\n * unscoped localStorage — gap G-35)\r\n */\r\n\r\nexport {\r\n useFavorites,\r\n useIsFavorite,\r\n FAVORITES_CAPABILITY_ID,\r\n} from \"./favorites\";\r\nexport { useSavedFilters, SAVED_FILTERS_CAPABILITY_ID } from \"./savedFilters\";\r\nexport {\r\n useGridPreferences,\r\n GRID_PREFERENCES_CAPABILITY_ID,\r\n} from \"./gridPreferences\";\r\nexport type {\r\n UseGridPreferencesResult,\r\n GridPreferencesEntry,\r\n} from \"./gridPreferences\";\r\nexport {\r\n useFavoritesView,\r\n filterRowsByFavorites,\r\n sortRowsByFavorites,\r\n FAVORITES_FILTER,\r\n FAVORITES_SORT,\r\n} from \"./favoritesView\";\r\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SACEA,YAAY,EACZC,aAAa,EACbC,uBAAuB,QAClB,aAAa;AACpB,SAASC,eAAe,EAAEC,2BAA2B,QAAQ,gBAAgB;AAC7E,SACEC,kBAAkB,EAClBC,8BAA8B,QACzB,mBAAmB;AAK1B,SACEC,gBAAgB,EAChBC,qBAAqB,EACrBC,mBAAmB,EACnBC,gBAAgB,EAChBC,cAAc,QACT,iBAAiB","ignoreList":[]}
@@ -43,4 +43,22 @@ export { default as FavoriteToggle } from "../components/FavoriteToggle";
43
43
 
44
44
  /* Saved filters capability (Batch 4). Composites in v2 patterns/. */
45
45
  export { useSavedFilters, SAVED_FILTERS_CAPABILITY_ID } from "./capabilities/savedFilters";
46
+
47
+ /**
48
+ * Grid preferences capability (gap G-35) — per-user, per-resource hidden
49
+ * columns.
50
+ *
51
+ * `DataGridToolbar` owns the column-visibility UI but holds no state, so every
52
+ * host persisted the choice itself in a bare `localStorage` key, which is NOT
53
+ * user-scoped — unlike this foundation's `…:{userId}:{capabilityId}` scheme.
54
+ * On a shared workstation one user inherited another's hidden columns.
55
+ *
56
+ * A host could not fix it: `registerCapability` is exported below as a seam
57
+ * "for custom/host-defined capabilities", but `usePersonalizationStore` and
58
+ * `useStoreSelector` are deliberately private (§2.8, minimum API surface), so
59
+ * a registered capability had no way to be read or written. The seam is
60
+ * advertised without being complete; until that is resolved, a new capability
61
+ * has to ship here.
62
+ */
63
+ export { useGridPreferences, GRID_PREFERENCES_CAPABILITY_ID } from "./capabilities/gridPreferences";
46
64
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["default","UserPersonalizationProvider","createLocalStorageAdapter","createMemoryAdapter","registerCapability","makeEnvelope","useFavorites","useIsFavorite","FAVORITES_CAPABILITY_ID","useFavoritesView","filterRowsByFavorites","sortRowsByFavorites","FAVORITES_FILTER","FAVORITES_SORT","FavoriteToggle","useSavedFilters","SAVED_FILTERS_CAPABILITY_ID"],"sources":["../../../../src/lib/v2/personalization/index.ts"],"sourcesContent":["/**\r\n * @portnet/ui · v2 · User Personalization Foundation\r\n * Public surface.\r\n *\r\n * Import via the dedicated subpath:\r\n * import {\r\n * UserPersonalizationProvider,\r\n * useFavorites,\r\n * useFavoritesView,\r\n * useSavedFilters,\r\n * FavoriteToggle,\r\n * } from \"@portnet/ui/v2/personalization\";\r\n *\r\n * Surface is intentionally minimal (architecture doc §2.8 — minimum API\r\n * surface). The store handle and the internal selector primitive are NOT\r\n * exported; hosts interact through the provider, the capability hooks,\r\n * and the capability components.\r\n *\r\n * The grid-bound composites — SaveFilterDialog / SavedFiltersMenu (saved\r\n * filters) and makeFavoriteColumn / FavoritesFilter (favorites) — are\r\n * exposed via @portnet/ui/v2 (patterns/), not re-exported here, so the\r\n * personalization barrel never imports from patterns/.\r\n */\r\n\r\n/* Provider — the single configuration point. */\r\nexport { default as UserPersonalizationProvider } from \"./PersonalizationProvider\";\r\n\r\n/* Built-in storage adapters (a remote adapter will join them, swap-in). */\r\nexport { default as createLocalStorageAdapter } from \"./adapters/createLocalStorageAdapter\";\r\nexport { default as createMemoryAdapter } from \"./adapters/createMemoryAdapter\";\r\n\r\n/* Capability registration seam — for custom/host-defined capabilities. */\r\nexport { registerCapability, makeEnvelope } from \"./schema\";\r\n\r\n/* Canonical domain types — the TS contract that replaced the runtime\r\n * PropTypes shapes (Scope / Adapter / FavoriteRef / SavedFilter). Type-only:\r\n * erased from the runtime bundle. */\r\nexport type { Scope, Adapter, FavoriteRef, SavedFilter } from \"./types\";\r\n\r\n/* Favorites capability (Batch 3) + view logic (Batch 5). */\r\nexport { useFavorites, useIsFavorite, FAVORITES_CAPABILITY_ID } from \"./capabilities/favorites\";\r\nexport {\r\n useFavoritesView,\r\n filterRowsByFavorites,\r\n sortRowsByFavorites,\r\n FAVORITES_FILTER,\r\n FAVORITES_SORT,\r\n} from \"./capabilities/favoritesView\";\r\nexport { default as FavoriteToggle } from \"../components/FavoriteToggle\";\r\n\r\n/* Saved filters capability (Batch 4). Composites in v2 patterns/. */\r\nexport { useSavedFilters, SAVED_FILTERS_CAPABILITY_ID } from \"./capabilities/savedFilters\";\r\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,SAASA,OAAO,IAAIC,2BAA2B,QAAQ,2BAA2B;;AAElF;AACA,SAASD,OAAO,IAAIE,yBAAyB,QAAQ,sCAAsC;AAC3F,SAASF,OAAO,IAAIG,mBAAmB,QAAQ,gCAAgC;;AAE/E;AACA,SAASC,kBAAkB,EAAEC,YAAY,QAAQ,UAAU;;AAE3D;AACA;AACA;;AAGA;AACA,SAASC,YAAY,EAAEC,aAAa,EAAEC,uBAAuB,QAAQ,0BAA0B;AAC/F,SACEC,gBAAgB,EAChBC,qBAAqB,EACrBC,mBAAmB,EACnBC,gBAAgB,EAChBC,cAAc,QACT,8BAA8B;AACrC,SAASb,OAAO,IAAIc,cAAc,QAAQ,8BAA8B;;AAExE;AACA,SAASC,eAAe,EAAEC,2BAA2B,QAAQ,6BAA6B","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["default","UserPersonalizationProvider","createLocalStorageAdapter","createMemoryAdapter","registerCapability","makeEnvelope","useFavorites","useIsFavorite","FAVORITES_CAPABILITY_ID","useFavoritesView","filterRowsByFavorites","sortRowsByFavorites","FAVORITES_FILTER","FAVORITES_SORT","FavoriteToggle","useSavedFilters","SAVED_FILTERS_CAPABILITY_ID","useGridPreferences","GRID_PREFERENCES_CAPABILITY_ID"],"sources":["../../../../src/lib/v2/personalization/index.ts"],"sourcesContent":["/**\r\n * @portnet/ui · v2 · User Personalization Foundation\r\n * Public surface.\r\n *\r\n * Import via the dedicated subpath:\r\n * import {\r\n * UserPersonalizationProvider,\r\n * useFavorites,\r\n * useFavoritesView,\r\n * useSavedFilters,\r\n * FavoriteToggle,\r\n * } from \"@portnet/ui/v2/personalization\";\r\n *\r\n * Surface is intentionally minimal (architecture doc §2.8 — minimum API\r\n * surface). The store handle and the internal selector primitive are NOT\r\n * exported; hosts interact through the provider, the capability hooks,\r\n * and the capability components.\r\n *\r\n * The grid-bound composites — SaveFilterDialog / SavedFiltersMenu (saved\r\n * filters) and makeFavoriteColumn / FavoritesFilter (favorites) — are\r\n * exposed via @portnet/ui/v2 (patterns/), not re-exported here, so the\r\n * personalization barrel never imports from patterns/.\r\n */\r\n\r\n/* Provider — the single configuration point. */\r\nexport { default as UserPersonalizationProvider } from \"./PersonalizationProvider\";\r\n\r\n/* Built-in storage adapters (a remote adapter will join them, swap-in). */\r\nexport { default as createLocalStorageAdapter } from \"./adapters/createLocalStorageAdapter\";\r\nexport { default as createMemoryAdapter } from \"./adapters/createMemoryAdapter\";\r\n\r\n/* Capability registration seam — for custom/host-defined capabilities. */\r\nexport { registerCapability, makeEnvelope } from \"./schema\";\r\n\r\n/* Canonical domain types — the TS contract that replaced the runtime\r\n * PropTypes shapes (Scope / Adapter / FavoriteRef / SavedFilter). Type-only:\r\n * erased from the runtime bundle. */\r\nexport type { Scope, Adapter, FavoriteRef, SavedFilter } from \"./types\";\r\n\r\n/* Favorites capability (Batch 3) + view logic (Batch 5). */\r\nexport { useFavorites, useIsFavorite, FAVORITES_CAPABILITY_ID } from \"./capabilities/favorites\";\r\nexport {\r\n useFavoritesView,\r\n filterRowsByFavorites,\r\n sortRowsByFavorites,\r\n FAVORITES_FILTER,\r\n FAVORITES_SORT,\r\n} from \"./capabilities/favoritesView\";\r\nexport { default as FavoriteToggle } from \"../components/FavoriteToggle\";\r\n\r\n/* Saved filters capability (Batch 4). Composites in v2 patterns/. */\r\nexport { useSavedFilters, SAVED_FILTERS_CAPABILITY_ID } from \"./capabilities/savedFilters\";\r\n\r\n/**\r\n * Grid preferences capability (gap G-35) — per-user, per-resource hidden\r\n * columns.\r\n *\r\n * `DataGridToolbar` owns the column-visibility UI but holds no state, so every\r\n * host persisted the choice itself in a bare `localStorage` key, which is NOT\r\n * user-scoped — unlike this foundation's `…:{userId}:{capabilityId}` scheme.\r\n * On a shared workstation one user inherited another's hidden columns.\r\n *\r\n * A host could not fix it: `registerCapability` is exported below as a seam\r\n * \"for custom/host-defined capabilities\", but `usePersonalizationStore` and\r\n * `useStoreSelector` are deliberately private (§2.8, minimum API surface), so\r\n * a registered capability had no way to be read or written. The seam is\r\n * advertised without being complete; until that is resolved, a new capability\r\n * has to ship here.\r\n */\r\nexport {\r\n useGridPreferences,\r\n GRID_PREFERENCES_CAPABILITY_ID,\r\n} from \"./capabilities/gridPreferences\";\r\nexport type {\r\n UseGridPreferencesResult,\r\n GridPreferencesEntry,\r\n} from \"./capabilities/gridPreferences\";\r\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,SAASA,OAAO,IAAIC,2BAA2B,QAAQ,2BAA2B;;AAElF;AACA,SAASD,OAAO,IAAIE,yBAAyB,QAAQ,sCAAsC;AAC3F,SAASF,OAAO,IAAIG,mBAAmB,QAAQ,gCAAgC;;AAE/E;AACA,SAASC,kBAAkB,EAAEC,YAAY,QAAQ,UAAU;;AAE3D;AACA;AACA;;AAGA;AACA,SAASC,YAAY,EAAEC,aAAa,EAAEC,uBAAuB,QAAQ,0BAA0B;AAC/F,SACEC,gBAAgB,EAChBC,qBAAqB,EACrBC,mBAAmB,EACnBC,gBAAgB,EAChBC,cAAc,QACT,8BAA8B;AACrC,SAASb,OAAO,IAAIc,cAAc,QAAQ,8BAA8B;;AAExE;AACA,SAASC,eAAe,EAAEC,2BAA2B,QAAQ,6BAA6B;;AAE1F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SACEC,kBAAkB,EAClBC,8BAA8B,QACzB,gCAAgC","ignoreList":[]}
package/dist/index.d.ts CHANGED
@@ -53,6 +53,8 @@ export { default as SkeletonPageShell } from "./v2/patterns/SkeletonPageShell";
53
53
  export type { SkeletonPageShellProps, SkeletonPageShellVariant, } from "./v2/patterns/SkeletonPageShell";
54
54
  export { MODAL_POPPER_PROPS, MODAL_ZINDEX } from "./v2/modalContext";
55
55
  export { UserPersonalizationProvider, createLocalStorageAdapter, createMemoryAdapter, registerCapability, useFavorites, useIsFavorite, useFavoritesView, filterRowsByFavorites, sortRowsByFavorites, FAVORITES_FILTER, FAVORITES_SORT, useSavedFilters, } from "./v2/personalization";
56
+ export { useGridPreferences, GRID_PREFERENCES_CAPABILITY_ID, } from "./v2/personalization";
57
+ export type { UseGridPreferencesResult, GridPreferencesEntry, } from "./v2/personalization";
56
58
  export { ReferentielProvider, ReferentielContext, useReferentielClient, useReferentielOptions, useReferentielSearch, } from "./v2/referentiel";
57
59
  export * from "./v2/models";
58
60
  export * from "./v2/types";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":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