@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
@@ -13,6 +13,29 @@ export { default as DataGrid, applySort } from "./DataGrid";
13
13
  export { default as DataGridVirtualized } from "./DataGridVirtualized";
14
14
  export { default as DataGridSettingsMenu } from "./DataGridSettingsMenu";
15
15
  export { default as DataGridToolbar } from "./DataGridToolbar";
16
+ /**
17
+ * DataGridToolbar contracts — public typed surface (gap G-I).
18
+ *
19
+ * Meme defaut que les blocs `StepStatus`, `FieldHelp`, `Status` et `Field` :
20
+ * la barre d'outils etait exportee comme VALEUR, sans les types de ses props.
21
+ * `DataGridToolbarFilterChip` est celui qui manque le plus : §Filters et
22
+ * §Search des Platform Mandatory UX Patterns imposent des criteres actifs
23
+ * retirables, `filterChips` est la capacite qui les rend, et un hote qui
24
+ * construit ce tableau a besoin de la forme d'une entree.
25
+ *
26
+ * Sans le type, il redeclare `{ key, label, onRemove }` au point d'appel — ce
27
+ * que les Platform TypeScript Guidelines interdisent (« Reusable types belong
28
+ * inside Shared UI Library … Never duplicate »). Releve depuis
29
+ * `refonte-frontend` (lot 8, ecart A9), ou dix listings doivent construire ces
30
+ * pastilles a partir d'une brique partagee.
31
+ *
32
+ * `DataGridToolbarLabels` voyage avec : un hote qui traduit la barre d'outils
33
+ * en a besoin, et c'est la meme duplication un niveau plus bas.
34
+ *
35
+ * FLAT-ONLY, per the policy note in src/lib/index.ts.
36
+ * Additive and type-only: no runtime change, no existing export altered.
37
+ */
38
+ export type { DataGridToolbarProps, DataGridToolbarFilterChip, DataGridToolbarLabels, } from "./DataGridToolbar";
16
39
  export { default as CollapsibleDataGrid } from "./CollapsibleDataGrid";
17
40
  export { default as SortableHeader, getAriaSort } from "./SortableHeader";
18
41
  export { default as NetworkErrorBanner } from "./NetworkErrorBanner";
@@ -46,6 +69,27 @@ export { default as SavedFiltersMenu } from "./SavedFiltersMenu";
46
69
  export { default as makeFavoriteColumn } from "./FavoriteColumn";
47
70
  export { default as FavoritesFilter } from "./FavoritesFilter";
48
71
  export type { FavoritesFilterProps, FavoritesFilterLabels } from "./FavoritesFilter";
72
+ /**
73
+ * RowFavoriteToggle — the per-row follow star, standalone (gap G-36).
74
+ *
75
+ * It already existed as a PRIVATE `FavoriteCell` inside `makeFavoriteColumn`,
76
+ * which made the follow control reachable as a DataGrid column and nowhere
77
+ * else. The other place a row always appears is the mobile card: `DataGrid`
78
+ * swaps to `renderMobileCard` below its `mobileBreakpoint`, and
79
+ * `MobileRowCard` has a `leading` slot for exactly this — but a column
80
+ * definition cannot be rendered into a slot, so hosts rebuilt the star by
81
+ * hand (`onssa-export-fe`'s `MobileFavoriteToggle`; `ms-ti-fe` destructures
82
+ * the same MobileRowCard + FavoriteToggle + useIsFavorite trio).
83
+ *
84
+ * Same failure mode as G-10: the library owned the behaviour but exposed it at
85
+ * one composition point only. And the copies drifted where it is least visible
86
+ * and matters most — the local twin announced "Ajouter aux favoris" while the
87
+ * grid column on the same page said "Suivre", and it dropped the status
88
+ * tooltip. `makeFavoriteColumn` now renders this component, so the two agree
89
+ * by construction.
90
+ */
91
+ export { default as RowFavoriteToggle, DEFAULT_ROW_FAVORITE_LABELS } from "./RowFavoriteToggle";
92
+ export type { RowFavoriteToggleProps, RowFavoriteToggleLabels, FavoriteToggleSize, } from "./RowFavoriteToggle";
49
93
  export { default as FormikInput } from "./FormikInput";
50
94
  export { default as FormikTextarea } from "./FormikTextarea";
51
95
  export { default as FormikSelect } from "./FormikSelect";
@@ -80,6 +124,49 @@ export type { FormikComboboxProps } from "./FormikCombobox";
80
124
  export { default as FormikDatePicker } from "./FormikDatePicker";
81
125
  export { default as FormikFile } from "./FormikFile";
82
126
  export { default as FormikCheckboxGroup } from "./FormikCheckboxGroup";
127
+ /**
128
+ * FormikCheckbox — pont pour une case a cocher BOOLEENNE simple (gap G-A).
129
+ *
130
+ * `FormikCheckboxGroup` porte un TABLEAU de valeurs selectionnees : un hote
131
+ * dont l'etat est un booleen (`autreInfo.fabrication`,
132
+ * `objectDeclaration.premiereDeclaration`) ne peut pas l'adopter sans changer
133
+ * ce que son payload envoie. Faute de pont, les modules recablaient
134
+ * `Checkbox` + `useField` a la main — duplication interdite par R-2.1, et qui
135
+ * perdait systematiquement le rendu de l'erreur (R-4.1 MUST).
136
+ *
137
+ * Le type de props est expose : meme classe que Gap-TS-003 ci-dessus.
138
+ */
139
+ export { default as FormikCheckbox } from "./FormikCheckbox";
140
+ export type { FormikCheckboxProps } from "./FormikCheckbox";
141
+ /**
142
+ * FormikRadioGroup — pont pour un groupe de radios (gap G-C).
143
+ *
144
+ * R-Sel.2 est un MUST : 2-3 options -> Radio ou Segmented, jamais un Select.
145
+ * Toute question metier binaire passe donc par `RadioGroup`, qui n'avait aucun
146
+ * pont Formik la ou `FormikSelect`, `FormikCombobox`, `FormikCheckboxGroup` et
147
+ * les autres en ont un. Les hotes recablaient `useField` + `RadioGroup` a la
148
+ * main, et y perdaient `FieldError`.
149
+ *
150
+ * Contrat invisible a connaitre : la valeur ECRITE est celle DECLAREE dans
151
+ * `options`, pas la chaine que rapporte le DOM — un hote aux options
152
+ * numeriques continue de stocker des nombres.
153
+ */
154
+ export { default as FormikRadioGroup } from "./FormikRadioGroup";
155
+ export type { FormikRadioGroupProps } from "./FormikRadioGroup";
156
+ /**
157
+ * FormikDateTimePicker — pont date + HEURE (gap G-E).
158
+ *
159
+ * `FormikDatePicker` etait le seul pont de date de la library, et il est
160
+ * date-seule. Un hote ayant besoin de l'heure devait soit la perdre — ce qui
161
+ * change ce que recoit le backend, pas seulement l'affichage — soit recabler
162
+ * `useField` + le `DateTimePicker` nu, donc dupliquer.
163
+ *
164
+ * Les deux ponts PARTAGENT `coerceToDate` / `serialiseDate`
165
+ * (`./_pickerSerialisation`) : voir la note S-03 de `FormikDatePicker` pour ce
166
+ * qui arrive quand la lecture et l'ecriture d'une date divergent.
167
+ */
168
+ export { default as FormikDateTimePicker } from "./FormikDateTimePicker";
169
+ export type { FormikDateTimePickerProps } from "./FormikDateTimePicker";
83
170
  export { default as FormikReferentielField } from "./FormikReferentielField";
84
171
  export type { FormikReferentielFieldProps } from "./FormikReferentielField";
85
172
  /** Affichage valeur système — fond grisé, aucune interaction.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/v2/patterns/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAiB,aAAa,CAAC;AAC9D,YAAY,EAAE,cAAc,EAAE,eAAe,EAAE,eAAe,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAChH,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAa,iBAAiB,CAAC;AAClE,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAa,iBAAiB,CAAC;AAClE,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAe,eAAe,CAAC;AAChE,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAa,iBAAiB,CAAC;AAClE,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAU,oBAAoB,CAAC;AACrE,YAAY,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAGvF,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAU,oBAAoB,CAAC;AACrE,YAAY,EAAE,qBAAqB,EAAE,MAAW,oBAAoB,CAAC;AACrE,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAe,eAAe,CAAC;AAChE,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,SAAS,EAAE,MAAO,YAAY,CAAC;AAC7D,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAO,uBAAuB,CAAC;AACxE,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AACzE,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAW,mBAAmB,CAA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EAAE,MAAM,0BAA0B,CAAC;AAC7E,YAAY,EAAE,2BAA2B,EAAE,MAAM,0BAA0B,CAAC;AAE5E;;yDAEyD;AACzD,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAa,6BAA6B,CAAC"}
@@ -28,6 +28,12 @@ Object.defineProperty(exports, "ColumnsToggle", {
28
28
  return _ColumnsToggle["default"];
29
29
  }
30
30
  });
31
+ Object.defineProperty(exports, "DEFAULT_ROW_FAVORITE_LABELS", {
32
+ enumerable: true,
33
+ get: function get() {
34
+ return _RowFavoriteToggle.DEFAULT_ROW_FAVORITE_LABELS;
35
+ }
36
+ });
31
37
  Object.defineProperty(exports, "DataGrid", {
32
38
  enumerable: true,
33
39
  get: function get() {
@@ -82,6 +88,12 @@ Object.defineProperty(exports, "FormSection", {
82
88
  return _FormSection["default"];
83
89
  }
84
90
  });
91
+ Object.defineProperty(exports, "FormikCheckbox", {
92
+ enumerable: true,
93
+ get: function get() {
94
+ return _FormikCheckbox["default"];
95
+ }
96
+ });
85
97
  Object.defineProperty(exports, "FormikCheckboxGroup", {
86
98
  enumerable: true,
87
99
  get: function get() {
@@ -100,6 +112,12 @@ Object.defineProperty(exports, "FormikDatePicker", {
100
112
  return _FormikDatePicker["default"];
101
113
  }
102
114
  });
115
+ Object.defineProperty(exports, "FormikDateTimePicker", {
116
+ enumerable: true,
117
+ get: function get() {
118
+ return _FormikDateTimePicker["default"];
119
+ }
120
+ });
103
121
  Object.defineProperty(exports, "FormikDisplay", {
104
122
  enumerable: true,
105
123
  get: function get() {
@@ -124,6 +142,12 @@ Object.defineProperty(exports, "FormikInput", {
124
142
  return _FormikInput["default"];
125
143
  }
126
144
  });
145
+ Object.defineProperty(exports, "FormikRadioGroup", {
146
+ enumerable: true,
147
+ get: function get() {
148
+ return _FormikRadioGroup["default"];
149
+ }
150
+ });
127
151
  Object.defineProperty(exports, "FormikReferentielField", {
128
152
  enumerable: true,
129
153
  get: function get() {
@@ -166,6 +190,12 @@ Object.defineProperty(exports, "ReferentielField", {
166
190
  return _ReferentielField["default"];
167
191
  }
168
192
  });
193
+ Object.defineProperty(exports, "RowFavoriteToggle", {
194
+ enumerable: true,
195
+ get: function get() {
196
+ return _RowFavoriteToggle["default"];
197
+ }
198
+ });
169
199
  Object.defineProperty(exports, "SaveFilterDialog", {
170
200
  enumerable: true,
171
201
  get: function get() {
@@ -231,6 +261,7 @@ var _SaveFilterDialog = _interopRequireDefault(require("./SaveFilterDialog"));
231
261
  var _SavedFiltersMenu = _interopRequireDefault(require("./SavedFiltersMenu"));
232
262
  var _FavoriteColumn = _interopRequireDefault(require("./FavoriteColumn"));
233
263
  var _FavoritesFilter = _interopRequireDefault(require("./FavoritesFilter"));
264
+ var _RowFavoriteToggle = _interopRequireWildcard(require("./RowFavoriteToggle"));
234
265
  var _FormikInput = _interopRequireDefault(require("./FormikInput"));
235
266
  var _FormikTextarea = _interopRequireDefault(require("./FormikTextarea"));
236
267
  var _FormikSelect = _interopRequireDefault(require("./FormikSelect"));
@@ -238,6 +269,9 @@ var _FormikCombobox = _interopRequireDefault(require("./FormikCombobox"));
238
269
  var _FormikDatePicker = _interopRequireDefault(require("./FormikDatePicker"));
239
270
  var _FormikFile = _interopRequireDefault(require("./FormikFile"));
240
271
  var _FormikCheckboxGroup = _interopRequireDefault(require("./FormikCheckboxGroup"));
272
+ var _FormikCheckbox = _interopRequireDefault(require("./FormikCheckbox"));
273
+ var _FormikRadioGroup = _interopRequireDefault(require("./FormikRadioGroup"));
274
+ var _FormikDateTimePicker = _interopRequireDefault(require("./FormikDateTimePicker"));
241
275
  var _FormikReferentielField = _interopRequireDefault(require("./FormikReferentielField"));
242
276
  var _FormikDisplay = _interopRequireDefault(require("../components/FormikDisplay"));
243
277
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["_ActionBar","_interopRequireDefault","require","_BulkActionBar","_ColumnsToggle","_FormSection","_FormPageShell","_FormErrorSummary","_FormikErrorFocus","_PageContent","_DataGrid","_interopRequireWildcard","_DataGridVirtualized","_DataGridSettingsMenu","_DataGridToolbar","_CollapsibleDataGrid","_SortableHeader","_NetworkErrorBanner","_ReferentielField","_Tour","_KeyboardShortcutsHelp","_DeleteResourceConfirmDialog","_SaveFilterDialog","_SavedFiltersMenu","_FavoriteColumn","_FavoritesFilter","_FormikInput","_FormikTextarea","_FormikSelect","_FormikCombobox","_FormikDatePicker","_FormikFile","_FormikCheckboxGroup","_FormikReferentielField","_FormikDisplay","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","_typeof","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set"],"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,IAAAA,UAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,cAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,cAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,YAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,cAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,iBAAA,GAAAN,sBAAA,CAAAC,OAAA;AAIA,IAAAM,iBAAA,GAAAP,sBAAA,CAAAC,OAAA;AAEA,IAAAO,YAAA,GAAAR,sBAAA,CAAAC,OAAA;AACA,IAAAQ,SAAA,GAAAC,uBAAA,CAAAT,OAAA;AACA,IAAAU,oBAAA,GAAAX,sBAAA,CAAAC,OAAA;AACA,IAAAW,qBAAA,GAAAZ,sBAAA,CAAAC,OAAA;AACA,IAAAY,gBAAA,GAAAb,sBAAA,CAAAC,OAAA;AACA,IAAAa,oBAAA,GAAAd,sBAAA,CAAAC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,GAAA,QAAAA,GAAA,aAAAE,OAAA,CAAAF,GAAA,yBAAAA,GAAA,uCAAAA,GAAA,UAAAG,KAAA,GAAAR,wBAAA,CAAAC,WAAA,OAAAO,KAAA,IAAAA,KAAA,CAAAC,GAAA,CAAAJ,GAAA,YAAAG,KAAA,CAAAE,GAAA,CAAAL,GAAA,SAAAM,MAAA,WAAAC,qBAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,GAAA,IAAAX,GAAA,QAAAW,GAAA,kBAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAd,GAAA,EAAAW,GAAA,SAAAI,IAAA,GAAAR,qBAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAV,GAAA,EAAAW,GAAA,cAAAI,IAAA,KAAAA,IAAA,CAAAV,GAAA,IAAAU,IAAA,CAAAC,GAAA,KAAAR,MAAA,CAAAC,cAAA,CAAAH,MAAA,EAAAK,GAAA,EAAAI,IAAA,YAAAT,MAAA,CAAAK,GAAA,IAAAX,GAAA,CAAAW,GAAA,SAAAL,MAAA,cAAAN,GAAA,MAAAG,KAAA,IAAAA,KAAA,CAAAa,GAAA,CAAAhB,GAAA,EAAAM,MAAA,YAAAA,MAAA;AAAA,SAAA7C,uBAAAuC,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,gBAAAA,GAAA","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["_ActionBar","_interopRequireDefault","require","_BulkActionBar","_ColumnsToggle","_FormSection","_FormPageShell","_FormErrorSummary","_FormikErrorFocus","_PageContent","_DataGrid","_interopRequireWildcard","_DataGridVirtualized","_DataGridSettingsMenu","_DataGridToolbar","_CollapsibleDataGrid","_SortableHeader","_NetworkErrorBanner","_ReferentielField","_Tour","_KeyboardShortcutsHelp","_DeleteResourceConfirmDialog","_SaveFilterDialog","_SavedFiltersMenu","_FavoriteColumn","_FavoritesFilter","_RowFavoriteToggle","_FormikInput","_FormikTextarea","_FormikSelect","_FormikCombobox","_FormikDatePicker","_FormikFile","_FormikCheckboxGroup","_FormikCheckbox","_FormikRadioGroup","_FormikDateTimePicker","_FormikReferentielField","_FormikDisplay","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","_typeof","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set"],"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,IAAAA,UAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,cAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,cAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,YAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,cAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,iBAAA,GAAAN,sBAAA,CAAAC,OAAA;AAIA,IAAAM,iBAAA,GAAAP,sBAAA,CAAAC,OAAA;AAEA,IAAAO,YAAA,GAAAR,sBAAA,CAAAC,OAAA;AACA,IAAAQ,SAAA,GAAAC,uBAAA,CAAAT,OAAA;AACA,IAAAU,oBAAA,GAAAX,sBAAA,CAAAC,OAAA;AACA,IAAAW,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1,100 @@
1
+ /**
2
+ * gridPreferences — Portnet UI v2 · personalization capability
3
+ *
4
+ * Per-user, per-resource DataGrid preferences. Self-registers the
5
+ * "gridPreferences" capability with the schema registry at import time, so the
6
+ * capability-agnostic foundation discovers its schemaVersion / defaultState /
7
+ * migrate without any hardcoding.
8
+ *
9
+ * State model (the capability payload):
10
+ * { [resourceKey]: { hiddenColumns: string[] } }
11
+ *
12
+ * ─────────────────────────────────────────────────────────────────────────────
13
+ * WHY THIS BELONGS IN THE LIBRARY (capability gap G-35)
14
+ *
15
+ * `DataGridToolbar` owns the column-visibility UI (`hiddenColumns` +
16
+ * `onHiddenColumnsChange`) but deliberately holds no state, so PERSISTING the
17
+ * choice is left to the host. Every listing screen therefore reached for raw
18
+ * `localStorage` — observed in onssa-export-fe as
19
+ * `"onssaCertificates:listing:hiddenColumns"`, hand-written JSON.parse
20
+ * included.
21
+ *
22
+ * That is not merely duplication. A bare `localStorage` key is NOT USER-SCOPED,
23
+ * while this foundation's own key scheme is:
24
+ *
25
+ * portnet-ui:perso:v1:{tenantId?}:{userId}:{capabilityId}
26
+ *
27
+ * So on a shared workstation — the norm at a port — user B inherited user A's
28
+ * hidden columns, and a column A had hidden stayed invisible to B with no
29
+ * affordance explaining why. Favorites and saved filters were already immune
30
+ * because they route through this foundation; column visibility was the one
31
+ * grid preference that did not.
32
+ *
33
+ * It could not be fixed in a host, either. `registerCapability` is exported as
34
+ * a "capability registration seam — for custom/host-defined capabilities", but
35
+ * the two primitives every capability hook needs — `usePersonalizationStore`
36
+ * and `useStoreSelector` — are deliberately private ("architecture doc §2.8 —
37
+ * minimum API surface"). A host could register a descriptor and then had no way
38
+ * to read or write its payload. The seam was advertised but not complete, so
39
+ * the slice has to live here, exactly like favorites and savedFilters.
40
+ *
41
+ * DENSITY IS DELIBERATELY NOT PART OF THIS. `useDensity` (v2/hooks) owns the
42
+ * density preference as a GLOBAL, non-resource-scoped value on its own
43
+ * `portnet-ui-density` key, and it applies `data-density` to <html>. Folding it
44
+ * in here would give one preference two owners. Note however that it is
45
+ * unscoped for the same reason this capability exists — tracked separately,
46
+ * since moving it into the foundation changes its storage key and would make it
47
+ * require a provider (a breaking change for current callers).
48
+ * ─────────────────────────────────────────────────────────────────────────────
49
+ *
50
+ * Usage:
51
+ *
52
+ * const { hiddenColumns, setHiddenColumns } = useGridPreferences("ti:list");
53
+ *
54
+ * <DataGridToolbar
55
+ * columns={columns}
56
+ * hiddenColumns={hiddenColumns}
57
+ * onHiddenColumnsChange={setHiddenColumns}
58
+ * … />
59
+ * <DataGrid columns={columns} hiddenColumns={hiddenColumns} … />
60
+ *
61
+ * `resourceKey` namespaces preferences per list (e.g. "ti:list",
62
+ * "declarations:list") so two grids in one app never collide. Requires a
63
+ * <UserPersonalizationProvider> ancestor.
64
+ *
65
+ * Performance: the pure helpers rebuild only the touched resourceKey's entry
66
+ * and shallow-copy the map, so the store's structural sharing keeps every OTHER
67
+ * resource's preferences referentially stable — and the exposed `Set` is
68
+ * memoised on the stored array, so its identity survives re-renders and does
69
+ * not defeat DataGrid's memoisation.
70
+ */
71
+ /** One resource's grid preferences. Optional members so the shape can grow
72
+ * (column order, widths) without a schemaVersion bump. */
73
+ export interface GridPreferencesEntry {
74
+ hiddenColumns?: string[] | undefined;
75
+ }
76
+ export declare const GRID_PREFERENCES_CAPABILITY_ID = "gridPreferences";
77
+ export interface UseGridPreferencesResult {
78
+ /**
79
+ * Hidden column keys, ready to hand straight to DataGrid /
80
+ * DataGridToolbar.
81
+ *
82
+ * A mutable `Set`, not a `ReadonlySet`, on purpose: both components declare
83
+ * `hiddenColumns?: Set<string> | string[]`, and `ReadonlySet` is not
84
+ * assignable to `Set` (no add/delete/clear), so a readonly type would force
85
+ * every call site into a cast. This mirrors `useFavorites().ids`. Treat it
86
+ * as read-only regardless — it is memoised and shared, so mutating it in
87
+ * place would desynchronise the store without persisting anything.
88
+ */
89
+ hiddenColumns: Set<string>;
90
+ /** Replace the hidden-column set. Accepts a Set or an array. */
91
+ setHiddenColumns: (hidden: Iterable<string>) => void;
92
+ /** Show every column again (drops this resource's entry). */
93
+ resetHiddenColumns: () => void;
94
+ }
95
+ /**
96
+ * useGridPreferences(resourceKey) — persisted, per-user grid preferences for
97
+ * one resource.
98
+ */
99
+ export declare function useGridPreferences(resourceKey: string): UseGridPreferencesResult;
100
+ //# sourceMappingURL=gridPreferences.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gridPreferences.d.ts","sourceRoot":"","sources":["../../../../src/lib/v2/personalization/capabilities/gridPreferences.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqEG;AAcH;2DAC2D;AAC3D,MAAM,WAAW,oBAAoB;IACnC,aAAa,CAAC,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC;CACtC;AAKD,eAAO,MAAM,8BAA8B,oBAAoB,CAAC;AAmGhE,MAAM,WAAW,wBAAwB;IACvC;;;;;;;;;;OAUG;IACH,aAAa,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC3B,gEAAgE;IAChE,gBAAgB,EAAE,CAAC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,KAAK,IAAI,CAAC;IACrD,6DAA6D;IAC7D,kBAAkB,EAAE,MAAM,IAAI,CAAC;CAChC;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAChC,WAAW,EAAE,MAAM,GAClB,wBAAwB,CA6D1B"}
@@ -0,0 +1,215 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.GRID_PREFERENCES_CAPABILITY_ID = void 0;
7
+ exports.useGridPreferences = useGridPreferences;
8
+ var React = _interopRequireWildcard(require("react"));
9
+ var _schema = require("../schema");
10
+ var _personalizationContext = require("../personalizationContext");
11
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
12
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
13
+ 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; }
14
+ 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; }
15
+ 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; }
16
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
17
+ 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); }
18
+ 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); } /**
19
+ * gridPreferences — Portnet UI v2 · personalization capability
20
+ *
21
+ * Per-user, per-resource DataGrid preferences. Self-registers the
22
+ * "gridPreferences" capability with the schema registry at import time, so the
23
+ * capability-agnostic foundation discovers its schemaVersion / defaultState /
24
+ * migrate without any hardcoding.
25
+ *
26
+ * State model (the capability payload):
27
+ * { [resourceKey]: { hiddenColumns: string[] } }
28
+ *
29
+ * ─────────────────────────────────────────────────────────────────────────────
30
+ * WHY THIS BELONGS IN THE LIBRARY (capability gap G-35)
31
+ *
32
+ * `DataGridToolbar` owns the column-visibility UI (`hiddenColumns` +
33
+ * `onHiddenColumnsChange`) but deliberately holds no state, so PERSISTING the
34
+ * choice is left to the host. Every listing screen therefore reached for raw
35
+ * `localStorage` — observed in onssa-export-fe as
36
+ * `"onssaCertificates:listing:hiddenColumns"`, hand-written JSON.parse
37
+ * included.
38
+ *
39
+ * That is not merely duplication. A bare `localStorage` key is NOT USER-SCOPED,
40
+ * while this foundation's own key scheme is:
41
+ *
42
+ * portnet-ui:perso:v1:{tenantId?}:{userId}:{capabilityId}
43
+ *
44
+ * So on a shared workstation — the norm at a port — user B inherited user A's
45
+ * hidden columns, and a column A had hidden stayed invisible to B with no
46
+ * affordance explaining why. Favorites and saved filters were already immune
47
+ * because they route through this foundation; column visibility was the one
48
+ * grid preference that did not.
49
+ *
50
+ * It could not be fixed in a host, either. `registerCapability` is exported as
51
+ * a "capability registration seam — for custom/host-defined capabilities", but
52
+ * the two primitives every capability hook needs — `usePersonalizationStore`
53
+ * and `useStoreSelector` — are deliberately private ("architecture doc §2.8 —
54
+ * minimum API surface"). A host could register a descriptor and then had no way
55
+ * to read or write its payload. The seam was advertised but not complete, so
56
+ * the slice has to live here, exactly like favorites and savedFilters.
57
+ *
58
+ * DENSITY IS DELIBERATELY NOT PART OF THIS. `useDensity` (v2/hooks) owns the
59
+ * density preference as a GLOBAL, non-resource-scoped value on its own
60
+ * `portnet-ui-density` key, and it applies `data-density` to <html>. Folding it
61
+ * in here would give one preference two owners. Note however that it is
62
+ * unscoped for the same reason this capability exists — tracked separately,
63
+ * since moving it into the foundation changes its storage key and would make it
64
+ * require a provider (a breaking change for current callers).
65
+ * ─────────────────────────────────────────────────────────────────────────────
66
+ *
67
+ * Usage:
68
+ *
69
+ * const { hiddenColumns, setHiddenColumns } = useGridPreferences("ti:list");
70
+ *
71
+ * <DataGridToolbar
72
+ * columns={columns}
73
+ * hiddenColumns={hiddenColumns}
74
+ * onHiddenColumnsChange={setHiddenColumns}
75
+ * … />
76
+ * <DataGrid columns={columns} hiddenColumns={hiddenColumns} … />
77
+ *
78
+ * `resourceKey` namespaces preferences per list (e.g. "ti:list",
79
+ * "declarations:list") so two grids in one app never collide. Requires a
80
+ * <UserPersonalizationProvider> ancestor.
81
+ *
82
+ * Performance: the pure helpers rebuild only the touched resourceKey's entry
83
+ * and shallow-copy the map, so the store's structural sharing keeps every OTHER
84
+ * resource's preferences referentially stable — and the exposed `Set` is
85
+ * memoised on the stored array, so its identity survives re-renders and does
86
+ * not defeat DataGrid's memoisation.
87
+ */
88
+ /** One resource's grid preferences. Optional members so the shape can grow
89
+ * (column order, widths) without a schemaVersion bump. */
90
+
91
+ /** The gridPreferences capability payload: entries keyed by resourceKey. */
92
+
93
+ var GRID_PREFERENCES_CAPABILITY_ID = exports.GRID_PREFERENCES_CAPABILITY_ID = "gridPreferences";
94
+ var SCHEMA_VERSION = 1;
95
+ var EMPTY_LIST = Object.freeze([]);
96
+ var EMPTY_MAP = Object.freeze({});
97
+ function isString(value) {
98
+ return typeof value === "string";
99
+ }
100
+
101
+ /* Register at import time — the foundation reads this at hydration. */
102
+ (0, _schema.registerCapability)({
103
+ id: GRID_PREFERENCES_CAPABILITY_ID,
104
+ schemaVersion: SCHEMA_VERSION,
105
+ defaultState: EMPTY_MAP,
106
+ // { [resourceKey]: { hiddenColumns: string[] } }
107
+ migrate: function migrateGridPreferences(_fromVersion, payload) {
108
+ /* v1 is the initial schema, so there is no version to upgrade FROM — but
109
+ * this is the load-time trust boundary for a payload that came back from
110
+ * storage, and it is the right place to normalise it. A column key is used
111
+ * to hide grid columns; a number or an object arriving from an older build
112
+ * (or from hand-edited devtools storage) must not reach the DataGrid as if
113
+ * it were one. Anything unrecognised is dropped rather than repaired. */
114
+ if (!payload || _typeof(payload) !== "object") return {};
115
+ var source = payload;
116
+ var next = {};
117
+ for (var _i = 0, _Object$keys = Object.keys(source); _i < _Object$keys.length; _i++) {
118
+ var resourceKey = _Object$keys[_i];
119
+ var entry = source[resourceKey];
120
+ if (!entry || _typeof(entry) !== "object") continue;
121
+ var raw = entry["hiddenColumns"];
122
+ if (!Array.isArray(raw)) continue;
123
+ var keys = raw.filter(isString);
124
+ if (keys.length > 0) next[resourceKey] = {
125
+ hiddenColumns: keys
126
+ };
127
+ }
128
+ return next;
129
+ }
130
+ });
131
+
132
+ /* ── pure, resourceKey-scoped state helpers (structural sharing) ────── */
133
+
134
+ function listFor(map, resourceKey) {
135
+ var entry = map ? map[resourceKey] : undefined;
136
+ var list = entry ? entry.hiddenColumns : undefined;
137
+ return Array.isArray(list) ? list : EMPTY_LIST;
138
+ }
139
+ function sameMembers(a, b) {
140
+ if (a.length !== b.length) return false;
141
+ for (var i = 0; i < a.length; i++) {
142
+ if (a[i] !== b[i]) return false;
143
+ }
144
+ return true;
145
+ }
146
+ function setList(map, resourceKey, keys) {
147
+ var base = map || EMPTY_MAP;
148
+ // No-op when unchanged → the store short-circuits and nothing re-renders.
149
+ if (sameMembers(listFor(base, resourceKey), keys)) return base;
150
+ var next = Object.assign({}, base);
151
+ if (keys.length === 0) {
152
+ // Nothing hidden is the default; drop the entry rather than persist an
153
+ // empty array, so the payload stays tidy and a reset leaves no residue.
154
+ delete next[resourceKey];
155
+ } else {
156
+ // Spread, not Object.assign: `base[resourceKey]` is
157
+ // `GridPreferencesEntry | undefined` under noUncheckedIndexedAccess, and
158
+ // passing undefined as an Object.assign source yields an intersection
159
+ // containing undefined. Spreading undefined is well-defined ({}), and it
160
+ // preserves any sibling preference a future schema adds alongside
161
+ // hiddenColumns.
162
+ next[resourceKey] = _objectSpread(_objectSpread({}, base[resourceKey]), {}, {
163
+ hiddenColumns: keys.slice()
164
+ });
165
+ }
166
+ return next;
167
+ }
168
+
169
+ /* ── hook ───────────────────────────────────────────────────────────── */
170
+
171
+ function useEnsureGridPreferences(store) {
172
+ React.useEffect(function ensure() {
173
+ store.ensureCapability(GRID_PREFERENCES_CAPABILITY_ID);
174
+ }, [store]);
175
+ }
176
+ /**
177
+ * useGridPreferences(resourceKey) — persisted, per-user grid preferences for
178
+ * one resource.
179
+ */
180
+ function useGridPreferences(resourceKey) {
181
+ var store = (0, _personalizationContext.usePersonalizationStore)();
182
+ useEnsureGridPreferences(store);
183
+ var selectList = React.useCallback(function selectList(snapshot) {
184
+ var slice = snapshot[GRID_PREFERENCES_CAPABILITY_ID];
185
+ return slice ? listFor(slice, resourceKey) : EMPTY_LIST;
186
+ }, [resourceKey]);
187
+ var keys = (0, _personalizationContext.useStoreSelector)(selectList);
188
+
189
+ // Stable while `keys` is stable (structural sharing), so the Set identity
190
+ // does not churn on every render and DataGrid's memoisation still holds.
191
+ var hiddenColumns = React.useMemo(function buildSet() {
192
+ return new Set(keys);
193
+ }, [keys]);
194
+ var setHiddenColumns = React.useCallback(function setHiddenColumns(hidden) {
195
+ // Normalise at the write boundary too: the caller is UI code, but the
196
+ // value is about to be persisted and re-read by a later session.
197
+ var nextKeys = Array.from(hidden).filter(isString);
198
+ store.write(GRID_PREFERENCES_CAPABILITY_ID, function (prev) {
199
+ return setList(prev, resourceKey, nextKeys);
200
+ });
201
+ }, [store, resourceKey]);
202
+ var resetHiddenColumns = React.useCallback(function resetHiddenColumns() {
203
+ store.write(GRID_PREFERENCES_CAPABILITY_ID, function (prev) {
204
+ return setList(prev, resourceKey, EMPTY_LIST);
205
+ });
206
+ }, [store, resourceKey]);
207
+ return React.useMemo(function value() {
208
+ return {
209
+ hiddenColumns: hiddenColumns,
210
+ setHiddenColumns: setHiddenColumns,
211
+ resetHiddenColumns: resetHiddenColumns
212
+ };
213
+ }, [hiddenColumns, setHiddenColumns, resetHiddenColumns]);
214
+ }
215
+ //# sourceMappingURL=gridPreferences.js.map