@g9tm/lynxcontrols 1.4.7 → 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (227) hide show
  1. package/dist/.tsbuildinfo +1 -1
  2. package/dist/anchor/context.d.ts +15 -0
  3. package/dist/anchor/context.d.ts.map +1 -0
  4. package/dist/anchor/context.jsx +10 -0
  5. package/dist/anchor/context.jsx.map +1 -0
  6. package/dist/anchor/hooks.d.ts +72 -0
  7. package/dist/anchor/hooks.d.ts.map +1 -0
  8. package/dist/anchor/hooks.jsx +147 -0
  9. package/dist/anchor/hooks.jsx.map +1 -0
  10. package/dist/anchor/index.d.ts +6 -0
  11. package/dist/anchor/index.d.ts.map +1 -0
  12. package/dist/anchor/index.jsx +5 -0
  13. package/dist/anchor/measure.d.ts +22 -0
  14. package/dist/anchor/measure.d.ts.map +1 -0
  15. package/dist/anchor/measure.jsx +110 -0
  16. package/dist/anchor/measure.jsx.map +1 -0
  17. package/dist/anchor/registry.d.ts +108 -0
  18. package/dist/anchor/registry.d.ts.map +1 -0
  19. package/dist/anchor/registry.jsx +142 -0
  20. package/dist/anchor/registry.jsx.map +1 -0
  21. package/dist/anchor/scroll.d.ts +34 -0
  22. package/dist/anchor/scroll.d.ts.map +1 -0
  23. package/dist/anchor/scroll.jsx +255 -0
  24. package/dist/anchor/scroll.jsx.map +1 -0
  25. package/dist/base/control.d.ts +10 -3
  26. package/dist/base/control.d.ts.map +1 -1
  27. package/dist/base/control.jsx +17 -2
  28. package/dist/base/control.jsx.map +1 -1
  29. package/dist/base/index.d.ts +1 -1
  30. package/dist/base/index.d.ts.map +1 -1
  31. package/dist/base/index.jsx +1 -1
  32. package/dist/base/pressable.d.ts.map +1 -1
  33. package/dist/base/pressable.jsx +7 -1
  34. package/dist/base/pressable.jsx.map +1 -1
  35. package/dist/base/selection-item.d.ts +9 -1
  36. package/dist/base/selection-item.d.ts.map +1 -1
  37. package/dist/base/selection-item.jsx +10 -1
  38. package/dist/base/selection-item.jsx.map +1 -1
  39. package/dist/button/button.css +20 -0
  40. package/dist/button/button.css.map +1 -1
  41. package/dist/button/button.d.ts.map +1 -1
  42. package/dist/button/button.jsx +11 -1
  43. package/dist/button/button.jsx.map +1 -1
  44. package/dist/button/header-action-button.d.ts +5 -0
  45. package/dist/button/header-action-button.d.ts.map +1 -1
  46. package/dist/button/header-action-button.jsx +16 -2
  47. package/dist/button/header-action-button.jsx.map +1 -1
  48. package/dist/button/icon-button.d.ts.map +1 -1
  49. package/dist/button/icon-button.jsx +11 -1
  50. package/dist/button/icon-button.jsx.map +1 -1
  51. package/dist/button/nav-card.d.ts.map +1 -1
  52. package/dist/button/nav-card.jsx +10 -1
  53. package/dist/button/nav-card.jsx.map +1 -1
  54. package/dist/button/vertical-icon-text-button.d.ts.map +1 -1
  55. package/dist/button/vertical-icon-text-button.jsx +10 -1
  56. package/dist/button/vertical-icon-text-button.jsx.map +1 -1
  57. package/dist/button/visuals.d.ts.map +1 -1
  58. package/dist/button/visuals.jsx +1 -1
  59. package/dist/button/visuals.jsx.map +1 -1
  60. package/dist/expander/expander.d.ts.map +1 -1
  61. package/dist/expander/expander.jsx +14 -1
  62. package/dist/expander/expander.jsx.map +1 -1
  63. package/dist/fields/editor.d.ts.map +1 -1
  64. package/dist/fields/editor.jsx +18 -2
  65. package/dist/fields/editor.jsx.map +1 -1
  66. package/dist/fields/fields.css +21 -0
  67. package/dist/fields/fields.css.map +1 -1
  68. package/dist/fields/index.d.ts +1 -1
  69. package/dist/fields/index.d.ts.map +1 -1
  70. package/dist/fields/index.jsx +1 -1
  71. package/dist/fields/outlined-field.d.ts +33 -1
  72. package/dist/fields/outlined-field.d.ts.map +1 -1
  73. package/dist/fields/outlined-field.jsx +43 -5
  74. package/dist/fields/outlined-field.jsx.map +1 -1
  75. package/dist/fields/text-entry.d.ts.map +1 -1
  76. package/dist/fields/text-entry.jsx +18 -2
  77. package/dist/fields/text-entry.jsx.map +1 -1
  78. package/dist/guide/guide.css +453 -0
  79. package/dist/guide/guide.css.map +1 -0
  80. package/dist/guide/index.d.ts +5 -0
  81. package/dist/guide/index.d.ts.map +1 -0
  82. package/dist/guide/index.jsx +4 -0
  83. package/dist/guide/journey.d.ts +46 -0
  84. package/dist/guide/journey.d.ts.map +1 -0
  85. package/dist/guide/journey.jsx +464 -0
  86. package/dist/guide/journey.jsx.map +1 -0
  87. package/dist/guide/placement.d.ts +44 -0
  88. package/dist/guide/placement.d.ts.map +1 -0
  89. package/dist/guide/placement.jsx +119 -0
  90. package/dist/guide/placement.jsx.map +1 -0
  91. package/dist/guide/service.d.ts +85 -0
  92. package/dist/guide/service.d.ts.map +1 -0
  93. package/dist/guide/service.jsx +620 -0
  94. package/dist/guide/service.jsx.map +1 -0
  95. package/dist/guide/settings.d.ts +50 -0
  96. package/dist/guide/settings.d.ts.map +1 -0
  97. package/dist/guide/settings.jsx +60 -0
  98. package/dist/guide/settings.jsx.map +1 -0
  99. package/dist/host/host.d.ts +5 -1
  100. package/dist/host/host.d.ts.map +1 -1
  101. package/dist/host/host.jsx +12 -0
  102. package/dist/host/host.jsx.map +1 -1
  103. package/dist/host/layers.d.ts +3 -1
  104. package/dist/host/layers.d.ts.map +1 -1
  105. package/dist/host/layers.jsx +4 -2
  106. package/dist/host/layers.jsx.map +1 -1
  107. package/dist/host/registry.d.ts +3 -0
  108. package/dist/host/registry.d.ts.map +1 -1
  109. package/dist/host/registry.jsx.map +1 -1
  110. package/dist/index.d.ts +3 -0
  111. package/dist/index.d.ts.map +1 -1
  112. package/dist/pickers/combo-box.d.ts +8 -0
  113. package/dist/pickers/combo-box.d.ts.map +1 -1
  114. package/dist/pickers/combo-box.jsx +51 -9
  115. package/dist/pickers/combo-box.jsx.map +1 -1
  116. package/dist/pickers/date-time-picker.d.ts +2 -2
  117. package/dist/pickers/date-time-picker.d.ts.map +1 -1
  118. package/dist/pickers/date-time-picker.jsx +4 -3
  119. package/dist/pickers/date-time-picker.jsx.map +1 -1
  120. package/dist/pickers/date-time.d.ts +5 -2
  121. package/dist/pickers/date-time.d.ts.map +1 -1
  122. package/dist/pickers/date-time.jsx +1 -1
  123. package/dist/pickers/date-time.jsx.map +1 -1
  124. package/dist/pickers/picker-sheet.d.ts +6 -2
  125. package/dist/pickers/picker-sheet.d.ts.map +1 -1
  126. package/dist/pickers/picker-sheet.jsx +2 -3
  127. package/dist/pickers/picker-sheet.jsx.map +1 -1
  128. package/dist/pickers/picker.d.ts.map +1 -1
  129. package/dist/pickers/picker.jsx +3 -2
  130. package/dist/pickers/picker.jsx.map +1 -1
  131. package/dist/pickers/pickers.css +27 -0
  132. package/dist/pickers/pickers.css.map +1 -1
  133. package/dist/pickers/timespan-picker.d.ts.map +1 -1
  134. package/dist/pickers/timespan-picker.jsx +3 -2
  135. package/dist/pickers/timespan-picker.jsx.map +1 -1
  136. package/dist/pickers/trigger.d.ts +3 -1
  137. package/dist/pickers/trigger.d.ts.map +1 -1
  138. package/dist/pickers/trigger.jsx +6 -1
  139. package/dist/pickers/trigger.jsx.map +1 -1
  140. package/dist/provider/contexts.d.ts +3 -0
  141. package/dist/provider/contexts.d.ts.map +1 -1
  142. package/dist/provider/contexts.jsx.map +1 -1
  143. package/dist/provider/provider.d.ts.map +1 -1
  144. package/dist/provider/provider.jsx +24 -17
  145. package/dist/provider/provider.jsx.map +1 -1
  146. package/dist/provider/settings.d.ts +16 -0
  147. package/dist/provider/settings.d.ts.map +1 -1
  148. package/dist/provider/settings.jsx +7 -3
  149. package/dist/provider/settings.jsx.map +1 -1
  150. package/dist/provider/theme.css +4 -0
  151. package/dist/provider/theme.css.map +1 -1
  152. package/dist/range-slider/math.d.ts +14 -4
  153. package/dist/range-slider/math.d.ts.map +1 -1
  154. package/dist/range-slider/math.jsx +16 -4
  155. package/dist/range-slider/math.jsx.map +1 -1
  156. package/dist/range-slider/range-slider.css +17 -0
  157. package/dist/range-slider/range-slider.css.map +1 -1
  158. package/dist/range-slider/range-slider.d.ts +11 -0
  159. package/dist/range-slider/range-slider.d.ts.map +1 -1
  160. package/dist/range-slider/range-slider.jsx +35 -13
  161. package/dist/range-slider/range-slider.jsx.map +1 -1
  162. package/dist/route/hooks.d.ts +34 -0
  163. package/dist/route/hooks.d.ts.map +1 -0
  164. package/dist/route/hooks.jsx +147 -0
  165. package/dist/route/hooks.jsx.map +1 -0
  166. package/dist/route/index.d.ts +3 -0
  167. package/dist/route/index.d.ts.map +1 -0
  168. package/dist/route/index.jsx +2 -0
  169. package/dist/route/router.d.ts +201 -0
  170. package/dist/route/router.d.ts.map +1 -0
  171. package/dist/route/router.jsx +810 -0
  172. package/dist/route/router.jsx.map +1 -0
  173. package/dist/selection/index.d.ts +2 -1
  174. package/dist/selection/index.d.ts.map +1 -1
  175. package/dist/selection/index.jsx +2 -1
  176. package/dist/selection/selection-sheet.d.ts +3 -1
  177. package/dist/selection/selection-sheet.d.ts.map +1 -1
  178. package/dist/selection/selection-sheet.jsx +57 -8
  179. package/dist/selection/selection-sheet.jsx.map +1 -1
  180. package/dist/selection/selection.css +7 -0
  181. package/dist/selection/selection.css.map +1 -1
  182. package/dist/selection/window.d.ts +29 -0
  183. package/dist/selection/window.d.ts.map +1 -0
  184. package/dist/selection/window.jsx +24 -0
  185. package/dist/selection/window.jsx.map +1 -0
  186. package/dist/sheet/frame.d.ts +3 -1
  187. package/dist/sheet/frame.d.ts.map +1 -1
  188. package/dist/sheet/frame.jsx +72 -26
  189. package/dist/sheet/frame.jsx.map +1 -1
  190. package/dist/sheet/header.d.ts.map +1 -1
  191. package/dist/sheet/header.jsx +3 -1
  192. package/dist/sheet/header.jsx.map +1 -1
  193. package/dist/sheet/index.d.ts +1 -1
  194. package/dist/sheet/index.d.ts.map +1 -1
  195. package/dist/sheet/index.jsx +1 -1
  196. package/dist/sheet/options.d.ts +30 -0
  197. package/dist/sheet/options.d.ts.map +1 -1
  198. package/dist/sheet/options.jsx +2 -1
  199. package/dist/sheet/options.jsx.map +1 -1
  200. package/dist/sheet/service.d.ts +13 -0
  201. package/dist/sheet/service.d.ts.map +1 -1
  202. package/dist/sheet/service.jsx +27 -4
  203. package/dist/sheet/service.jsx.map +1 -1
  204. package/dist/sheet/sheet.css +9 -0
  205. package/dist/sheet/sheet.css.map +1 -1
  206. package/dist/sheet/sizing.d.ts +2 -0
  207. package/dist/sheet/sizing.d.ts.map +1 -1
  208. package/dist/sheet/sizing.jsx +2 -1
  209. package/dist/sheet/sizing.jsx.map +1 -1
  210. package/dist/tabs/tab-view.d.ts +14 -0
  211. package/dist/tabs/tab-view.d.ts.map +1 -1
  212. package/dist/tabs/tab-view.jsx +59 -3
  213. package/dist/tabs/tab-view.jsx.map +1 -1
  214. package/dist/toggle/checkbox.d.ts.map +1 -1
  215. package/dist/toggle/checkbox.jsx +15 -1
  216. package/dist/toggle/checkbox.jsx.map +1 -1
  217. package/dist/toggle/chip-group.d.ts +9 -1
  218. package/dist/toggle/chip-group.d.ts.map +1 -1
  219. package/dist/toggle/chip-group.jsx +63 -13
  220. package/dist/toggle/chip-group.jsx.map +1 -1
  221. package/dist/toggle/switch.d.ts +1 -1
  222. package/dist/toggle/switch.d.ts.map +1 -1
  223. package/dist/toggle/switch.jsx +18 -3
  224. package/dist/toggle/switch.jsx.map +1 -1
  225. package/dist/toggle/toggle.css +20 -0
  226. package/dist/toggle/toggle.css.map +1 -1
  227. package/package.json +17 -2
@@ -0,0 +1,29 @@
1
+ /**
2
+ * The selection sheet's row window (MAUI 1.4.8 `G9SelectionWindow`, LES-0056). A 3,416-person assignee list built a row
3
+ * per item and was killed as an ANR in the MAUI app; the Lynx sheet built a row per item too. The sheet now renders only
4
+ * the window this computes: the first `limit` matches in list order, plus every selected match beyond them (a chosen
5
+ * value must stay on screen to be un-chosen), and counts the matches it left out for the «N more» footer.
6
+ */
7
+ export interface G9SelectionWindow {
8
+ /** The item indices to render, in list order. */
9
+ readonly indices: ReadonlyArray<number>;
10
+ /** Matches left out of the window by the limit (selected ones are never left out). */
11
+ readonly hidden: number;
12
+ }
13
+ /** Rows rendered per page; the next page joins when the list is scrolled to its end (MAUI `RowPageSize`, 60). */
14
+ export declare const g9SelectionRowPageSize = 60;
15
+ /** The most matching rows one query renders, whatever the scrolling (MAUI `MaxRenderedRows`, 200). */
16
+ export declare const g9SelectionMaxRenderedRows = 200;
17
+ /** How close to the end of the list (px) the next page is asked for: four rows (MAUI `SelectionRowHeight * 4`). */
18
+ export declare const g9SelectionGrowThreshold: number;
19
+ /**
20
+ * The window of a query (MAUI `G9SelectionWindow.Compute`).
21
+ * @param count how many items the sheet holds
22
+ * @param matches whether item `i` matches the query
23
+ * @param isSelected whether item `i` is selected now
24
+ * @param limit how many matching rows the window may hold (selected ones beyond it do not count)
25
+ */
26
+ export declare function computeSelectionWindow(count: number, matches: (index: number) => boolean, isSelected: (index: number) => boolean, limit: number): G9SelectionWindow;
27
+ /** The next render limit after a scroll to the end: one more page, never past {@link g9SelectionMaxRenderedRows}. */
28
+ export declare function nextSelectionLimit(current: number, hidden: number): number;
29
+ //# sourceMappingURL=window.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"window.d.ts","sourceRoot":"","sources":["../../src/selection/window.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,WAAW,iBAAiB;IAChC,iDAAiD;IACjD,QAAQ,CAAC,OAAO,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IACxC,sFAAsF;IACtF,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED,iHAAiH;AACjH,eAAO,MAAM,sBAAsB,KAAK,CAAC;AACzC,sGAAsG;AACtG,eAAO,MAAM,0BAA0B,MAAM,CAAC;AAC9C,mHAAmH;AACnH,eAAO,MAAM,wBAAwB,QAAS,CAAC;AAE/C;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,EACnC,UAAU,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,EACtC,KAAK,EAAE,MAAM,GACZ,iBAAiB,CAgBnB;AAED,qHAAqH;AACrH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAG1E"}
@@ -0,0 +1,24 @@
1
+ const g9SelectionRowPageSize = 60;
2
+ const g9SelectionMaxRenderedRows = 200;
3
+ const g9SelectionGrowThreshold = 208;
4
+ function computeSelectionWindow(count, matches, isSelected, limit) {
5
+ const indices = [];
6
+ let hidden = 0;
7
+ let shown = 0;
8
+ for(let i = 0; i < count; i++)if (matches(i)) if (shown < limit) {
9
+ indices.push(i);
10
+ shown++;
11
+ } else if (isSelected(i)) indices.push(i);
12
+ else hidden++;
13
+ return {
14
+ indices,
15
+ hidden
16
+ };
17
+ }
18
+ function nextSelectionLimit(current, hidden) {
19
+ if (hidden <= 0) return current;
20
+ return Math.min(current + g9SelectionRowPageSize, g9SelectionMaxRenderedRows);
21
+ }
22
+ export { computeSelectionWindow, g9SelectionGrowThreshold, g9SelectionMaxRenderedRows, g9SelectionRowPageSize, nextSelectionLimit };
23
+
24
+ //# sourceMappingURL=window.jsx.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"selection/window.jsx","sources":["../../src/selection/window.ts"],"sourcesContent":["/**\n * The selection sheet's row window (MAUI 1.4.8 `G9SelectionWindow`, LES-0056). A 3,416-person assignee list built a row\n * per item and was killed as an ANR in the MAUI app; the Lynx sheet built a row per item too. The sheet now renders only\n * the window this computes: the first `limit` matches in list order, plus every selected match beyond them (a chosen\n * value must stay on screen to be un-chosen), and counts the matches it left out for the «N more» footer.\n */\nexport interface G9SelectionWindow {\n /** The item indices to render, in list order. */\n readonly indices: ReadonlyArray<number>;\n /** Matches left out of the window by the limit (selected ones are never left out). */\n readonly hidden: number;\n}\n\n/** Rows rendered per page; the next page joins when the list is scrolled to its end (MAUI `RowPageSize`, 60). */\nexport const g9SelectionRowPageSize = 60;\n/** The most matching rows one query renders, whatever the scrolling (MAUI `MaxRenderedRows`, 200). */\nexport const g9SelectionMaxRenderedRows = 200;\n/** How close to the end of the list (px) the next page is asked for: four rows (MAUI `SelectionRowHeight * 4`). */\nexport const g9SelectionGrowThreshold = 4 * 52;\n\n/**\n * The window of a query (MAUI `G9SelectionWindow.Compute`).\n * @param count how many items the sheet holds\n * @param matches whether item `i` matches the query\n * @param isSelected whether item `i` is selected now\n * @param limit how many matching rows the window may hold (selected ones beyond it do not count)\n */\nexport function computeSelectionWindow(\n count: number,\n matches: (index: number) => boolean,\n isSelected: (index: number) => boolean,\n limit: number,\n): G9SelectionWindow {\n const indices: number[] = [];\n let hidden = 0;\n let shown = 0;\n for (let i = 0; i < count; i++) {\n if (!matches(i)) continue;\n if (shown < limit) {\n indices.push(i);\n shown++;\n } else if (isSelected(i)) {\n indices.push(i);\n } else {\n hidden++;\n }\n }\n return { indices, hidden };\n}\n\n/** The next render limit after a scroll to the end: one more page, never past {@link g9SelectionMaxRenderedRows}. */\nexport function nextSelectionLimit(current: number, hidden: number): number {\n if (hidden <= 0) return current;\n return Math.min(current + g9SelectionRowPageSize, g9SelectionMaxRenderedRows);\n}\n"],"names":["g9SelectionRowPageSize","g9SelectionMaxRenderedRows","g9SelectionGrowThreshold","computeSelectionWindow","count","matches","isSelected","limit","indices","hidden","shown","i","nextSelectionLimit","current","Math"],"mappings":"AAcO,MAAMA,yBAAyB;AAE/B,MAAMC,6BAA6B;AAEnC,MAAMC,2BAA2B;AASjC,SAASC,uBACdC,KAAa,EACbC,OAAmC,EACnCC,UAAsC,EACtCC,KAAa;IAEb,MAAMC,UAAoB,EAAE;IAC5B,IAAIC,SAAS;IACb,IAAIC,QAAQ;IACZ,IAAK,IAAIC,IAAI,GAAGA,IAAIP,OAAOO,IACzB,IAAKN,QAAQM,IACb,IAAID,QAAQH,OAAO;QACjBC,QAAQ,IAAI,CAACG;QACbD;IACF,OAAO,IAAIJ,WAAWK,IACpBH,QAAQ,IAAI,CAACG;SAEbF;IAGJ,OAAO;QAAED;QAASC;IAAO;AAC3B;AAGO,SAASG,mBAAmBC,OAAe,EAAEJ,MAAc;IAChE,IAAIA,UAAU,GAAG,OAAOI;IACxB,OAAOC,KAAK,GAAG,CAACD,UAAUb,wBAAwBC;AACpD"}
@@ -2,7 +2,7 @@ import './sheet.css';
2
2
  import { type G9AbortSignal } from '@g9tm/lynxcontrols-foundation';
3
3
  import { type ReactNode } from '@lynx-js/react';
4
4
  import type { G9SheetHeightMemo } from './height-memo.js';
5
- import type { G9SheetSettings } from './options.js';
5
+ import type { G9SheetDetent, G9SheetSettings } from './options.js';
6
6
  import type { G9SheetEntry, G9SheetHandle, G9SheetStack } from './stack.js';
7
7
  /** What content inside a sheet can read (MAUI `IG9BottomSheetAwareView` + deferred load signals). */
8
8
  export interface G9SheetContextValue {
@@ -38,6 +38,8 @@ export interface G9SheetFrameProps {
38
38
  /** The sheet came to rest at a new height (px); drives the page recede threshold. */
39
39
  readonly onRest?: (heightPx: number) => void;
40
40
  }
41
+ /** The lynx-ui snap index of where a sheet rests: 0 for a fit sheet, else its detent's place (0 when it is unknown). */
42
+ export declare function restingSnapIndex(resting: G9SheetDetent | 'fit', fit: boolean, detents: readonly G9SheetDetent[]): number;
41
43
  /**
42
44
  * One sheet of the stack on lynx-ui `SheetRoot` (motion, drag, snap points from lynx-ui; G9 adds detent mapping,
43
45
  * scrim, header/footer, deferred content, recede and results). Rendered by the sheet service in the host's sheets
@@ -1 +1 @@
1
- {"version":3,"file":"frame.d.ts","sourceRoot":"","sources":["../../src/sheet/frame.tsx"],"names":[],"mappings":"AAAA,OAAO,aAAa,CAAC;AACrB,OAAO,EAIL,KAAK,aAAa,EAKnB,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EAAiB,KAAK,SAAS,EAA2C,MAAM,gBAAgB,CAAC;AASxG,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAEvD,OAAO,KAAK,EAAiB,eAAe,EAAE,MAAM,WAAW,CAAC;AAehE,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,CAAC,QAAQ,EAAE,QAAQ,CAAC,eAAe,CAAC,CAAC;IAC7C,QAAQ,CAAC,IAAI,EAAE,iBAAiB,GAAG,IAAI,CAAC;IACxC,mCAAmC;IACnC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,gEAAgE;IAChE,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB,qFAAqF;IACrF,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;CAC9C;AAoBD,wHAAwH;AACxH,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,aAAa,GAAG,KAAK,EAC9B,GAAG,EAAE,OAAO,EACZ,OAAO,EAAE,SAAS,aAAa,EAAE,GAChC,MAAM,CAGR;AAUD;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,GAAG,SAAS,CAoZhE"}
@@ -1,18 +1,20 @@
1
1
  import "./sheet.css";
2
2
  import { createAbortController, formatColor, g9Ms, resolveThemeColor, tryParseColor, withAlpha } from "@g9tm/lynxcontrols-foundation";
3
3
  import { SheetContent, SheetRoot, SheetView } from "@lynx-js/lynx-ui-sheet";
4
- import { createContext, useContext, useEffect, useRef, useState } from "@lynx-js/react";
4
+ import { createContext, useContext, useEffect, useMemo, useRef, useState } from "@lynx-js/react";
5
+ import { G9AnchorLayerContext } from "../anchor/context.jsx";
5
6
  import { g9IdProps } from "../base/control.jsx";
6
7
  import { startTimer, stopTimer } from "../base/timers.jsx";
7
8
  import { G9ActivityIndicator } from "../display/activity-indicator.jsx";
8
9
  import { G9SheetSkeleton } from "../display/shimmer.jsx";
9
10
  import { g9FieldNotchStyle } from "../fields/notch.jsx";
10
11
  import { useG9Theme } from "../provider/hooks.jsx";
12
+ import { sheetSegmentOf, useG9Place } from "../route/hooks.jsx";
11
13
  import { G9SheetGestureFrame, useSheetBodyGesture, useSheetGestureRefs } from "./gesture.jsx";
12
14
  import { G9SheetFooter, G9SheetHeader } from "./header.jsx";
13
15
  import { resolveSheetMotion } from "./motion.jsx";
14
16
  import { G9SheetScrollIndicator, G9SheetScrollModel } from "./scroll-indicator.jsx";
15
- import { clampFitHeight, currentPlatform, g9SheetDragCloseThreshold, g9SheetFitLoadingMinHeight, g9SheetFitMinHeight, parentRecedeOffset, platformSheetConstraints, resolveSheetLayout, sheetOverlayOpacity, sheetSurfaceBottomPadding, sheetSurfaceTopPadding } from "./sizing.jsx";
17
+ import { clampFitHeight, currentPlatform, g9SheetDragCloseThreshold, g9SheetFitLoadingMinHeight, g9SheetFitMinHeight, g9SheetScrollToEndThreshold, parentRecedeOffset, platformSheetConstraints, resolveSheetLayout, sheetOverlayOpacity, sheetSurfaceBottomPadding, sheetSurfaceTopPadding } from "./sizing.jsx";
16
18
  const SheetContext = createContext(null);
17
19
  function useG9SheetContext() {
18
20
  return useContext(SheetContext);
@@ -39,6 +41,10 @@ function orderedDetents(o) {
39
41
  'large'
40
42
  ].filter((d)=>requested.includes(d));
41
43
  }
44
+ function restingSnapIndex(resting, fit, detents) {
45
+ if (fit || 'fit' === resting) return 0;
46
+ return Math.max(0, detents.indexOf(resting));
47
+ }
42
48
  function initialDetent(o, fit) {
43
49
  var _o_currentState, _ordered_;
44
50
  if (fit) return 'fit';
@@ -47,13 +53,28 @@ function initialDetent(o, fit) {
47
53
  return ordered.includes(current) ? current : null != (_ordered_ = ordered[0]) ? _ordered_ : 'medium';
48
54
  }
49
55
  function G9SheetFrame(props) {
50
- var _ref, _o_deferredLoadingPlaceholderHeight, _o_loadingSkeletonRowCount, _ratios_layout_initialSnap, _props_bottomInset, _o_openAnimationDurationMs, _o_closeAnimationDurationMs, _o_cornerRadius, _o_backgroundColor, _ratios_restIndex, _o_padding, _o_padding1, _o_padding2;
51
- var _props_memo;
56
+ var _o_route, _ref, _ref1, _o_deferredLoadingPlaceholderHeight, _o_loadingSkeletonRowCount, _ratios_layout_initialSnap, _props_bottomInset, _o_scrollToEndThreshold, _o_openAnimationDurationMs, _o_closeAnimationDurationMs, _o_cornerRadius, _o_backgroundColor, _ratios_restIndex, _o_padding, _o_padding1, _o_padding2;
57
+ var _o_route1, _o_route2, _props_memo;
52
58
  const { entry, stack, settings } = props;
53
59
  const palette = useG9Theme().palette;
54
60
  const gesture = useSheetGestureRefs();
55
61
  const bodyGesture = useSheetBodyGesture(gesture);
56
62
  const o = entry.options;
63
+ const placeOpen = 'opening' === entry.status || 'open' === entry.status;
64
+ useG9Place({
65
+ ...null != (_o_route = o.route) ? _o_route : {},
66
+ segment: null != (_ref = null == (_o_route1 = o.route) ? void 0 : _o_route1.segment) ? _ref : sheetSegmentOf(o.automationId),
67
+ layer: 'sheet',
68
+ order: entry.id,
69
+ ...(null == (_o_route2 = o.route) ? void 0 : _o_route2.title) ? {} : 'string' == typeof o.title && o.title.trim() ? {
70
+ title: ()=>'string' == typeof o.title ? o.title : null
71
+ } : {},
72
+ close: ()=>{
73
+ stack.close(entry.id);
74
+ }
75
+ }, {
76
+ active: placeOpen
77
+ });
57
78
  const layout = resolveSheetLayout(o, props.hostHeight);
58
79
  const showing = 'opening' === entry.status || 'open' === entry.status;
59
80
  const closing = 'closing' === entry.status;
@@ -100,7 +121,7 @@ function G9SheetFrame(props) {
100
121
  entry.status
101
122
  ]);
102
123
  const memoKey = o.heightMemoKey ? `${o.heightMemoKey}|w${Math.round(props.hostWidth)}|${props.culture}|fs1` : null;
103
- const placeholderHeight = o.useFullScreenLoadingPlaceholder ? props.hostHeight : null != (_ref = null != (_o_deferredLoadingPlaceholderHeight = o.deferredLoadingPlaceholderHeight) ? _o_deferredLoadingPlaceholderHeight : memoKey ? null == (_props_memo = props.memo) ? void 0 : _props_memo.lookup(memoKey) : void 0) ? _ref : g9SheetFitLoadingMinHeight;
124
+ const placeholderHeight = o.useFullScreenLoadingPlaceholder ? props.hostHeight : null != (_ref1 = null != (_o_deferredLoadingPlaceholderHeight = o.deferredLoadingPlaceholderHeight) ? _o_deferredLoadingPlaceholderHeight : memoKey ? null == (_props_memo = props.memo) ? void 0 : _props_memo.lookup(memoKey) : void 0) ? _ref1 : g9SheetFitLoadingMinHeight;
104
125
  const [bodyHeight, setBodyHeight] = useState(0);
105
126
  const [footerHeight, setFooterHeight] = useState(0);
106
127
  const [chromeTopHeight, setChromeTopHeight] = useState(0);
@@ -167,9 +188,28 @@ function G9SheetFrame(props) {
167
188
  resting,
168
189
  layout.fit
169
190
  ]);
191
+ const lastHostHeight = useRef(props.hostHeight);
192
+ useEffect(()=>{
193
+ var _rootRef_current;
194
+ if (Math.abs(lastHostHeight.current - props.hostHeight) < 1) return;
195
+ lastHostHeight.current = props.hostHeight;
196
+ if ('open' !== entry.status) return;
197
+ null == (_rootRef_current = rootRef.current) || _rootRef_current.snapTo(restingSnapIndex(resting, layout.fit, orderedDetents(o)), {
198
+ animate: false
199
+ });
200
+ }, [
201
+ props.hostHeight,
202
+ entry.status
203
+ ]);
170
204
  const topPadding = sheetSurfaceTopPadding(o, layout, resting, props.topInset, props.hostHeight);
171
205
  const bottomPadding = sheetSurfaceBottomPadding(o, null != (_props_bottomInset = props.bottomInset) ? _props_bottomInset : 0);
172
206
  const maxBody = null === layout.fitMaxHeight ? null : Math.max(g9SheetFitMinHeight, layout.fitMaxHeight - chromeTopHeight - footerHeight - topPadding - bottomPadding);
207
+ const anchorLayer = useMemo(()=>({
208
+ layer: 'sheet',
209
+ sheetId: props.entry.id
210
+ }), [
211
+ props.entry.id
212
+ ]);
173
213
  const contextValue = {
174
214
  handle,
175
215
  signal: controller.current.signal,
@@ -179,6 +219,10 @@ function G9SheetFrame(props) {
179
219
  };
180
220
  const platform = currentPlatform();
181
221
  const phone = 'android' === platform || 'ios' === platform;
222
+ const endProps = o.onScrollToEnd ? {
223
+ 'lower-threshold': null != (_o_scrollToEndThreshold = o.scrollToEndThreshold) ? _o_scrollToEndThreshold : g9SheetScrollToEndThreshold,
224
+ bindscrolltolower: o.onScrollToEnd
225
+ } : {};
182
226
  const openMs = null != (_o_openAnimationDurationMs = o.openAnimationDurationMs) ? _o_openAnimationDurationMs : settings.openAnimationDurationMs;
183
227
  const closeMs = null != (_o_closeAnimationDurationMs = o.closeAnimationDurationMs) ? _o_closeAnimationDurationMs : settings.closeAnimationDurationMs;
184
228
  const corner = 'android' === platform && true === o.androidShouldRemoveExpandedCorners && layout.fullScreen ? 0 : null != (_o_cornerRadius = o.cornerRadius) ? _o_cornerRadius : 12;
@@ -243,19 +287,20 @@ function G9SheetFrame(props) {
243
287
  ...notch
244
288
  }}>
245
289
  <SheetContext.Provider value={contextValue}>
246
- <view className="g9-sheet__chrome-top" bindlayoutchange={onChromeTopLayout}>
247
- {layout.showHandle || layout.fullScreen && o.showToolbar && false !== o.showFullScreenDragHandle && !layout.dragDisabled ? <view className="g9-sheet__grabber-area">
248
- <view className="g9-sheet__grabber"/>
249
- </view> : null}
250
- <G9SheetHeader options={o} onBack={()=>void stack.requestBack(entry.id, 'toolbarButton')}/>
251
- {o.showToolbar && false !== o.useStandardBodyTopGap ? <view className="g9-sheet__body-gap"/> : null}
252
- </view>
253
- {false === o.scrollBody ? <view className={`g9-sheet__body g9-sheet__body--static${layout.fillBody ? ' g9-sheet__body--fill' : ''}`} style={{
290
+ <G9AnchorLayerContext.Provider value={anchorLayer}>
291
+ <view className="g9-sheet__chrome-top" bindlayoutchange={onChromeTopLayout}>
292
+ {layout.showHandle || layout.fullScreen && o.showToolbar && false !== o.showFullScreenDragHandle && !layout.dragDisabled ? <view className="g9-sheet__grabber-area">
293
+ <view className="g9-sheet__grabber"/>
294
+ </view> : null}
295
+ <G9SheetHeader options={o} onBack={()=>void stack.requestBack(entry.id, 'toolbarButton')}/>
296
+ {o.showToolbar && false !== o.useStandardBodyTopGap ? <view className="g9-sheet__body-gap"/> : null}
297
+ </view>
298
+ {false === o.scrollBody ? <view className={`g9-sheet__body g9-sheet__body--static${layout.fillBody ? ' g9-sheet__body--fill' : ''}`} style={{
254
299
  padding: `${null != (_o_padding = o.padding) ? _o_padding : 0}px`
255
300
  }}>
256
- {content}
257
- </view> : indicator.current ? <view className={`g9-sheet__body-frame${layout.fillBody ? ' g9-sheet__body--fill' : ''}`}>
258
- <scroll-view className={`g9-sheet__body${layout.fillBody ? ' g9-sheet__body--fill' : ''}`} scroll-orientation="vertical" main-thread:ref={gesture.body} main-thread:bindscroll={phone ? bodyGesture.onScrollMT : void 0} main-thread:bindtouchstart={bodyGesture.onTouchStartMT} scroll-event-throttle={16} bindscroll={(e)=>{
301
+ {content}
302
+ </view> : indicator.current ? <view className={`g9-sheet__body-frame${layout.fillBody ? ' g9-sheet__body--fill' : ''}`}>
303
+ <scroll-view className={`g9-sheet__body${layout.fillBody ? ' g9-sheet__body--fill' : ''}`} scroll-orientation="vertical" main-thread:ref={gesture.body} main-thread:bindscroll={phone ? bodyGesture.onScrollMT : void 0} main-thread:bindtouchstart={bodyGesture.onTouchStartMT} scroll-event-throttle={16} {...endProps} bindscroll={(e)=>{
259
304
  var _ref;
260
305
  var _e_detail, _indicator_current;
261
306
  return null == (_indicator_current = indicator.current) ? void 0 : _indicator_current.setTop(null != (_ref = null == (_e_detail = e.detail) ? void 0 : _e_detail.scrollTop) ? _ref : 0);
@@ -269,20 +314,21 @@ function G9SheetFrame(props) {
269
314
  maxHeight: `${maxBody}px`
270
315
  } : {}
271
316
  }}>
272
- {content}
273
- </scroll-view>
274
- <G9SheetScrollIndicator model={indicator.current}/>
275
- </view> : <scroll-view className={`g9-sheet__body${layout.fillBody ? ' g9-sheet__body--fill' : ''}`} scroll-orientation="vertical" main-thread:ref={gesture.body} main-thread:bindscroll={phone ? bodyGesture.onScrollMT : void 0} main-thread:bindtouchstart={bodyGesture.onTouchStartMT} style={{
317
+ {content}
318
+ </scroll-view>
319
+ <G9SheetScrollIndicator model={indicator.current}/>
320
+ </view> : <scroll-view className={`g9-sheet__body${layout.fillBody ? ' g9-sheet__body--fill' : ''}`} scroll-orientation="vertical" main-thread:ref={gesture.body} main-thread:bindscroll={phone ? bodyGesture.onScrollMT : void 0} main-thread:bindtouchstart={bodyGesture.onTouchStartMT} {...endProps} style={{
276
321
  padding: `${null != (_o_padding2 = o.padding) ? _o_padding2 : 0}px`,
277
322
  ...null !== maxBody ? {
278
323
  maxHeight: `${maxBody}px`
279
324
  } : {}
280
325
  }}>
281
- {content}
282
- </scroll-view>}
283
- <view className="g9-sheet__footer-slot" bindlayoutchange={onFooterLayout}>
284
- <G9SheetFooter options={o}/>
285
- </view>
326
+ {content}
327
+ </scroll-view>}
328
+ <view className="g9-sheet__footer-slot" bindlayoutchange={onFooterLayout}>
329
+ <G9SheetFooter options={o}/>
330
+ </view>
331
+ </G9AnchorLayerContext.Provider>
286
332
  </SheetContext.Provider>
287
333
  </view>
288
334
  {}
@@ -294,6 +340,6 @@ function G9SheetFrame(props) {
294
340
  </SheetView>
295
341
  </SheetRoot>;
296
342
  }
297
- export { G9SheetFrame, useG9SheetContext };
343
+ export { G9SheetFrame, restingSnapIndex, useG9SheetContext };
298
344
 
299
345
  //# sourceMappingURL=frame.jsx.map
@@ -1 +1 @@
1
- {"version":3,"file":"sheet/frame.jsx","sources":["../../src/sheet/frame.tsx"],"sourcesContent":["import './sheet.css';\nimport {\n createAbortController,\n formatColor,\n type G9AbortController,\n type G9AbortSignal,\n g9Ms,\n resolveThemeColor,\n tryParseColor,\n withAlpha,\n} from '@g9tm/lynxcontrols-foundation';\nimport { SheetContent, SheetRoot, type SheetRootRef, SheetView } from '@lynx-js/lynx-ui-sheet';\nimport { createContext, type ReactNode, useContext, useEffect, useRef, useState } from '@lynx-js/react';\nimport { g9IdProps } from '../base/control';\nimport { type G9TimerHandle, startTimer, stopTimer } from '../base/timers';\nimport { G9ActivityIndicator } from '../display/activity-indicator';\nimport { G9SheetSkeleton } from '../display/shimmer';\nimport { g9FieldNotchStyle } from '../fields/notch';\nimport { useG9Theme } from '../provider/hooks';\nimport { G9SheetGestureFrame, useSheetBodyGesture, useSheetGestureRefs } from './gesture';\nimport { G9SheetFooter, G9SheetHeader } from './header';\nimport type { G9SheetHeightMemo } from './height-memo';\nimport { resolveSheetMotion } from './motion';\nimport type { G9SheetDetent, G9SheetSettings } from './options';\nimport { G9SheetScrollIndicator, G9SheetScrollModel } from './scroll-indicator';\nimport {\n clampFitHeight,\n currentPlatform,\n g9SheetDragCloseThreshold,\n g9SheetFitLoadingMinHeight,\n g9SheetFitMinHeight,\n parentRecedeOffset,\n platformSheetConstraints,\n resolveSheetLayout,\n sheetOverlayOpacity,\n sheetSurfaceBottomPadding,\n sheetSurfaceTopPadding,\n} from './sizing';\nimport type { G9SheetEntry, G9SheetHandle, G9SheetStack } from './stack';\n\n/** What content inside a sheet can read (MAUI `IG9BottomSheetAwareView` + deferred load signals). */\nexport interface G9SheetContextValue {\n /** The sheet-scoped handle: `close()` closes only this sheet. */\n readonly handle: G9SheetHandle;\n /** Aborted when the sheet starts closing (cancel loads with it). */\n readonly signal: G9AbortSignal;\n /** The open motion has finished. */\n readonly opened: boolean;\n /** The sheet is closing. */\n readonly closing: boolean;\n /** Resting body cap of a fit sheet (px), else `null`. */\n readonly maxBodyHeight: number | null;\n}\n\nconst SheetContext = createContext<G9SheetContextValue | null>(null);\n\n/** The enclosing sheet, or `null` outside one. */\nexport function useG9SheetContext(): G9SheetContextValue | null {\n return useContext(SheetContext);\n}\n\n/** Props of {@link G9SheetFrame}. */\nexport interface G9SheetFrameProps {\n readonly entry: G9SheetEntry;\n readonly stack: G9SheetStack;\n /** Host height (px): percentage detents and caps resolve against it. */\n readonly hostHeight: number;\n readonly hostWidth: number;\n readonly topInset: number;\n /** The host's bottom safe inset (a visible navigation bar); the surface pads by it. Default 0. */\n readonly bottomInset?: number;\n readonly settings: Required<G9SheetSettings>;\n readonly memo: G9SheetHeightMemo | null;\n /** Culture tag of the memo key. */\n readonly culture: string;\n /** The sheet is the top of the stack (receives scrim input). */\n readonly isTop: boolean;\n /** The sheet came to rest at a new height (px); drives the page recede threshold. */\n readonly onRest?: (heightPx: number) => void;\n}\n\nfunction scrimColor(entry: G9SheetEntry, settings: Required<G9SheetSettings>, opacity: number): string {\n const explicit = entry.options.windowBackgroundColor;\n const parsed = tryParseColor(explicit ?? settings.modalOverlayColor);\n if (!parsed) return explicit ?? settings.modalOverlayColor;\n return formatColor(withAlpha(parsed, explicit ? parsed.a : opacity));\n}\n\n/** lynx-ui's inner view lays G9's frame out as a column (its default `linear` layout ignores `flex`). */\nconst sheetInnerStyle = { display: 'flex', flexDirection: 'column' } as const;\n/** The receded parent sinks and fades over 220 ms (MAUI `StackParentRecedeDurationMs`, CubicOut). */\nconst g9SheetRecedeTransition = (): string => `transform ${g9Ms(220)}ms ease-out, opacity ${g9Ms(220)}ms ease-out`;\n\n/** The sheet's detents, small to large (the order of lynx-ui's snap points). */\nfunction orderedDetents(o: G9SheetEntry['options']): G9SheetDetent[] {\n const requested = o.states && o.states.length > 0 ? o.states : (['medium', 'large'] as const);\n return (['peek', 'medium', 'large'] as const).filter((d) => requested.includes(d));\n}\n\n/** The detent a sheet opens at (`'fit'` for fit-to-content). */\nfunction initialDetent(o: G9SheetEntry['options'], fit: boolean): G9SheetDetent | 'fit' {\n if (fit) return 'fit';\n const ordered = orderedDetents(o);\n const current = o.currentState ?? 'medium';\n return ordered.includes(current) ? current : (ordered[0] ?? 'medium');\n}\n\n/**\n * One sheet of the stack on lynx-ui `SheetRoot` (motion, drag, snap points from lynx-ui; G9 adds detent mapping,\n * scrim, header/footer, deferred content, recede and results). Rendered by the sheet service in the host's sheets\n * layer; use `useG9Sheets()` to open sheets.\n */\nexport function G9SheetFrame(props: G9SheetFrameProps): ReactNode {\n const { entry, stack, settings } = props;\n const palette = useG9Theme().palette;\n const gesture = useSheetGestureRefs();\n const bodyGesture = useSheetBodyGesture(gesture);\n const o = entry.options;\n const layout = resolveSheetLayout(o, props.hostHeight);\n const showing = entry.status === 'opening' || entry.status === 'open';\n const closing = entry.status === 'closing';\n const handle = stack.handleOf(entry.id) as G9SheetHandle;\n\n const controller = useRef<G9AbortController | null>(null);\n if (controller.current === null) controller.current = createAbortController();\n useEffect(() => {\n if (closing || entry.status === 'closed') controller.current?.abort();\n }, [closing, entry.status]);\n useEffect(() => () => controller.current?.abort(), []);\n\n // Deferred (factory) content: placeholder until the open motion ended + loadDelayMs, then the body.\n const factory = typeof entry.content === 'function';\n const deferred = (factory || settings.deferPrebuiltContent) && o.deferContent !== false;\n const [revealed, setRevealed] = useState(!deferred);\n const [covering, setCovering] = useState(false);\n const timer = useRef<G9TimerHandle | null>(null);\n const coverTimer = useRef<G9TimerHandle | null>(null);\n useEffect(\n () => () => {\n if (coverTimer.current !== null) stopTimer(coverTimer.current);\n },\n [],\n );\n useEffect(() => {\n if (!deferred || revealed || entry.status !== 'open') return;\n const delay = layout.fullScreen\n ? Math.max(o.loadDelayMs ?? 369, settings.openAnimationDurationMs + 32)\n : (o.loadDelayMs ?? 369);\n timer.current = startTimer(() => {\n setRevealed(true);\n if (o.fadeDeferredContentIn !== false) {\n setCovering(true);\n coverTimer.current = startTimer(() => setCovering(false), g9Ms(220));\n }\n }, delay);\n return () => {\n if (timer.current !== null) stopTimer(timer.current);\n };\n }, [deferred, revealed, entry.status]);\n\n const memoKey = o.heightMemoKey ? `${o.heightMemoKey}|w${Math.round(props.hostWidth)}|${props.culture}|fs1` : null;\n const placeholderHeight = o.useFullScreenLoadingPlaceholder\n ? props.hostHeight\n : (o.deferredLoadingPlaceholderHeight ??\n (memoKey ? props.memo?.lookup(memoKey) : undefined) ??\n g9SheetFitLoadingMinHeight);\n\n const [bodyHeight, setBodyHeight] = useState(0);\n // The footer can come and go after the open (a `footerBand` whose buttons wait for data): it counts for the fit too.\n const [footerHeight, setFooterHeight] = useState(0);\n // The grabber, header and body gap above the body: part of the chrome a fit sheet's cap includes.\n const [chromeTopHeight, setChromeTopHeight] = useState(0);\n const onChromeTopLayout = (e: { detail?: { height?: number } }) =>\n setChromeTopHeight(Math.max(0, e.detail?.height ?? 0));\n const onFooterLayout = (e: { detail?: { height?: number } }) => setFooterHeight(Math.max(0, e.detail?.height ?? 0));\n // `scrollIndicator: 'always'` (./scroll-indicator.tsx): the thumb's own store, fed by the body and its content.\n const indicator = useRef<G9SheetScrollModel | null>(null);\n if (o.scrollIndicator === 'always' && o.scrollBody !== false && !indicator.current)\n indicator.current = new G9SheetScrollModel();\n const onBodyLayout = (e: { detail?: { height?: number } }) => {\n const h = e.detail?.height ?? 0;\n // The scroller's range is the content plus the body's padding on both sides.\n indicator.current?.setContent(h > 0 ? h + 2 * (o.padding ?? 0) : 0);\n if (h <= 0) return;\n setBodyHeight(h);\n if (memoKey && revealed && !covering) props.memo?.record(memoKey, h);\n };\n\n const placeholder =\n o.loadingSkeleton && o.loadingSkeleton !== 'none' ? (\n <view className=\"g9-sheet__placeholder\" style={{ height: `${placeholderHeight}px` }}>\n <G9SheetSkeleton skeleton={o.loadingSkeleton} rowCount={o.loadingSkeletonRowCount ?? 0} />\n </view>\n ) : (\n <view\n className=\"g9-sheet__placeholder g9-sheet__placeholder--spinner\"\n style={{ height: `${placeholderHeight}px` }}\n >\n <G9ActivityIndicator running size={32} />\n </view>\n );\n const body = revealed ? (factory ? (entry.content as () => ReactNode)() : (entry.content as ReactNode)) : null;\n\n // Scrim: the resting dim of the detent (one detent → max; several → interpolated at the initial detent). A fit sheet\n // ranges from its content height to full screen (MAUI ResolveModalOverlayOpacity), so at rest it dims at the\n // MINIMUM — unless its content fills the screen (MAUI's single-state range).\n const ratios = layout.snapPoints.map((p) =>\n typeof p === 'number' ? p / Math.max(1, props.hostHeight) : p === 'fit' ? 0.5 : Number.parseFloat(p) / 100,\n );\n const restingRatio = ratios[layout.initialSnap] ?? 1;\n // The share of the screen the sheet SHOWS: a fit sheet stops at its cap, so content taller than the cap (a long list\n // scrolling inside it) does not \"fill the screen\" — measured on the full content height, AgriPad's block sheet dimmed\n // at the maximum once its harvest list grew (0.69 where MAUI keeps 0.3).\n const shown = layout.fitMaxHeight !== null ? Math.min(bodyHeight, layout.fitMaxHeight) : bodyHeight;\n const contentRatio = bodyHeight > 0 ? Math.min(1, shown / Math.max(1, props.hostHeight)) : 0.5;\n const opacity = entry.handingOff\n ? 0\n : layout.fit\n ? contentRatio >= 0.99\n ? settings.modalOverlayMaximumOpacity\n : settings.modalOverlayMinimumOpacity\n : sheetOverlayOpacity(\n restingRatio,\n ratios,\n settings.modalOverlayMinimumOpacity,\n settings.modalOverlayMaximumOpacity,\n );\n const modal = o.isModal !== false;\n // The receded parent sinks and fades (MAUI stack recede). This runs on G9's own frame view, never on lynx-ui's\n // SheetContent view: lynx-ui moves that one from a main-thread worklet, and an inline style written over it from\n // here put the parent back at its closed offset when the child closed (the parent vanished, its scrim stayed).\n const recede = entry.receded\n ? { transform: `translateY(${parentRecedeOffset(bodyHeight || props.hostHeight * 0.5)}px)`, opacity: 0 }\n : { transform: 'translateY(0px)', opacity: 1 };\n const [resting, setResting] = useState<G9SheetDetent | 'fit'>(() => initialDetent(o, layout.fit));\n\n // A fit sheet whose body grows or shrinks AFTER it opened (rows that load later, a spinner replaced by content):\n // lynx-ui re-measures the 'fit' snap point on layout but leaves the sheet where it was, so a taller body ran off the\n // bottom of the screen (its footer unreachable). Re-snap to the new fit while the sheet rests there.\n const rootRef = useRef<SheetRootRef | null>(null);\n const lastFitBody = useRef(0);\n useEffect(() => {\n if (!layout.fit || bodyHeight <= 0 || entry.status !== 'open' || resting !== 'fit') return;\n // Also right after the open motion: the body may have grown while the sheet was still sliding in.\n const fitHeight = bodyHeight + footerHeight;\n if (Math.abs(lastFitBody.current - fitHeight) < 1) return;\n lastFitBody.current = fitHeight;\n rootRef.current?.snapTo(0, { animate: true });\n }, [bodyHeight, footerHeight, entry.status, resting, layout.fit]);\n const topPadding = sheetSurfaceTopPadding(o, layout, resting, props.topInset, props.hostHeight);\n const bottomPadding = sheetSurfaceBottomPadding(o, props.bottomInset ?? 0);\n // MAUI caps the WHOLE fit sheet at MaxFitToContentHeightRatio of the screen (the helper's chrome — header band, body\n // gap, footer — is part of the natural height it clamps); the body gets what is left. Capping only the body let a long\n // fit sheet stand ~65 dp taller than MAUI's (its header and gap on top of a 75 % body).\n const maxBody =\n layout.fitMaxHeight === null\n ? null\n : Math.max(\n g9SheetFitMinHeight,\n layout.fitMaxHeight - chromeTopHeight - footerHeight - topPadding - bottomPadding,\n );\n const contextValue: G9SheetContextValue = {\n handle,\n signal: (controller.current as G9AbortController).signal,\n opened: entry.status === 'open',\n closing,\n maxBodyHeight: maxBody,\n };\n const platform = currentPlatform();\n // The body reports its scroll offset to the gesture routing on the main thread (./gesture.tsx) on the phones only:\n // Lynxtron (desktop) drops the WHOLE sheet, no element of it is created, when the body's scroll-view carries\n // `main-thread:bindscroll` (the gallery smoke, Azure build 614). On the desktop a wheel scrolls the body.\n const phone = platform === 'android' || platform === 'ios';\n const openMs = o.openAnimationDurationMs ?? settings.openAnimationDurationMs;\n const closeMs = o.closeAnimationDurationMs ?? settings.closeAnimationDurationMs;\n const corner =\n platform === 'android' && o.androidShouldRemoveExpandedCorners === true && layout.fullScreen\n ? 0\n : (o.cornerRadius ?? 12);\n const surface = o.backgroundColor ?? 'var(--g9-surface-container)';\n // Fields in the sheet hide their outline under a floated label with the sheet's colour, not the page's.\n const notch = g9FieldNotchStyle(resolveThemeColor(surface, palette));\n // Motion (MAUI G9SheetMotionModel, ./motion.ts): Material's settle on Android, the UIKit spring on iOS, or the timed\n // cubic; the travel is the share of the host the sheet covers where it rests (a fit sheet: its measured body).\n const detents = orderedDetents(o);\n const restIndex = layout.fit ? 0 : Math.max(0, detents.indexOf(resting as G9SheetDetent));\n const fitRatio =\n bodyHeight > 0 ? Math.min(1, (bodyHeight + topPadding + bottomPadding) / Math.max(1, props.hostHeight)) : 0.4;\n const openRatio = layout.fit ? fitRatio : (ratios[restIndex] ?? restingRatio);\n const motion = resolveSheetMotion({\n style: settings.motionStyle,\n platform,\n openRatio,\n snapRatio: ratios.length > 1 ? Math.max(...ratios) - Math.min(...ratios) : openRatio,\n openMs,\n closeMs,\n perSheetOpen: o.openAnimationDurationMs != null,\n perSheetClose: o.closeAnimationDurationMs != null,\n sizeScaled: settings.sizeScaledAnimationDuration,\n });\n // The body's content; inside a scroller by default, or filling a static body (`scrollBody: false`).\n const content = (\n <view\n className={`g9-sheet__content${o.scrollBody === false ? ' g9-sheet__content--fill' : ''}`}\n key={entry.version}\n bindlayoutchange={onBodyLayout}\n >\n {body}\n {!revealed ? placeholder : null}\n {covering ? (\n <view\n className=\"g9-sheet__cover\"\n style={{ height: `${clampFitHeight(placeholderHeight, props.hostHeight, true)}px` }}\n >\n {placeholder}\n </view>\n ) : null}\n </view>\n );\n return (\n <SheetRoot\n ref={rootRef}\n show={showing}\n snapPoints={layout.snapPoints}\n initialSnap={layout.initialSnap}\n screenHeight={props.hostHeight}\n dragDisabled={layout.dragDisabled}\n enableDragToClose={layout.enableDragToClose}\n dismissThreshold={g9SheetDragCloseThreshold}\n // G9 routes every touch itself (./gesture.tsx: drag vs. body scroll, N-028); lynx-ui's content handlers stay off.\n handleOnly\n onShowChange={(open) => {\n if (!open) void stack.requestBack(entry.id, 'drag');\n }}\n onSnapChange={(index, value) => {\n const detent = layout.fit ? 'fit' : (detents[index] ?? 'large');\n setResting(detent);\n props.onRest?.(value);\n o.onStateChanged?.(detent, value);\n }}\n onOpen={() => stack.markOpened(entry.id)}\n onClose={() => stack.markClosed(entry.id)}\n >\n {/* The view is `position: fixed` without a size; lynx-ui places the sheet at its `top: 100%` and the backdrop at\n its 100 %. Unsized it is 0 × 0 (Lynxtron), so the sheet slid in above the screen: give it the viewport.\n event-through lets taps reach the page around a modal sheet's scrim-less parts; the scrim and the sheet take theirs.\n A non-modal sheet's view is also `pointer-events: none`: with event-through alone the Lynx view handed a tap\n on it to what lies under the whole Lynx view, so a NATIVE element of the page under the sheet (a map's own\n MotionEvents) never got it. (A native window `container` would do it too, but needs the overlay XElement.) */}\n <SheetView\n className={`g9-sheet__view${modal ? '' : ' g9-sheet__view--passthrough'}`}\n nativeProps={{ 'event-through': modal }}\n >\n {modal ? (\n <view\n event-through={false}\n // Never flattened: a flattened view is painted on the Lynx root canvas, which a native SurfaceView (a map)\n // covers — the dim vanished over AgriPad's map while the sheet itself, a native view, still showed.\n flatten={false}\n className={`g9-sheet__scrim${props.isTop && !closing ? '' : ' g9-sheet__scrim--covered'}`}\n style={{\n backgroundColor: scrimColor(entry, settings, opacity),\n transition:\n platform === 'ios' && o.animateOverlayToColorOnIos === false\n ? 'none'\n : `background-color ${closing ? closeMs : openMs}ms`,\n }}\n bindtap={() => {\n if (layout.closeOnOverlayTap) void stack.requestBack(entry.id, 'overlayTap');\n }}\n />\n ) : null}\n {/* SheetContent's own view is lynx-ui's: a worklet writes its transform every motion frame, so its style is\n set once and never changes (a later inline-style write replaces the worklet's transform). Everything that\n changes (recede, paddings, colour) lives on G9's frame and surface inside it. */}\n <SheetContent\n className={`g9-sheet g9-sheet--${entry.status}${layout.fit ? ' g9-sheet--fit' : ''}`}\n style={platformSheetConstraints(o)}\n innerStyle={sheetInnerStyle}\n {...motion}\n >\n <G9SheetGestureFrame\n refs={gesture}\n canDrag={!layout.dragDisabled}\n bodyDrags={o.scrollingExpandsSheet !== false}\n className=\"g9-sheet__frame\"\n style={{ ...recede, transition: g9SheetRecedeTransition() }}\n >\n <view\n className=\"g9-sheet__surface\"\n {...g9IdProps(o.automationId)}\n style={{\n backgroundColor: surface,\n borderTopLeftRadius: `${corner}px`,\n borderTopRightRadius: `${corner}px`,\n paddingTop: `${topPadding}px`,\n paddingBottom: `${bottomPadding}px`,\n ...notch,\n }}\n >\n <SheetContext.Provider value={contextValue}>\n <view className=\"g9-sheet__chrome-top\" bindlayoutchange={onChromeTopLayout}>\n {layout.showHandle ||\n (layout.fullScreen &&\n o.showToolbar &&\n o.showFullScreenDragHandle !== false &&\n !layout.dragDisabled) ? (\n <view className=\"g9-sheet__grabber-area\">\n <view className=\"g9-sheet__grabber\" />\n </view>\n ) : null}\n <G9SheetHeader options={o} onBack={() => void stack.requestBack(entry.id, 'toolbarButton')} />\n {o.showToolbar && o.useStandardBodyTopGap !== false ? (\n // MAUI UseStandardBodyTopGap: G9LayoutMetrics.SheetHeaderVerticalGap, which an app scales (AgriPad ×\n // 1.3 = 13) — read from the app's --g9-layout-* variable; g9SheetHeaderMetrics.bodyTopGap is the default.\n <view className=\"g9-sheet__body-gap\" />\n ) : null}\n </view>\n {o.scrollBody === false ? (\n <view\n className={`g9-sheet__body g9-sheet__body--static${layout.fillBody ? ' g9-sheet__body--fill' : ''}`}\n style={{ padding: `${o.padding ?? 0}px` }}\n >\n {content}\n </view>\n ) : indicator.current ? (\n // The thumb's frame: the scroller and the thumb over its inline end (only with scrollIndicator).\n <view className={`g9-sheet__body-frame${layout.fillBody ? ' g9-sheet__body--fill' : ''}`}>\n <scroll-view\n className={`g9-sheet__body${layout.fillBody ? ' g9-sheet__body--fill' : ''}`}\n scroll-orientation=\"vertical\"\n main-thread:ref={gesture.body}\n main-thread:bindscroll={phone ? bodyGesture.onScrollMT : undefined}\n main-thread:bindtouchstart={bodyGesture.onTouchStartMT}\n scroll-event-throttle={16}\n bindscroll={(e: { detail?: { scrollTop?: number } }) =>\n indicator.current?.setTop(e.detail?.scrollTop ?? 0)\n }\n bindlayoutchange={(e: { detail?: { height?: number } }) =>\n indicator.current?.setViewport(e.detail?.height ?? 0)\n }\n style={{\n padding: `${o.padding ?? 0}px`,\n ...(maxBody !== null ? { maxHeight: `${maxBody}px` } : {}),\n }}\n >\n {content}\n </scroll-view>\n <G9SheetScrollIndicator model={indicator.current} />\n </view>\n ) : (\n <scroll-view\n className={`g9-sheet__body${layout.fillBody ? ' g9-sheet__body--fill' : ''}`}\n scroll-orientation=\"vertical\"\n main-thread:ref={gesture.body}\n main-thread:bindscroll={phone ? bodyGesture.onScrollMT : undefined}\n main-thread:bindtouchstart={bodyGesture.onTouchStartMT}\n style={{\n padding: `${o.padding ?? 0}px`,\n ...(maxBody !== null ? { maxHeight: `${maxBody}px` } : {}),\n }}\n >\n {content}\n </scroll-view>\n )}\n <view className=\"g9-sheet__footer-slot\" bindlayoutchange={onFooterLayout}>\n <G9SheetFooter options={o} />\n </view>\n </SheetContext.Provider>\n </view>\n {/* Below the surface, so a drag past the top detent (rubber band) never shows the page under it. */}\n <view className=\"g9-sheet__skirt\" style={{ backgroundColor: surface }} />\n </G9SheetGestureFrame>\n </SheetContent>\n </SheetView>\n </SheetRoot>\n );\n}\n"],"names":["SheetContext","createContext","useG9SheetContext","useContext","scrimColor","entry","settings","opacity","explicit","parsed","tryParseColor","formatColor","withAlpha","sheetInnerStyle","g9SheetRecedeTransition","g9Ms","orderedDetents","o","requested","d","initialDetent","fit","_o_currentState","_ordered_","ordered","current","G9SheetFrame","props","_ref","_o_loadingSkeletonRowCount","_ratios_layout_initialSnap","_props_bottomInset","_o_openAnimationDurationMs","_o_closeAnimationDurationMs","_o_cornerRadius","_o_backgroundColor","_ratios_restIndex","_o_padding","_o_padding1","_o_padding2","_props_memo","stack","palette","useG9Theme","gesture","useSheetGestureRefs","bodyGesture","useSheetBodyGesture","layout","resolveSheetLayout","showing","closing","handle","controller","useRef","createAbortController","useEffect","_controller_current","factory","deferred","revealed","setRevealed","useState","covering","setCovering","timer","coverTimer","stopTimer","_o_loadDelayMs","_o_loadDelayMs1","delay","Math","startTimer","memoKey","placeholderHeight","undefined","g9SheetFitLoadingMinHeight","bodyHeight","setBodyHeight","footerHeight","setFooterHeight","chromeTopHeight","setChromeTopHeight","onChromeTopLayout","e","_e_detail","onFooterLayout","indicator","G9SheetScrollModel","onBodyLayout","_indicator_current","h","placeholder","view","G9SheetSkeleton","G9ActivityIndicator","body","ratios","p","Number","restingRatio","shown","contentRatio","sheetOverlayOpacity","modal","recede","parentRecedeOffset","resting","setResting","rootRef","lastFitBody","_rootRef_current","fitHeight","topPadding","sheetSurfaceTopPadding","bottomPadding","sheetSurfaceBottomPadding","maxBody","g9SheetFitMinHeight","contextValue","platform","currentPlatform","phone","openMs","closeMs","corner","surface","notch","g9FieldNotchStyle","resolveThemeColor","detents","restIndex","fitRatio","openRatio","motion","resolveSheetMotion","content","clampFitHeight","SheetRoot","g9SheetDragCloseThreshold","open","index","value","_detents_index","detent","SheetView","SheetContent","platformSheetConstraints","G9SheetGestureFrame","g9IdProps","G9SheetHeader","scroll-view","G9SheetScrollIndicator","G9SheetFooter"],"mappings":";;;;;;;;;;;;;;;AAsDA,MAAMA,eAAeC,cAA0C;AAGxD,SAASC;IACd,OAAOC,WAAWH;AACpB;AAsBA,SAASI,WAAWC,KAAmB,EAAEC,QAAmC,EAAEC,OAAe;IAC3F,MAAMC,WAAWH,MAAM,OAAO,CAAC,qBAAqB;IACpD,MAAMI,SAASC,cAAcF,QAAAA,WAAAA,WAAYF,SAAS,iBAAiB;IACnE,IAAI,CAACG,QAAQ,OAAOD,QAAAA,WAAAA,WAAYF,SAAS,iBAAiB;IAC1D,OAAOK,YAAYC,UAAUH,QAAQD,WAAWC,OAAO,CAAC,GAAGF;AAC7D;AAGA,MAAMM,kBAAkB;IAAE,SAAS;IAAQ,eAAe;AAAS;AAEnE,MAAMC,0BAA0B,IAAc,CAAC,UAAU,EAAEC,KAAK,KAAK,qBAAqB,EAAEA,KAAK,KAAK,WAAW,CAAC;AAGlH,SAASC,eAAeC,CAA0B;IAChD,MAAMC,YAAYD,EAAE,MAAM,IAAIA,EAAE,MAAM,CAAC,MAAM,GAAG,IAAIA,EAAE,MAAM,GAAI;QAAC;QAAU;KAAQ;IACnF,OAAQ;QAAC;QAAQ;QAAU;KAAQ,CAAW,MAAM,CAAC,CAACE,IAAMD,UAAU,QAAQ,CAACC;AACjF;AAGA,SAASC,cAAcH,CAA0B,EAAEI,GAAY;QAG7CC,iBAC8BC;IAH9C,IAAIF,KAAK,OAAO;IAChB,MAAMG,UAAUR,eAAeC;IAC/B,MAAMQ,UAAU,QAAAH,CAAAA,kBAAAA,EAAE,YAAY,AAAD,IAAbA,kBAAkB;IAClC,OAAOE,QAAQ,QAAQ,CAACC,WAAWA,UAAU,QAACF,CAAAA,YAAAA,OAAO,CAAC,EAAE,AAAD,IAATA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B,EAAED,UAAU;IACd,EAAEP;AAEN"}
1
+ {"version":3,"file":"sheet/frame.jsx","sources":["../../src/sheet/frame.tsx"],"sourcesContent":["import './sheet.css';\nimport {\n createAbortController,\n formatColor,\n type G9AbortController,\n type G9AbortSignal,\n g9Ms,\n resolveThemeColor,\n tryParseColor,\n withAlpha,\n} from '@g9tm/lynxcontrols-foundation';\nimport { SheetContent, SheetRoot, type SheetRootRef, SheetView } from '@lynx-js/lynx-ui-sheet';\nimport { createContext, type ReactNode, useContext, useEffect, useMemo, useRef, useState } from '@lynx-js/react';\nimport { G9AnchorLayerContext } from '../anchor/context';\nimport { g9IdProps } from '../base/control';\nimport { type G9TimerHandle, startTimer, stopTimer } from '../base/timers';\nimport { G9ActivityIndicator } from '../display/activity-indicator';\nimport { G9SheetSkeleton } from '../display/shimmer';\nimport { g9FieldNotchStyle } from '../fields/notch';\nimport { useG9Theme } from '../provider/hooks';\nimport { sheetSegmentOf, useG9Place } from '../route/hooks';\nimport { G9SheetGestureFrame, useSheetBodyGesture, useSheetGestureRefs } from './gesture';\nimport { G9SheetFooter, G9SheetHeader } from './header';\nimport type { G9SheetHeightMemo } from './height-memo';\nimport { resolveSheetMotion } from './motion';\nimport type { G9SheetDetent, G9SheetSettings } from './options';\nimport { G9SheetScrollIndicator, G9SheetScrollModel } from './scroll-indicator';\nimport {\n clampFitHeight,\n currentPlatform,\n g9SheetDragCloseThreshold,\n g9SheetFitLoadingMinHeight,\n g9SheetFitMinHeight,\n g9SheetScrollToEndThreshold,\n parentRecedeOffset,\n platformSheetConstraints,\n resolveSheetLayout,\n sheetOverlayOpacity,\n sheetSurfaceBottomPadding,\n sheetSurfaceTopPadding,\n} from './sizing';\nimport type { G9SheetEntry, G9SheetHandle, G9SheetStack } from './stack';\n\n/** What content inside a sheet can read (MAUI `IG9BottomSheetAwareView` + deferred load signals). */\nexport interface G9SheetContextValue {\n /** The sheet-scoped handle: `close()` closes only this sheet. */\n readonly handle: G9SheetHandle;\n /** Aborted when the sheet starts closing (cancel loads with it). */\n readonly signal: G9AbortSignal;\n /** The open motion has finished. */\n readonly opened: boolean;\n /** The sheet is closing. */\n readonly closing: boolean;\n /** Resting body cap of a fit sheet (px), else `null`. */\n readonly maxBodyHeight: number | null;\n}\n\nconst SheetContext = createContext<G9SheetContextValue | null>(null);\n\n/** The enclosing sheet, or `null` outside one. */\nexport function useG9SheetContext(): G9SheetContextValue | null {\n return useContext(SheetContext);\n}\n\n/** Props of {@link G9SheetFrame}. */\nexport interface G9SheetFrameProps {\n readonly entry: G9SheetEntry;\n readonly stack: G9SheetStack;\n /** Host height (px): percentage detents and caps resolve against it. */\n readonly hostHeight: number;\n readonly hostWidth: number;\n readonly topInset: number;\n /** The host's bottom safe inset (a visible navigation bar); the surface pads by it. Default 0. */\n readonly bottomInset?: number;\n readonly settings: Required<G9SheetSettings>;\n readonly memo: G9SheetHeightMemo | null;\n /** Culture tag of the memo key. */\n readonly culture: string;\n /** The sheet is the top of the stack (receives scrim input). */\n readonly isTop: boolean;\n /** The sheet came to rest at a new height (px); drives the page recede threshold. */\n readonly onRest?: (heightPx: number) => void;\n}\n\nfunction scrimColor(entry: G9SheetEntry, settings: Required<G9SheetSettings>, opacity: number): string {\n const explicit = entry.options.windowBackgroundColor;\n const parsed = tryParseColor(explicit ?? settings.modalOverlayColor);\n if (!parsed) return explicit ?? settings.modalOverlayColor;\n return formatColor(withAlpha(parsed, explicit ? parsed.a : opacity));\n}\n\n/** lynx-ui's inner view lays G9's frame out as a column (its default `linear` layout ignores `flex`). */\nconst sheetInnerStyle = { display: 'flex', flexDirection: 'column' } as const;\n/** The receded parent sinks and fades over 220 ms (MAUI `StackParentRecedeDurationMs`, CubicOut). */\nconst g9SheetRecedeTransition = (): string => `transform ${g9Ms(220)}ms ease-out, opacity ${g9Ms(220)}ms ease-out`;\n\n/** The sheet's detents, small to large (the order of lynx-ui's snap points). */\nfunction orderedDetents(o: G9SheetEntry['options']): G9SheetDetent[] {\n const requested = o.states && o.states.length > 0 ? o.states : (['medium', 'large'] as const);\n return (['peek', 'medium', 'large'] as const).filter((d) => requested.includes(d));\n}\n\n/** The lynx-ui snap index of where a sheet rests: 0 for a fit sheet, else its detent's place (0 when it is unknown). */\nexport function restingSnapIndex(\n resting: G9SheetDetent | 'fit',\n fit: boolean,\n detents: readonly G9SheetDetent[],\n): number {\n if (fit || resting === 'fit') return 0;\n return Math.max(0, detents.indexOf(resting));\n}\n\n/** The detent a sheet opens at (`'fit'` for fit-to-content). */\nfunction initialDetent(o: G9SheetEntry['options'], fit: boolean): G9SheetDetent | 'fit' {\n if (fit) return 'fit';\n const ordered = orderedDetents(o);\n const current = o.currentState ?? 'medium';\n return ordered.includes(current) ? current : (ordered[0] ?? 'medium');\n}\n\n/**\n * One sheet of the stack on lynx-ui `SheetRoot` (motion, drag, snap points from lynx-ui; G9 adds detent mapping,\n * scrim, header/footer, deferred content, recede and results). Rendered by the sheet service in the host's sheets\n * layer; use `useG9Sheets()` to open sheets.\n */\nexport function G9SheetFrame(props: G9SheetFrameProps): ReactNode {\n const { entry, stack, settings } = props;\n const palette = useG9Theme().palette;\n const gesture = useSheetGestureRefs();\n const bodyGesture = useSheetBodyGesture(gesture);\n const o = entry.options;\n // The sheet's place in the navigation: declared from the moment it opens until it starts closing.\n const placeOpen = entry.status === 'opening' || entry.status === 'open';\n useG9Place(\n {\n ...(o.route ?? {}),\n segment: o.route?.segment ?? sheetSegmentOf(o.automationId),\n layer: 'sheet',\n order: entry.id,\n ...(o.route?.title\n ? {}\n : typeof o.title === 'string' && o.title.trim()\n ? { title: () => (typeof o.title === 'string' ? o.title : null) }\n : {}),\n close: () => {\n stack.close(entry.id);\n },\n },\n { active: placeOpen },\n );\n const layout = resolveSheetLayout(o, props.hostHeight);\n const showing = entry.status === 'opening' || entry.status === 'open';\n const closing = entry.status === 'closing';\n const handle = stack.handleOf(entry.id) as G9SheetHandle;\n\n const controller = useRef<G9AbortController | null>(null);\n if (controller.current === null) controller.current = createAbortController();\n useEffect(() => {\n if (closing || entry.status === 'closed') controller.current?.abort();\n }, [closing, entry.status]);\n useEffect(() => () => controller.current?.abort(), []);\n\n // Deferred (factory) content: placeholder until the open motion ended + loadDelayMs, then the body.\n const factory = typeof entry.content === 'function';\n const deferred = (factory || settings.deferPrebuiltContent) && o.deferContent !== false;\n const [revealed, setRevealed] = useState(!deferred);\n const [covering, setCovering] = useState(false);\n const timer = useRef<G9TimerHandle | null>(null);\n const coverTimer = useRef<G9TimerHandle | null>(null);\n useEffect(\n () => () => {\n if (coverTimer.current !== null) stopTimer(coverTimer.current);\n },\n [],\n );\n useEffect(() => {\n if (!deferred || revealed || entry.status !== 'open') return;\n const delay = layout.fullScreen\n ? Math.max(o.loadDelayMs ?? 369, settings.openAnimationDurationMs + 32)\n : (o.loadDelayMs ?? 369);\n timer.current = startTimer(() => {\n setRevealed(true);\n if (o.fadeDeferredContentIn !== false) {\n setCovering(true);\n coverTimer.current = startTimer(() => setCovering(false), g9Ms(220));\n }\n }, delay);\n return () => {\n if (timer.current !== null) stopTimer(timer.current);\n };\n }, [deferred, revealed, entry.status]);\n\n const memoKey = o.heightMemoKey ? `${o.heightMemoKey}|w${Math.round(props.hostWidth)}|${props.culture}|fs1` : null;\n const placeholderHeight = o.useFullScreenLoadingPlaceholder\n ? props.hostHeight\n : (o.deferredLoadingPlaceholderHeight ??\n (memoKey ? props.memo?.lookup(memoKey) : undefined) ??\n g9SheetFitLoadingMinHeight);\n\n const [bodyHeight, setBodyHeight] = useState(0);\n // The footer can come and go after the open (a `footerBand` whose buttons wait for data): it counts for the fit too.\n const [footerHeight, setFooterHeight] = useState(0);\n // The grabber, header and body gap above the body: part of the chrome a fit sheet's cap includes.\n const [chromeTopHeight, setChromeTopHeight] = useState(0);\n const onChromeTopLayout = (e: { detail?: { height?: number } }) =>\n setChromeTopHeight(Math.max(0, e.detail?.height ?? 0));\n const onFooterLayout = (e: { detail?: { height?: number } }) => setFooterHeight(Math.max(0, e.detail?.height ?? 0));\n // `scrollIndicator: 'always'` (./scroll-indicator.tsx): the thumb's own store, fed by the body and its content.\n const indicator = useRef<G9SheetScrollModel | null>(null);\n if (o.scrollIndicator === 'always' && o.scrollBody !== false && !indicator.current)\n indicator.current = new G9SheetScrollModel();\n const onBodyLayout = (e: { detail?: { height?: number } }) => {\n const h = e.detail?.height ?? 0;\n // The scroller's range is the content plus the body's padding on both sides.\n indicator.current?.setContent(h > 0 ? h + 2 * (o.padding ?? 0) : 0);\n if (h <= 0) return;\n setBodyHeight(h);\n if (memoKey && revealed && !covering) props.memo?.record(memoKey, h);\n };\n\n const placeholder =\n o.loadingSkeleton && o.loadingSkeleton !== 'none' ? (\n <view className=\"g9-sheet__placeholder\" style={{ height: `${placeholderHeight}px` }}>\n <G9SheetSkeleton skeleton={o.loadingSkeleton} rowCount={o.loadingSkeletonRowCount ?? 0} />\n </view>\n ) : (\n <view\n className=\"g9-sheet__placeholder g9-sheet__placeholder--spinner\"\n style={{ height: `${placeholderHeight}px` }}\n >\n <G9ActivityIndicator running size={32} />\n </view>\n );\n const body = revealed ? (factory ? (entry.content as () => ReactNode)() : (entry.content as ReactNode)) : null;\n\n // Scrim: the resting dim of the detent (one detent → max; several → interpolated at the initial detent). A fit sheet\n // ranges from its content height to full screen (MAUI ResolveModalOverlayOpacity), so at rest it dims at the\n // MINIMUM — unless its content fills the screen (MAUI's single-state range).\n const ratios = layout.snapPoints.map((p) =>\n typeof p === 'number' ? p / Math.max(1, props.hostHeight) : p === 'fit' ? 0.5 : Number.parseFloat(p) / 100,\n );\n const restingRatio = ratios[layout.initialSnap] ?? 1;\n // The share of the screen the sheet SHOWS: a fit sheet stops at its cap, so content taller than the cap (a long list\n // scrolling inside it) does not \"fill the screen\" — measured on the full content height, AgriPad's block sheet dimmed\n // at the maximum once its harvest list grew (0.69 where MAUI keeps 0.3).\n const shown = layout.fitMaxHeight !== null ? Math.min(bodyHeight, layout.fitMaxHeight) : bodyHeight;\n const contentRatio = bodyHeight > 0 ? Math.min(1, shown / Math.max(1, props.hostHeight)) : 0.5;\n const opacity = entry.handingOff\n ? 0\n : layout.fit\n ? contentRatio >= 0.99\n ? settings.modalOverlayMaximumOpacity\n : settings.modalOverlayMinimumOpacity\n : sheetOverlayOpacity(\n restingRatio,\n ratios,\n settings.modalOverlayMinimumOpacity,\n settings.modalOverlayMaximumOpacity,\n );\n const modal = o.isModal !== false;\n // The receded parent sinks and fades (MAUI stack recede). This runs on G9's own frame view, never on lynx-ui's\n // SheetContent view: lynx-ui moves that one from a main-thread worklet, and an inline style written over it from\n // here put the parent back at its closed offset when the child closed (the parent vanished, its scrim stayed).\n const recede = entry.receded\n ? { transform: `translateY(${parentRecedeOffset(bodyHeight || props.hostHeight * 0.5)}px)`, opacity: 0 }\n : { transform: 'translateY(0px)', opacity: 1 };\n const [resting, setResting] = useState<G9SheetDetent | 'fit'>(() => initialDetent(o, layout.fit));\n\n // A fit sheet whose body grows or shrinks AFTER it opened (rows that load later, a spinner replaced by content):\n // lynx-ui re-measures the 'fit' snap point on layout but leaves the sheet where it was, so a taller body ran off the\n // bottom of the screen (its footer unreachable). Re-snap to the new fit while the sheet rests there.\n const rootRef = useRef<SheetRootRef | null>(null);\n const lastFitBody = useRef(0);\n useEffect(() => {\n if (!layout.fit || bodyHeight <= 0 || entry.status !== 'open' || resting !== 'fit') return;\n // Also right after the open motion: the body may have grown while the sheet was still sliding in.\n const fitHeight = bodyHeight + footerHeight;\n if (Math.abs(lastFitBody.current - fitHeight) < 1) return;\n lastFitBody.current = fitHeight;\n rootRef.current?.snapTo(0, { animate: true });\n }, [bodyHeight, footerHeight, entry.status, resting, layout.fit]);\n // The host's height changed while the sheet was up — the soft keyboard on a host that pads the page by its inset (AgriPad\n // Android, 2026-11-12): lynx-ui keeps the open offset it computed for the OLD height, so a full-screen sheet opened at\n // 760 and squeezed to 463 stood 297 above the screen's top, its footer mid-screen and a band of page under it. Snap\n // again to where it rests, without motion, so the offset is computed for the new height.\n const lastHostHeight = useRef(props.hostHeight);\n useEffect(() => {\n if (Math.abs(lastHostHeight.current - props.hostHeight) < 1) return;\n lastHostHeight.current = props.hostHeight;\n if (entry.status !== 'open') return;\n rootRef.current?.snapTo(restingSnapIndex(resting, layout.fit, orderedDetents(o)), { animate: false });\n }, [props.hostHeight, entry.status]);\n const topPadding = sheetSurfaceTopPadding(o, layout, resting, props.topInset, props.hostHeight);\n const bottomPadding = sheetSurfaceBottomPadding(o, props.bottomInset ?? 0);\n // MAUI caps the WHOLE fit sheet at MaxFitToContentHeightRatio of the screen (the helper's chrome — header band, body\n // gap, footer — is part of the natural height it clamps); the body gets what is left. Capping only the body let a long\n // fit sheet stand ~65 dp taller than MAUI's (its header and gap on top of a 75 % body).\n const maxBody =\n layout.fitMaxHeight === null\n ? null\n : Math.max(\n g9SheetFitMinHeight,\n layout.fitMaxHeight - chromeTopHeight - footerHeight - topPadding - bottomPadding,\n );\n const anchorLayer = useMemo(() => ({ layer: 'sheet' as const, sheetId: props.entry.id }), [props.entry.id]);\n const contextValue: G9SheetContextValue = {\n handle,\n signal: (controller.current as G9AbortController).signal,\n opened: entry.status === 'open',\n closing,\n maxBodyHeight: maxBody,\n };\n const platform = currentPlatform();\n // The body reports its scroll offset to the gesture routing on the main thread (./gesture.tsx) on the phones only:\n // Lynxtron (desktop) drops the WHOLE sheet, no element of it is created, when the body's scroll-view carries\n // `main-thread:bindscroll` (the gallery smoke, Azure build 614). On the desktop a wheel scrolls the body.\n const phone = platform === 'android' || platform === 'ios';\n // A body that renders a window of a long list grows it when the scroll nears the end (options.onScrollToEnd).\n const endProps = o.onScrollToEnd\n ? { 'lower-threshold': o.scrollToEndThreshold ?? g9SheetScrollToEndThreshold, bindscrolltolower: o.onScrollToEnd }\n : {};\n const openMs = o.openAnimationDurationMs ?? settings.openAnimationDurationMs;\n const closeMs = o.closeAnimationDurationMs ?? settings.closeAnimationDurationMs;\n const corner =\n platform === 'android' && o.androidShouldRemoveExpandedCorners === true && layout.fullScreen\n ? 0\n : (o.cornerRadius ?? 12);\n const surface = o.backgroundColor ?? 'var(--g9-surface-container)';\n // Fields in the sheet hide their outline under a floated label with the sheet's colour, not the page's.\n const notch = g9FieldNotchStyle(resolveThemeColor(surface, palette));\n // Motion (MAUI G9SheetMotionModel, ./motion.ts): Material's settle on Android, the UIKit spring on iOS, or the timed\n // cubic; the travel is the share of the host the sheet covers where it rests (a fit sheet: its measured body).\n const detents = orderedDetents(o);\n const restIndex = layout.fit ? 0 : Math.max(0, detents.indexOf(resting as G9SheetDetent));\n const fitRatio =\n bodyHeight > 0 ? Math.min(1, (bodyHeight + topPadding + bottomPadding) / Math.max(1, props.hostHeight)) : 0.4;\n const openRatio = layout.fit ? fitRatio : (ratios[restIndex] ?? restingRatio);\n const motion = resolveSheetMotion({\n style: settings.motionStyle,\n platform,\n openRatio,\n snapRatio: ratios.length > 1 ? Math.max(...ratios) - Math.min(...ratios) : openRatio,\n openMs,\n closeMs,\n perSheetOpen: o.openAnimationDurationMs != null,\n perSheetClose: o.closeAnimationDurationMs != null,\n sizeScaled: settings.sizeScaledAnimationDuration,\n });\n // The body's content; inside a scroller by default, or filling a static body (`scrollBody: false`).\n const content = (\n <view\n className={`g9-sheet__content${o.scrollBody === false ? ' g9-sheet__content--fill' : ''}`}\n key={entry.version}\n bindlayoutchange={onBodyLayout}\n >\n {body}\n {!revealed ? placeholder : null}\n {covering ? (\n <view\n className=\"g9-sheet__cover\"\n style={{ height: `${clampFitHeight(placeholderHeight, props.hostHeight, true)}px` }}\n >\n {placeholder}\n </view>\n ) : null}\n </view>\n );\n return (\n <SheetRoot\n ref={rootRef}\n show={showing}\n snapPoints={layout.snapPoints}\n initialSnap={layout.initialSnap}\n screenHeight={props.hostHeight}\n dragDisabled={layout.dragDisabled}\n enableDragToClose={layout.enableDragToClose}\n dismissThreshold={g9SheetDragCloseThreshold}\n // G9 routes every touch itself (./gesture.tsx: drag vs. body scroll, N-028); lynx-ui's content handlers stay off.\n handleOnly\n onShowChange={(open) => {\n if (!open) void stack.requestBack(entry.id, 'drag');\n }}\n onSnapChange={(index, value) => {\n const detent = layout.fit ? 'fit' : (detents[index] ?? 'large');\n setResting(detent);\n props.onRest?.(value);\n o.onStateChanged?.(detent, value);\n }}\n onOpen={() => stack.markOpened(entry.id)}\n onClose={() => stack.markClosed(entry.id)}\n >\n {/* The view is `position: fixed` without a size; lynx-ui places the sheet at its `top: 100%` and the backdrop at\n its 100 %. Unsized it is 0 × 0 (Lynxtron), so the sheet slid in above the screen: give it the viewport.\n event-through lets taps reach the page around a modal sheet's scrim-less parts; the scrim and the sheet take theirs.\n A non-modal sheet's view is also `pointer-events: none`: with event-through alone the Lynx view handed a tap\n on it to what lies under the whole Lynx view, so a NATIVE element of the page under the sheet (a map's own\n MotionEvents) never got it. (A native window `container` would do it too, but needs the overlay XElement.) */}\n <SheetView\n className={`g9-sheet__view${modal ? '' : ' g9-sheet__view--passthrough'}`}\n nativeProps={{ 'event-through': modal }}\n >\n {modal ? (\n <view\n event-through={false}\n // Never flattened: a flattened view is painted on the Lynx root canvas, which a native SurfaceView (a map)\n // covers — the dim vanished over AgriPad's map while the sheet itself, a native view, still showed.\n flatten={false}\n className={`g9-sheet__scrim${props.isTop && !closing ? '' : ' g9-sheet__scrim--covered'}`}\n style={{\n backgroundColor: scrimColor(entry, settings, opacity),\n transition:\n platform === 'ios' && o.animateOverlayToColorOnIos === false\n ? 'none'\n : `background-color ${closing ? closeMs : openMs}ms`,\n }}\n bindtap={() => {\n if (layout.closeOnOverlayTap) void stack.requestBack(entry.id, 'overlayTap');\n }}\n />\n ) : null}\n {/* SheetContent's own view is lynx-ui's: a worklet writes its transform every motion frame, so its style is\n set once and never changes (a later inline-style write replaces the worklet's transform). Everything that\n changes (recede, paddings, colour) lives on G9's frame and surface inside it. */}\n <SheetContent\n className={`g9-sheet g9-sheet--${entry.status}${layout.fit ? ' g9-sheet--fit' : ''}`}\n style={platformSheetConstraints(o)}\n innerStyle={sheetInnerStyle}\n {...motion}\n >\n <G9SheetGestureFrame\n refs={gesture}\n canDrag={!layout.dragDisabled}\n bodyDrags={o.scrollingExpandsSheet !== false}\n className=\"g9-sheet__frame\"\n style={{ ...recede, transition: g9SheetRecedeTransition() }}\n >\n <view\n className=\"g9-sheet__surface\"\n {...g9IdProps(o.automationId)}\n style={{\n backgroundColor: surface,\n borderTopLeftRadius: `${corner}px`,\n borderTopRightRadius: `${corner}px`,\n paddingTop: `${topPadding}px`,\n paddingBottom: `${bottomPadding}px`,\n ...notch,\n }}\n >\n <SheetContext.Provider value={contextValue}>\n <G9AnchorLayerContext.Provider value={anchorLayer}>\n <view className=\"g9-sheet__chrome-top\" bindlayoutchange={onChromeTopLayout}>\n {layout.showHandle ||\n (layout.fullScreen &&\n o.showToolbar &&\n o.showFullScreenDragHandle !== false &&\n !layout.dragDisabled) ? (\n <view className=\"g9-sheet__grabber-area\">\n <view className=\"g9-sheet__grabber\" />\n </view>\n ) : null}\n <G9SheetHeader options={o} onBack={() => void stack.requestBack(entry.id, 'toolbarButton')} />\n {o.showToolbar && o.useStandardBodyTopGap !== false ? (\n // MAUI UseStandardBodyTopGap: G9LayoutMetrics.SheetHeaderVerticalGap, which an app scales (AgriPad ×\n // 1.3 = 13) — read from the app's --g9-layout-* variable; g9SheetHeaderMetrics.bodyTopGap is the default.\n <view className=\"g9-sheet__body-gap\" />\n ) : null}\n </view>\n {o.scrollBody === false ? (\n <view\n className={`g9-sheet__body g9-sheet__body--static${layout.fillBody ? ' g9-sheet__body--fill' : ''}`}\n style={{ padding: `${o.padding ?? 0}px` }}\n >\n {content}\n </view>\n ) : indicator.current ? (\n // The thumb's frame: the scroller and the thumb over its inline end (only with scrollIndicator).\n <view className={`g9-sheet__body-frame${layout.fillBody ? ' g9-sheet__body--fill' : ''}`}>\n <scroll-view\n className={`g9-sheet__body${layout.fillBody ? ' g9-sheet__body--fill' : ''}`}\n scroll-orientation=\"vertical\"\n main-thread:ref={gesture.body}\n main-thread:bindscroll={phone ? bodyGesture.onScrollMT : undefined}\n main-thread:bindtouchstart={bodyGesture.onTouchStartMT}\n scroll-event-throttle={16}\n {...endProps}\n bindscroll={(e: { detail?: { scrollTop?: number } }) =>\n indicator.current?.setTop(e.detail?.scrollTop ?? 0)\n }\n bindlayoutchange={(e: { detail?: { height?: number } }) =>\n indicator.current?.setViewport(e.detail?.height ?? 0)\n }\n style={{\n padding: `${o.padding ?? 0}px`,\n ...(maxBody !== null ? { maxHeight: `${maxBody}px` } : {}),\n }}\n >\n {content}\n </scroll-view>\n <G9SheetScrollIndicator model={indicator.current} />\n </view>\n ) : (\n <scroll-view\n className={`g9-sheet__body${layout.fillBody ? ' g9-sheet__body--fill' : ''}`}\n scroll-orientation=\"vertical\"\n main-thread:ref={gesture.body}\n main-thread:bindscroll={phone ? bodyGesture.onScrollMT : undefined}\n main-thread:bindtouchstart={bodyGesture.onTouchStartMT}\n {...endProps}\n style={{\n padding: `${o.padding ?? 0}px`,\n ...(maxBody !== null ? { maxHeight: `${maxBody}px` } : {}),\n }}\n >\n {content}\n </scroll-view>\n )}\n <view className=\"g9-sheet__footer-slot\" bindlayoutchange={onFooterLayout}>\n <G9SheetFooter options={o} />\n </view>\n </G9AnchorLayerContext.Provider>\n </SheetContext.Provider>\n </view>\n {/* Below the surface, so a drag past the top detent (rubber band) never shows the page under it. */}\n <view className=\"g9-sheet__skirt\" style={{ backgroundColor: surface }} />\n </G9SheetGestureFrame>\n </SheetContent>\n </SheetView>\n </SheetRoot>\n );\n}\n"],"names":["SheetContext","createContext","useG9SheetContext","useContext","scrimColor","entry","settings","opacity","explicit","parsed","tryParseColor","formatColor","withAlpha","sheetInnerStyle","g9SheetRecedeTransition","g9Ms","orderedDetents","o","requested","d","restingSnapIndex","resting","fit","detents","Math","initialDetent","_o_currentState","_ordered_","ordered","current","G9SheetFrame","props","_o_route","_ref1","_o_loadingSkeletonRowCount","_ratios_layout_initialSnap","_props_bottomInset","_o_scrollToEndThreshold","_o_openAnimationDurationMs","_o_closeAnimationDurationMs","_o_cornerRadius","_o_backgroundColor","_ratios_restIndex","_o_padding","_o_padding1","_o_padding2","_o_route1","_o_route2","_props_memo","stack","palette","useG9Theme","gesture","useSheetGestureRefs","bodyGesture","useSheetBodyGesture","placeOpen","useG9Place","sheetSegmentOf","layout","resolveSheetLayout","showing","closing","handle","controller","useRef","createAbortController","useEffect","_controller_current","factory","deferred","revealed","setRevealed","useState","covering","setCovering","timer","coverTimer","stopTimer","_o_loadDelayMs","_o_loadDelayMs1","delay","startTimer","memoKey","placeholderHeight","undefined","g9SheetFitLoadingMinHeight","bodyHeight","setBodyHeight","footerHeight","setFooterHeight","chromeTopHeight","setChromeTopHeight","onChromeTopLayout","e","_e_detail","onFooterLayout","indicator","G9SheetScrollModel","onBodyLayout","_indicator_current","h","placeholder","view","G9SheetSkeleton","G9ActivityIndicator","body","ratios","p","Number","restingRatio","shown","contentRatio","sheetOverlayOpacity","modal","recede","parentRecedeOffset","setResting","rootRef","lastFitBody","_rootRef_current","fitHeight","lastHostHeight","topPadding","sheetSurfaceTopPadding","bottomPadding","sheetSurfaceBottomPadding","maxBody","g9SheetFitMinHeight","anchorLayer","useMemo","contextValue","platform","currentPlatform","phone","endProps","g9SheetScrollToEndThreshold","openMs","closeMs","corner","surface","notch","g9FieldNotchStyle","resolveThemeColor","restIndex","fitRatio","openRatio","motion","resolveSheetMotion","content","clampFitHeight","SheetRoot","g9SheetDragCloseThreshold","open","index","value","_detents_index","detent","SheetView","SheetContent","platformSheetConstraints","G9SheetGestureFrame","g9IdProps","G9AnchorLayerContext","G9SheetHeader","scroll-view","G9SheetScrollIndicator","G9SheetFooter"],"mappings":";;;;;;;;;;;;;;;;;AAyDA,MAAMA,eAAeC,cAA0C;AAGxD,SAASC;IACd,OAAOC,WAAWH;AACpB;AAsBA,SAASI,WAAWC,KAAmB,EAAEC,QAAmC,EAAEC,OAAe;IAC3F,MAAMC,WAAWH,MAAM,OAAO,CAAC,qBAAqB;IACpD,MAAMI,SAASC,cAAcF,QAAAA,WAAAA,WAAYF,SAAS,iBAA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SAAS,CAkBxE"}
1
+ {"version":3,"file":"header.d.ts","sourceRoot":"","sources":["../../src/sheet/header.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,SAAS,EAAY,MAAM,gBAAgB,CAAC;AAM1D,OAAO,KAAK,EAAE,cAAc,EAAsB,MAAM,WAAW,CAAC;AAEpE,mEAAmE;AACnE,eAAO,MAAM,oBAAoB;;;;;;;;;EAS/B,CAAC;AAmCH,sCAAsC;AACtC,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAC;IACjC,0EAA0E;IAC1E,QAAQ,CAAC,MAAM,EAAE,MAAM,IAAI,CAAC;CAC7B;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,kBAAkB,GAAG,SAAS,CAgIlE;AAED,sCAAsC;AACtC,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAC;CAClC;AAED,mGAAmG;AACnG,wBAAgB,UAAU,CAAC,CAAC,EAAE,OAAO,EAAE,aAAa,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,GAAG,CAAC,EAAE,EAAE,CAK9E;AAED,mJAAmJ;AACnJ,wBAAgB,aAAa,CAAC,KAAK,EAAE,kBAAkB,GAAG,SAAS,CAUlE;AAED,yCAAyC;AACzC,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,OAAO,EAAE,aAAa,CAAC,SAAS,CAAC,CAAC;IAC3C,iBAAiB;IACjB,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;CACpC;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,GAAG,SAAS,CAkBxE"}
@@ -33,7 +33,9 @@ function ToolbarItemButton(props) {
33
33
  icon: item.icon
34
34
  } : item.text ? {
35
35
  buttonText: item.text
36
- } : {}} isBusy={busy && true === item.showBusyIndicator} isActive={true === item.isActive} showActiveBadge={true === item.showActiveBadge} animatePress={false !== item.animatePress} {...item.iconSize ? {
36
+ } : {}} isBusy={busy && true === item.showBusyIndicator} isActive={true === item.isActive} showActiveBadge={true === item.showActiveBadge && !item.badgeText} {...item.badgeText ? {
37
+ badgeText: item.badgeText
38
+ } : {}} animatePress={false !== item.animatePress} {...item.iconSize ? {
37
39
  iconSize: item.iconSize
38
40
  } : {}} {...item.accessibilityLabel || item.text ? {
39
41
  accessibilityLabel: null != (_item_accessibilityLabel = item.accessibilityLabel) ? _item_accessibilityLabel : item.text
@@ -1 +1 @@
1
- {"version":3,"file":"sheet/header.jsx","sources":["../../src/sheet/header.tsx"],"sourcesContent":["import { formatColor, G9StringKey, withAlpha } from '@g9tm/lynxcontrols-foundation';\nimport { type ReactNode, useState } from '@lynx-js/react';\nimport { g9ChildId, g9IdProps, g9RowStyle, g9SafeId } from '../base/control';\nimport { useG9Press } from '../base/press';\nimport { G9HeaderActionButton } from '../button/header-action-button';\nimport { G9IconSlot } from '../icon/slot';\nimport { useG9Direction, useG9Settings, useG9Strings, useG9Theme } from '../provider/hooks';\nimport type { G9SheetOptions, G9SheetToolbarItem } from './options';\n\n/** Header metrics (MAUI `G9LayoutMetrics` sheet header values). */\nexport const g9SheetHeaderMetrics = Object.freeze({\n minHeight: 64,\n verticalGap: 10,\n bodyTopGap: 10,\n backButton: 30,\n backGlyph: 24,\n backHitSlop: 7,\n titleSize: 16.2,\n footerMaxButtonsPerRow: 3,\n});\n\nfunction ToolbarItemButton(props: { readonly item: G9SheetToolbarItem; readonly id: string | undefined }): ReactNode {\n const { item } = props;\n const [running, setRunning] = useState(false);\n const busy = item.isBusy === true || running;\n const onPress = () => {\n if (busy && item.disableWhileBusy !== false) return;\n const result = item.onPress?.();\n if (result && typeof (result as PromiseLike<unknown>).then === 'function') {\n setRunning(true);\n (result as PromiseLike<unknown>).then(\n () => setRunning(false),\n () => setRunning(false),\n );\n }\n };\n return (\n <G9HeaderActionButton\n // MAUI ApplyVisualState: an icon wins and the text is not shown (it stays the accessibility label).\n {...(item.icon !== undefined ? { icon: item.icon } : item.text ? { buttonText: item.text } : {})}\n isBusy={busy && item.showBusyIndicator === true}\n isActive={item.isActive === true}\n showActiveBadge={item.showActiveBadge === true}\n animatePress={item.animatePress !== false}\n {...(item.iconSize ? { iconSize: item.iconSize } : {})}\n {...(item.accessibilityLabel || item.text ? { accessibilityLabel: item.accessibilityLabel ?? item.text } : {})}\n {...g9IdProps(props.id)}\n disabled={busy && item.disableWhileBusy !== false && item.showBusyIndicator !== true}\n onPress={onPress}\n />\n );\n}\n\n/** Props of {@link G9SheetHeader}. */\nexport interface G9SheetHeaderProps {\n readonly options: G9SheetOptions;\n /** The leading button (MAUI back request with source `toolbarButton`). */\n readonly onBack: () => void;\n}\n\n/**\n * The three-slot sheet header (MAUI header template): leading back/close button (RTL-aware arrow, or × with\n * `useCloseIcon`), the title (centre or near the back button), the trailing toolbar items; slot overrides\n * `headerView` > `headerLeadingAndTitleView` > `headerTitleAndTrailingView` > per-slot views > defaults. A hairline\n * closes the band. Rendered only with `showToolbar`.\n */\nexport function G9SheetHeader(props: G9SheetHeaderProps): ReactNode {\n const o = props.options;\n const direction = useG9Direction();\n const settings = useG9Settings();\n const glyphs = settings.glyphs;\n const palette = useG9Theme().palette;\n const strings = useG9Strings();\n const back = useG9Press(props.onBack, { source: 'G9SheetHeader' });\n if (o.showToolbar !== true) return null;\n if (o.headerView !== undefined && o.headerView !== null) {\n return <view className=\"g9-sheet-header g9-sheet-header--custom\">{o.headerView}</view>;\n }\n const m = g9SheetHeaderMetrics;\n const leading =\n o.headerLeadingView ??\n (o.showCloseButton ? (\n <view\n className=\"g9-sheet-header__back\"\n {...g9IdProps(g9ChildId(o.automationId, 'Back'))}\n // MAUI: the glyph sits at the reading START of its 30 dp box (HorizontalOptions.Start), not centred.\n style={{ width: `${m.backButton}px`, height: `${m.backButton}px`, ...g9RowStyle(direction) }}\n accessibility-element={true}\n accessibility-traits=\"button\"\n accessibility-label={o.useCloseIcon ? strings.get(G9StringKey.Close) : strings.get(G9StringKey.Back)}\n hit-slop={{\n top: `${m.backHitSlop}px`,\n left: `${m.backHitSlop}px`,\n right: `${m.backHitSlop}px`,\n bottom: `${m.backHitSlop}px`,\n }}\n bindtap={back}\n >\n <G9IconSlot\n icon={o.useCloseIcon ? glyphs.clear : direction === 'rtl' ? glyphs.arrowForward : glyphs.arrowBack}\n size={m.backGlyph}\n color=\"var(--g9-secondary)\"\n />\n </view>\n ) : null);\n const title =\n o.headerTitleView ??\n (o.title ? (\n <text className=\"g9-sheet-header__title\" text-maxline=\"1\" style={{ fontSize: `${m.titleSize}px` }}>\n {o.title}\n </text>\n ) : null);\n const items = o.toolbarItems ?? o.toolbarItemsFactory?.() ?? [];\n const trailing =\n o.headerTrailingView ??\n (items.length > 0 ? (\n <view className=\"g9-sheet-header__items\" style={g9RowStyle(direction)}>\n {items.map((item, i) => (\n <ToolbarItemButton\n key={item.key ?? String(i)}\n item={item}\n id={\n item.automationId\n ? g9SafeId(item.automationId)\n : g9ChildId(o.automationId, `ToolbarItem_${item.key ?? i}`)\n }\n />\n ))}\n </view>\n ) : null);\n const spanned = o.headerLeadingAndTitleView != null || o.headerTitleAndTrailingView != null;\n const center = (o.headerTitlePlacement ?? 'center') === 'center' && o.reserveEmptyHeaderSlots !== false && !spanned;\n let slots: ReactNode;\n if (o.headerLeadingAndTitleView != null) {\n slots = [\n <view key=\"lt\" className=\"g9-sheet-header__grow\" style={g9RowStyle(direction)}>\n {o.headerLeadingAndTitleView}\n </view>,\n <view key=\"t\" className=\"g9-sheet-header__end\">\n {trailing}\n </view>,\n ];\n } else if (o.headerTitleAndTrailingView != null) {\n slots = [\n <view key=\"l\" className=\"g9-sheet-header__start\">\n {leading}\n </view>,\n <view key=\"tt\" className=\"g9-sheet-header__grow\" style={g9RowStyle(direction)}>\n {o.headerTitleAndTrailingView}\n </view>,\n ];\n } else if (center) {\n slots = [\n // The side slots follow the reading direction too: in RTL the back button sits at the right EDGE, the trailing\n // items at the left edge (MAUI) — not against the centred title.\n <view key=\"l\" className=\"g9-sheet-header__side g9-sheet-header__start\" style={g9RowStyle(direction)}>\n {leading}\n </view>,\n <view key=\"t\" className=\"g9-sheet-header__title-slot\">\n {title}\n </view>,\n <view key=\"r\" className=\"g9-sheet-header__side g9-sheet-header__end\" style={g9RowStyle(direction)}>\n {trailing}\n </view>,\n ];\n } else {\n slots = [\n <view key=\"l\" className=\"g9-sheet-header__start\">\n {leading}\n </view>,\n // The grow slot follows the reading direction: in RTL a near-back title hugs the back button (right edge).\n <view key=\"t\" className=\"g9-sheet-header__grow g9-sheet-header__title-near\" style={g9RowStyle(direction)}>\n {title}\n </view>,\n <view key=\"r\" className=\"g9-sheet-header__end\">\n {trailing}\n </view>,\n ];\n }\n return (\n <view\n className={`g9-sheet-header g9-dir-${direction}`}\n style={{\n // The 64 dp band, then MAUI's 1 dp divider UNDER it (OutlineVariant @ 35 %), not inside it.\n minHeight: `${m.minHeight + 1}px`,\n paddingLeft: `${settings.sheets.headerEdgeSpacing}px`,\n paddingRight: `${settings.sheets.headerEdgeSpacing}px`,\n borderBottomColor: formatColor(withAlpha(palette.OutlineVariant, 0.35)),\n ...g9RowStyle(direction),\n }}\n >\n {slots}\n </view>\n );\n}\n\n/** Props of {@link G9SheetFooter}. */\nexport interface G9SheetFooterProps {\n readonly options: G9SheetOptions;\n}\n\n/** Rows of footer buttons: equal-width columns, wrapping every `perRow` (MAUI footer template). */\nexport function footerRows<T>(buttons: ReadonlyArray<T>, perRow: number): T[][] {\n const n = Math.max(1, Math.floor(perRow));\n const rows: T[][] = [];\n for (let i = 0; i < buttons.length; i += n) rows.push(buttons.slice(i, i + n));\n return rows;\n}\n\n/** The sheet footer: `footerBand`, else `footerView` in the band, else `footerButtons` in equal columns (3 per row by default), with a divider. */\nexport function G9SheetFooter(props: G9SheetFooterProps): ReactNode {\n const o = props.options;\n if (o.footerBand != null) return o.footerBand;\n if (o.footerView != null) return <view className=\"g9-sheet-footer\">{o.footerView}</view>;\n return (\n <G9SheetFooterBar\n buttons={o.footerButtons ?? []}\n {...(o.footerMaxButtonsPerRow !== undefined ? { maxButtonsPerRow: o.footerMaxButtonsPerRow } : {})}\n />\n );\n}\n\n/** Props of {@link G9SheetFooterBar}. */\nexport interface G9SheetFooterBarProps {\n readonly buttons: ReadonlyArray<ReactNode>;\n /** Default 3. */\n readonly maxButtonsPerRow?: number;\n}\n\n/**\n * The footer band (divider, padding, equal-width button columns); nothing at all without buttons (MAUI\n * `SheetFooterBar` hides with no visible button). Render it from a `footerBand` whose buttons come and go.\n */\nexport function G9SheetFooterBar(props: G9SheetFooterBarProps): ReactNode {\n const direction = useG9Direction();\n if (props.buttons.length === 0) return null;\n return (\n <view className=\"g9-sheet-footer\">\n {footerRows(props.buttons, props.maxButtonsPerRow ?? g9SheetHeaderMetrics.footerMaxButtonsPerRow).map(\n (row, r) => (\n <view key={r} className=\"g9-sheet-footer__row\" style={g9RowStyle(direction)}>\n {row.map((button, i) => (\n <view key={i} className=\"g9-sheet-footer__cell\">\n {button}\n </view>\n ))}\n </view>\n ),\n )}\n </view>\n );\n}\n"],"names":["g9SheetHeaderMetrics","Object","ToolbarItemButton","props","_item_accessibilityLabel","item","running","setRunning","useState","busy","onPress","result","G9HeaderActionButton","undefined","g9IdProps","G9SheetHeader","_o_headerLeadingView","_o_headerTitleView","_ref","_o_headerTrailingView","_o_headerTitlePlacement","o","direction","useG9Direction","settings","useG9Settings","glyphs","palette","useG9Theme","strings","useG9Strings","back","useG9Press","view","m","leading","g9ChildId","g9RowStyle","G9StringKey","G9IconSlot","title","text","items","trailing","i","_item_key","_item_key1","String","g9SafeId","spanned","center","slots","formatColor","withAlpha","footerRows","buttons","perRow","n","Math","rows","G9SheetFooter","_o_footerButtons","G9SheetFooterBar","_props_maxButtonsPerRow","row","r","button"],"mappings":";;;;;;;AAUO,MAAMA,uBAAuBC,OAAO,MAAM,CAAC;IAChD,WAAW;IACX,aAAa;IACb,YAAY;IACZ,YAAY;IACZ,W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O,EAAE,QAAA4D,CAAAA,0BAAAA,MAAM,gBAAgB,AAAD,IAArBA,0BAA0B/D,qBAAqB,sBAAsB,EAAE,GAAG,CACnG,CAACgE,KAAKC,KACHhC,KAAK,KAAKgC,GAAG,UAAU,uBAAuB,OAAO5B,WAAWf,YAAY;YAC3E,CAAC0C,IAAI,GAAG,CAAC,CAACE,QAAQtB,KACfX,KAAK,KAAKW,GAAG,UAAU,wBAAwB;gBAC9C,CAACsB,OAAO;cACV,EAAEjC,OACD;UACL,EAAEA,OAEJ;IACJ,EAAEA;AAEN"}
1
+ {"version":3,"file":"sheet/header.jsx","sources":["../../src/sheet/header.tsx"],"sourcesContent":["import { formatColor, G9StringKey, withAlpha } from '@g9tm/lynxcontrols-foundation';\nimport { type ReactNode, useState } from '@lynx-js/react';\nimport { g9ChildId, g9IdProps, g9RowStyle, g9SafeId } from '../base/control';\nimport { useG9Press } from '../base/press';\nimport { G9HeaderActionButton } from '../button/header-action-button';\nimport { G9IconSlot } from '../icon/slot';\nimport { useG9Direction, useG9Settings, useG9Strings, useG9Theme } from '../provider/hooks';\nimport type { G9SheetOptions, G9SheetToolbarItem } from './options';\n\n/** Header metrics (MAUI `G9LayoutMetrics` sheet header values). */\nexport const g9SheetHeaderMetrics = Object.freeze({\n minHeight: 64,\n verticalGap: 10,\n bodyTopGap: 10,\n backButton: 30,\n backGlyph: 24,\n backHitSlop: 7,\n titleSize: 16.2,\n footerMaxButtonsPerRow: 3,\n});\n\nfunction ToolbarItemButton(props: { readonly item: G9SheetToolbarItem; readonly id: string | undefined }): ReactNode {\n const { item } = props;\n const [running, setRunning] = useState(false);\n const busy = item.isBusy === true || running;\n const onPress = () => {\n if (busy && item.disableWhileBusy !== false) return;\n const result = item.onPress?.();\n if (result && typeof (result as PromiseLike<unknown>).then === 'function') {\n setRunning(true);\n (result as PromiseLike<unknown>).then(\n () => setRunning(false),\n () => setRunning(false),\n );\n }\n };\n return (\n <G9HeaderActionButton\n // MAUI ApplyVisualState: an icon wins and the text is not shown (it stays the accessibility label).\n {...(item.icon !== undefined ? { icon: item.icon } : item.text ? { buttonText: item.text } : {})}\n isBusy={busy && item.showBusyIndicator === true}\n isActive={item.isActive === true}\n showActiveBadge={item.showActiveBadge === true && !item.badgeText}\n {...(item.badgeText ? { badgeText: item.badgeText } : {})}\n animatePress={item.animatePress !== false}\n {...(item.iconSize ? { iconSize: item.iconSize } : {})}\n {...(item.accessibilityLabel || item.text ? { accessibilityLabel: item.accessibilityLabel ?? item.text } : {})}\n {...g9IdProps(props.id)}\n disabled={busy && item.disableWhileBusy !== false && item.showBusyIndicator !== true}\n onPress={onPress}\n />\n );\n}\n\n/** Props of {@link G9SheetHeader}. */\nexport interface G9SheetHeaderProps {\n readonly options: G9SheetOptions;\n /** The leading button (MAUI back request with source `toolbarButton`). */\n readonly onBack: () => void;\n}\n\n/**\n * The three-slot sheet header (MAUI header template): leading back/close button (RTL-aware arrow, or × with\n * `useCloseIcon`), the title (centre or near the back button), the trailing toolbar items; slot overrides\n * `headerView` > `headerLeadingAndTitleView` > `headerTitleAndTrailingView` > per-slot views > defaults. A hairline\n * closes the band. Rendered only with `showToolbar`.\n */\nexport function G9SheetHeader(props: G9SheetHeaderProps): ReactNode {\n const o = props.options;\n const direction = useG9Direction();\n const settings = useG9Settings();\n const glyphs = settings.glyphs;\n const palette = useG9Theme().palette;\n const strings = useG9Strings();\n const back = useG9Press(props.onBack, { source: 'G9SheetHeader' });\n if (o.showToolbar !== true) return null;\n if (o.headerView !== undefined && o.headerView !== null) {\n return <view className=\"g9-sheet-header g9-sheet-header--custom\">{o.headerView}</view>;\n }\n const m = g9SheetHeaderMetrics;\n const leading =\n o.headerLeadingView ??\n (o.showCloseButton ? (\n <view\n className=\"g9-sheet-header__back\"\n {...g9IdProps(g9ChildId(o.automationId, 'Back'))}\n // MAUI: the glyph sits at the reading START of its 30 dp box (HorizontalOptions.Start), not centred.\n style={{ width: `${m.backButton}px`, height: `${m.backButton}px`, ...g9RowStyle(direction) }}\n accessibility-element={true}\n accessibility-traits=\"button\"\n accessibility-label={o.useCloseIcon ? strings.get(G9StringKey.Close) : strings.get(G9StringKey.Back)}\n hit-slop={{\n top: `${m.backHitSlop}px`,\n left: `${m.backHitSlop}px`,\n right: `${m.backHitSlop}px`,\n bottom: `${m.backHitSlop}px`,\n }}\n bindtap={back}\n >\n <G9IconSlot\n icon={o.useCloseIcon ? glyphs.clear : direction === 'rtl' ? glyphs.arrowForward : glyphs.arrowBack}\n size={m.backGlyph}\n color=\"var(--g9-secondary)\"\n />\n </view>\n ) : null);\n const title =\n o.headerTitleView ??\n (o.title ? (\n <text className=\"g9-sheet-header__title\" text-maxline=\"1\" style={{ fontSize: `${m.titleSize}px` }}>\n {o.title}\n </text>\n ) : null);\n const items = o.toolbarItems ?? o.toolbarItemsFactory?.() ?? [];\n const trailing =\n o.headerTrailingView ??\n (items.length > 0 ? (\n <view className=\"g9-sheet-header__items\" style={g9RowStyle(direction)}>\n {items.map((item, i) => (\n <ToolbarItemButton\n key={item.key ?? String(i)}\n item={item}\n id={\n item.automationId\n ? g9SafeId(item.automationId)\n : g9ChildId(o.automationId, `ToolbarItem_${item.key ?? i}`)\n }\n />\n ))}\n </view>\n ) : null);\n const spanned = o.headerLeadingAndTitleView != null || o.headerTitleAndTrailingView != null;\n const center = (o.headerTitlePlacement ?? 'center') === 'center' && o.reserveEmptyHeaderSlots !== false && !spanned;\n let slots: ReactNode;\n if (o.headerLeadingAndTitleView != null) {\n slots = [\n <view key=\"lt\" className=\"g9-sheet-header__grow\" style={g9RowStyle(direction)}>\n {o.headerLeadingAndTitleView}\n </view>,\n <view key=\"t\" className=\"g9-sheet-header__end\">\n {trailing}\n </view>,\n ];\n } else if (o.headerTitleAndTrailingView != null) {\n slots = [\n <view key=\"l\" className=\"g9-sheet-header__start\">\n {leading}\n </view>,\n <view key=\"tt\" className=\"g9-sheet-header__grow\" style={g9RowStyle(direction)}>\n {o.headerTitleAndTrailingView}\n </view>,\n ];\n } else if (center) {\n slots = [\n // The side slots follow the reading direction too: in RTL the back button sits at the right EDGE, the trailing\n // items at the left edge (MAUI) — not against the centred title.\n <view key=\"l\" className=\"g9-sheet-header__side g9-sheet-header__start\" style={g9RowStyle(direction)}>\n {leading}\n </view>,\n <view key=\"t\" className=\"g9-sheet-header__title-slot\">\n {title}\n </view>,\n <view key=\"r\" className=\"g9-sheet-header__side g9-sheet-header__end\" style={g9RowStyle(direction)}>\n {trailing}\n </view>,\n ];\n } else {\n slots = [\n <view key=\"l\" className=\"g9-sheet-header__start\">\n {leading}\n </view>,\n // The grow slot follows the reading direction: in RTL a near-back title hugs the back button (right edge).\n <view key=\"t\" className=\"g9-sheet-header__grow g9-sheet-header__title-near\" style={g9RowStyle(direction)}>\n {title}\n </view>,\n <view key=\"r\" className=\"g9-sheet-header__end\">\n {trailing}\n </view>,\n ];\n }\n return (\n <view\n className={`g9-sheet-header g9-dir-${direction}`}\n style={{\n // The 64 dp band, then MAUI's 1 dp divider UNDER it (OutlineVariant @ 35 %), not inside it.\n minHeight: `${m.minHeight + 1}px`,\n paddingLeft: `${settings.sheets.headerEdgeSpacing}px`,\n paddingRight: `${settings.sheets.headerEdgeSpacing}px`,\n borderBottomColor: formatColor(withAlpha(palette.OutlineVariant, 0.35)),\n ...g9RowStyle(direction),\n }}\n >\n {slots}\n </view>\n );\n}\n\n/** Props of {@link G9SheetFooter}. */\nexport interface G9SheetFooterProps {\n readonly options: G9SheetOptions;\n}\n\n/** Rows of footer buttons: equal-width columns, wrapping every `perRow` (MAUI footer template). */\nexport function footerRows<T>(buttons: ReadonlyArray<T>, perRow: number): T[][] {\n const n = Math.max(1, Math.floor(perRow));\n const rows: T[][] = [];\n for (let i = 0; i < buttons.length; i += n) rows.push(buttons.slice(i, i + n));\n return rows;\n}\n\n/** The sheet footer: `footerBand`, else `footerView` in the band, else `footerButtons` in equal columns (3 per row by default), with a divider. */\nexport function G9SheetFooter(props: G9SheetFooterProps): ReactNode {\n const o = props.options;\n if (o.footerBand != null) return o.footerBand;\n if (o.footerView != null) return <view className=\"g9-sheet-footer\">{o.footerView}</view>;\n return (\n <G9SheetFooterBar\n buttons={o.footerButtons ?? []}\n {...(o.footerMaxButtonsPerRow !== undefined ? { maxButtonsPerRow: o.footerMaxButtonsPerRow } : {})}\n />\n );\n}\n\n/** Props of {@link G9SheetFooterBar}. */\nexport interface G9SheetFooterBarProps {\n readonly buttons: ReadonlyArray<ReactNode>;\n /** Default 3. */\n readonly maxButtonsPerRow?: number;\n}\n\n/**\n * The footer band (divider, padding, equal-width button columns); nothing at all without buttons (MAUI\n * `SheetFooterBar` hides with no visible button). Render it from a `footerBand` whose buttons come and go.\n */\nexport function G9SheetFooterBar(props: G9SheetFooterBarProps): ReactNode {\n const direction = useG9Direction();\n if (props.buttons.length === 0) return null;\n return (\n <view className=\"g9-sheet-footer\">\n {footerRows(props.buttons, props.maxButtonsPerRow ?? g9SheetHeaderMetrics.footerMaxButtonsPerRow).map(\n (row, r) => (\n <view key={r} className=\"g9-sheet-footer__row\" style={g9RowStyle(direction)}>\n {row.map((button, i) => (\n <view key={i} className=\"g9-sheet-footer__cell\">\n {button}\n </view>\n ))}\n </view>\n ),\n )}\n </view>\n );\n}\n"],"names":["g9SheetHeaderMetrics","Object","ToolbarItemButton","props","_item_accessibilityLabel","item","running","setRunning","useState","busy","onPress","result","G9HeaderActionButton","undefined","g9IdProps","G9SheetHeader","_o_headerLeadingView","_o_headerTitleView","_ref","_o_headerTrailingView","_o_headerTitlePlacement","o","direction","useG9Direction","settings","useG9Settings","glyphs","palette","useG9Theme","strings","useG9Strings","back","useG9Press","view","m","leading","g9ChildId","g9RowStyle","G9StringKey","G9IconSlot","title","text","items","trailing","i","_item_key","_item_key1","String","g9SafeId","spanned","center","slots","formatColor","withAlpha","footerRows","buttons","perRow","n","Math","rows","G9SheetFooter","_o_footerButtons","G9SheetFooterBar","_props_maxButtonsPerRow","row","r","button"],"mappings":";;;;;;;AAUO,MAAMA,uBAAuBC,OAAO,MAAM,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