@plexui/vue 0.9.0 → 0.11.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 (188) hide show
  1. package/dist/es/components/Alert/Alert.js +6 -2
  2. package/dist/es/components/Alert/Alert.js.map +1 -1
  3. package/dist/es/components/Avatar/Avatar.js +3 -1
  4. package/dist/es/components/Avatar/Avatar.js.map +1 -1
  5. package/dist/es/components/ButtonGroup/ButtonGroup.js +7 -0
  6. package/dist/es/components/ButtonGroup/ButtonGroup.js.map +1 -1
  7. package/dist/es/components/ButtonGroup/index.js.map +1 -1
  8. package/dist/es/components/Checkbox/Checkbox.js +5 -6
  9. package/dist/es/components/Checkbox/Checkbox.js.map +1 -1
  10. package/dist/es/components/ColorPicker/ColorPicker.js +476 -0
  11. package/dist/es/components/ColorPicker/ColorPicker.js.map +1 -0
  12. package/dist/es/components/ColorPicker/ColorWell.js +186 -0
  13. package/dist/es/components/ColorPicker/ColorWell.js.map +1 -0
  14. package/dist/es/components/ColorPicker/index.js +3 -0
  15. package/dist/es/components/ColorPicker/index.js.map +1 -0
  16. package/dist/es/components/ColorPicker/shared.js +132 -0
  17. package/dist/es/components/ColorPicker/shared.js.map +1 -0
  18. package/dist/es/components/ContextMenu/ContextMenu.js +223 -0
  19. package/dist/es/components/ContextMenu/ContextMenu.js.map +1 -0
  20. package/dist/es/components/ContextMenu/index.js +2 -0
  21. package/dist/es/components/ContextMenu/index.js.map +1 -0
  22. package/dist/es/components/ContextMenu/shared.js +58 -0
  23. package/dist/es/components/ContextMenu/shared.js.map +1 -0
  24. package/dist/es/components/DatePicker/DatePicker.js +19 -3
  25. package/dist/es/components/DatePicker/DatePicker.js.map +1 -1
  26. package/dist/es/components/DateRangePicker/DateRangePicker.js +1 -1
  27. package/dist/es/components/DateRangePicker/DateRangePicker.js.map +1 -1
  28. package/dist/es/components/Dialog/Dialog.js +245 -25
  29. package/dist/es/components/Dialog/Dialog.js.map +1 -1
  30. package/dist/es/components/Dialog/dialogSteps.js +85 -0
  31. package/dist/es/components/Dialog/dialogSteps.js.map +1 -0
  32. package/dist/es/components/Dialog/dialogViewport.js +74 -0
  33. package/dist/es/components/Dialog/dialogViewport.js.map +1 -0
  34. package/dist/es/components/Dialog/index.js +1 -1
  35. package/dist/es/components/Dialog/index.js.map +1 -1
  36. package/dist/es/components/Dialog/sheetDrag.js +2 -1
  37. package/dist/es/components/Dialog/sheetDrag.js.map +1 -1
  38. package/dist/es/components/Field/Field.js +11 -3
  39. package/dist/es/components/Field/Field.js.map +1 -1
  40. package/dist/es/components/FieldGroup/FieldGroup.js +12 -1
  41. package/dist/es/components/FieldGroup/FieldGroup.js.map +1 -1
  42. package/dist/es/components/FloatingLabelInput/FloatingLabelInput.js +2 -2
  43. package/dist/es/components/FloatingLabelInput/FloatingLabelInput.js.map +1 -1
  44. package/dist/es/components/Icon/index.js +1 -0
  45. package/dist/es/components/Icon/index.js.map +1 -1
  46. package/dist/es/components/Icon/svg/Eyedropper.js +10 -0
  47. package/dist/es/components/Icon/svg/Eyedropper.js.map +1 -0
  48. package/dist/es/components/IndexBar/IndexBar.js +215 -0
  49. package/dist/es/components/IndexBar/IndexBar.js.map +1 -0
  50. package/dist/es/components/IndexBar/index.js +2 -0
  51. package/dist/es/components/IndexBar/index.js.map +1 -0
  52. package/dist/es/components/Indicator/LoadingIndicator.js +1 -1
  53. package/dist/es/components/Indicator/LoadingIndicator.js.map +1 -1
  54. package/dist/es/components/Input/Input.js +3 -2
  55. package/dist/es/components/Input/Input.js.map +1 -1
  56. package/dist/es/components/MarkdownEditor/MarkdownEditor.js +149 -1
  57. package/dist/es/components/MarkdownEditor/MarkdownEditor.js.map +1 -1
  58. package/dist/es/components/Menu/Menu.js +206 -33
  59. package/dist/es/components/Menu/Menu.js.map +1 -1
  60. package/dist/es/components/Menu/index.js +1 -1
  61. package/dist/es/components/Menu/index.js.map +1 -1
  62. package/dist/es/components/Page/Page.js +43 -11
  63. package/dist/es/components/Page/Page.js.map +1 -1
  64. package/dist/es/components/PageControl/PageControl.js +210 -0
  65. package/dist/es/components/PageControl/PageControl.js.map +1 -0
  66. package/dist/es/components/PageControl/index.js +2 -0
  67. package/dist/es/components/PageControl/index.js.map +1 -0
  68. package/dist/es/components/PhoneLayout/PhoneLayout.js +50 -0
  69. package/dist/es/components/PhoneLayout/PhoneLayout.js.map +1 -0
  70. package/dist/es/components/PhoneLayout/index.js +2 -0
  71. package/dist/es/components/PhoneLayout/index.js.map +1 -0
  72. package/dist/es/components/Popover/Popover.js +5 -1
  73. package/dist/es/components/Popover/Popover.js.map +1 -1
  74. package/dist/es/components/Popover/deferredPointerDownOutside.js +59 -4
  75. package/dist/es/components/Popover/deferredPointerDownOutside.js.map +1 -1
  76. package/dist/es/components/Select/Select.js +18 -11
  77. package/dist/es/components/Select/Select.js.map +1 -1
  78. package/dist/es/components/SelectControl/SelectControl.js +1 -0
  79. package/dist/es/components/SelectControl/SelectControl.js.map +1 -1
  80. package/dist/es/components/Sidebar/Sidebar.js +21 -6
  81. package/dist/es/components/Sidebar/Sidebar.js.map +1 -1
  82. package/dist/es/components/Slider/Slider.js +44 -9
  83. package/dist/es/components/Slider/Slider.js.map +1 -1
  84. package/dist/es/components/Stepper/Stepper.js +195 -0
  85. package/dist/es/components/Stepper/Stepper.js.map +1 -0
  86. package/dist/es/components/Stepper/index.js +2 -0
  87. package/dist/es/components/Stepper/index.js.map +1 -0
  88. package/dist/es/components/SwipeActions/SwipeActions.js +374 -0
  89. package/dist/es/components/SwipeActions/SwipeActions.js.map +1 -0
  90. package/dist/es/components/SwipeActions/index.js +2 -0
  91. package/dist/es/components/SwipeActions/index.js.map +1 -0
  92. package/dist/es/components/Switch/Switch.js +3 -1
  93. package/dist/es/components/Switch/Switch.js.map +1 -1
  94. package/dist/es/components/TabBar/TabBar.js +205 -0
  95. package/dist/es/components/TabBar/TabBar.js.map +1 -0
  96. package/dist/es/components/TabBar/index.js +2 -0
  97. package/dist/es/components/TabBar/index.js.map +1 -0
  98. package/dist/es/components/Tabs/Tabs.js +10 -2
  99. package/dist/es/components/Tabs/Tabs.js.map +1 -1
  100. package/dist/es/components/TagInput/TagInput.js +3 -46
  101. package/dist/es/components/TagInput/TagInput.js.map +1 -1
  102. package/dist/es/components/Textarea/Textarea.js +2 -0
  103. package/dist/es/components/Textarea/Textarea.js.map +1 -1
  104. package/dist/es/components/Tip/Tip.js +276 -0
  105. package/dist/es/components/Tip/Tip.js.map +1 -0
  106. package/dist/es/components/Tip/index.js +2 -0
  107. package/dist/es/components/Tip/index.js.map +1 -0
  108. package/dist/es/components/Toast/ToastRenderer.js +30 -13
  109. package/dist/es/components/Toast/ToastRenderer.js.map +1 -1
  110. package/dist/es/components/Toast/Toaster.js +17 -6
  111. package/dist/es/components/Toast/Toaster.js.map +1 -1
  112. package/dist/es/components/Toast/toastLifecycle.js +113 -1
  113. package/dist/es/components/Toast/toastLifecycle.js.map +1 -1
  114. package/dist/es/components/Toolbar/Toolbar.js +37 -6
  115. package/dist/es/components/Toolbar/Toolbar.js.map +1 -1
  116. package/dist/es/components/Toolbar/index.js.map +1 -1
  117. package/dist/es/components/Tooltip/slot.js +3 -3
  118. package/dist/es/components/Tooltip/slot.js.map +1 -1
  119. package/dist/es/composables/useEscCloseStack.js +8 -4
  120. package/dist/es/composables/useEscCloseStack.js.map +1 -1
  121. package/dist/es/lib/fieldRow.js +15 -2
  122. package/dist/es/lib/fieldRow.js.map +1 -1
  123. package/dist/es/lib/floatingBoundary.js +3 -1
  124. package/dist/es/lib/floatingBoundary.js.map +1 -1
  125. package/dist/es/lib/helpers.js +21 -0
  126. package/dist/es/lib/helpers.js.map +1 -1
  127. package/dist/es/lib/menuSubmenuPlacement.js +51 -6
  128. package/dist/es/lib/menuSubmenuPlacement.js.map +1 -1
  129. package/dist/es/lib/menuTriggerCover.js +70 -0
  130. package/dist/es/lib/menuTriggerCover.js.map +1 -0
  131. package/dist/es/lib/phoneLayout.js +16 -0
  132. package/dist/es/lib/phoneLayout.js.map +1 -0
  133. package/dist/es/lib/scrollEdges.js +34 -0
  134. package/dist/es/lib/scrollEdges.js.map +1 -0
  135. package/dist/es/lib/toastRegion.js +6 -0
  136. package/dist/es/lib/toastRegion.js.map +1 -0
  137. package/dist/types/components/ButtonGroup/ButtonGroup.d.ts +13 -0
  138. package/dist/types/components/ButtonGroup/index.d.ts +1 -1
  139. package/dist/types/components/ColorPicker/ColorPicker.d.ts +244 -0
  140. package/dist/types/components/ColorPicker/ColorWell.d.ts +334 -0
  141. package/dist/types/components/ColorPicker/index.d.ts +3 -0
  142. package/dist/types/components/ColorPicker/shared.d.ts +69 -0
  143. package/dist/types/components/ContextMenu/ContextMenu.d.ts +128 -0
  144. package/dist/types/components/ContextMenu/index.d.ts +1 -0
  145. package/dist/types/components/ContextMenu/shared.d.ts +51 -0
  146. package/dist/types/components/DatePicker/DatePicker.d.ts +24 -4
  147. package/dist/types/components/DateRangePicker/DateRangePicker.d.ts +4 -4
  148. package/dist/types/components/Dialog/Dialog.d.ts +100 -4
  149. package/dist/types/components/Dialog/dialogSteps.d.ts +10 -0
  150. package/dist/types/components/Dialog/dialogViewport.d.ts +1 -0
  151. package/dist/types/components/Dialog/index.d.ts +1 -1
  152. package/dist/types/components/Field/Field.d.ts +21 -2
  153. package/dist/types/components/FieldGroup/FieldGroup.d.ts +18 -1
  154. package/dist/types/components/Icon/index.d.ts +1 -0
  155. package/dist/types/components/Icon/svg/Eyedropper.d.ts +3 -0
  156. package/dist/types/components/IndexBar/IndexBar.d.ts +112 -0
  157. package/dist/types/components/IndexBar/index.d.ts +1 -0
  158. package/dist/types/components/Indicator/LoadingIndicator.d.ts +2 -2
  159. package/dist/types/components/Menu/Menu.d.ts +153 -40
  160. package/dist/types/components/Menu/index.d.ts +1 -1
  161. package/dist/types/components/Page/Page.d.ts +13 -5
  162. package/dist/types/components/PageControl/PageControl.d.ts +216 -0
  163. package/dist/types/components/PageControl/index.d.ts +1 -0
  164. package/dist/types/components/PhoneLayout/PhoneLayout.d.ts +21 -0
  165. package/dist/types/components/PhoneLayout/index.d.ts +1 -0
  166. package/dist/types/components/Popover/deferredPointerDownOutside.d.ts +1 -1
  167. package/dist/types/components/Select/Select.d.ts +6 -6
  168. package/dist/types/components/Stepper/Stepper.d.ts +338 -0
  169. package/dist/types/components/Stepper/index.d.ts +1 -0
  170. package/dist/types/components/SwipeActions/SwipeActions.d.ts +135 -0
  171. package/dist/types/components/SwipeActions/index.d.ts +1 -0
  172. package/dist/types/components/TabBar/TabBar.d.ts +405 -0
  173. package/dist/types/components/TabBar/index.d.ts +1 -0
  174. package/dist/types/components/Tip/Tip.d.ts +146 -0
  175. package/dist/types/components/Tip/index.d.ts +1 -0
  176. package/dist/types/components/Toast/toastLifecycle.d.ts +34 -0
  177. package/dist/types/components/Toolbar/Toolbar.d.ts +26 -9
  178. package/dist/types/components/Toolbar/index.d.ts +1 -1
  179. package/dist/types/components/Tooltip/CopyTooltip.d.ts +1 -1
  180. package/dist/types/composables/useEscCloseStack.d.ts +2 -2
  181. package/dist/types/lib/fieldRow.d.ts +5 -0
  182. package/dist/types/lib/helpers.d.ts +6 -0
  183. package/dist/types/lib/menuSubmenuPlacement.d.ts +14 -1
  184. package/dist/types/lib/menuTriggerCover.d.ts +23 -0
  185. package/dist/types/lib/phoneLayout.d.ts +11 -0
  186. package/dist/types/lib/scrollEdges.d.ts +16 -0
  187. package/dist/types/lib/toastRegion.d.ts +5 -0
  188. package/package.json +2 -2
@@ -1,9 +1,8 @@
1
1
  import { defineComponent, h, inject, mergeProps, onMounted, onBeforeUnmount, provide, ref, } from "vue";
2
2
  import { provideFloatingBoundaryScope, useFloatingBoundaryRegistration } from "../../composables/useFloatingBoundary.js";
3
3
  import { TOOLBAR_HOST } from "../Toolbar/Toolbar.js";
4
+ import { observeScrollEdges } from "../../lib/scrollEdges.js";
4
5
  import s from "@plexui/styles/components/Page/Page.module.css";
5
- // A trackpad's small settle at the top must not flash the line.
6
- const SCROLLED_AFTER = 4;
7
6
  const PAGE_CONTEXT = Symbol("Page");
8
7
  function injectPageContext(part) {
9
8
  const scrolled = inject(PAGE_CONTEXT, null);
@@ -28,7 +27,20 @@ const PageComponent = defineComponent({
28
27
  },
29
28
  setup(props, { slots }) {
30
29
  const boundary = provideFloatingBoundaryScope();
31
- const context = { scrolled: ref(false), footerHeight: ref(0), headerHeight: ref() };
30
+ let root = null;
31
+ const setRoot = (node) => {
32
+ root = node instanceof HTMLElement ? node : null;
33
+ boundary.setRoot(node);
34
+ };
35
+ // Written straight to the element: a scroll frame must not render the page again.
36
+ const setScrollY = (scrollY) => root?.style.setProperty("--page-scroll-y", String(Math.max(0, scrollY)));
37
+ const scrollListeners = new Set();
38
+ const notifyScroll = (scrollY) => scrollListeners.forEach((listener) => listener(scrollY));
39
+ const subscribeScroll = (listener) => {
40
+ scrollListeners.add(listener);
41
+ return () => { scrollListeners.delete(listener); };
42
+ };
43
+ const context = { scrolled: ref(false), contentBelow: ref(false), footerHeight: ref(0), headerHeight: ref(), setScrollY, notifyScroll };
32
44
  provide(PAGE_CONTEXT, context);
33
45
  // A phone Toolbar replaces the header and footer bars; it reports its own heights.
34
46
  const toolbarTop = ref();
@@ -36,9 +48,11 @@ const PageComponent = defineComponent({
36
48
  provide(TOOLBAR_HOST, {
37
49
  kind: "page",
38
50
  scrolled: context.scrolled,
51
+ contentBelow: context.contentBelow,
52
+ subscribeScroll,
39
53
  setHeight: (placement, height) => { (placement === "top" ? toolbarTop : toolbarBottom).value = height; },
40
54
  });
41
- return () => h("div", { "ref": boundary.setRoot, "class": s.Page, "data-width": props.width, "data-surface": props.surface,
55
+ return () => h("div", { "ref": setRoot, "class": s.Page, "data-width": props.width, "data-surface": props.surface,
42
56
  style: {
43
57
  "--page-footer-height": `${context.footerHeight.value}px`,
44
58
  ...(context.headerHeight.value !== undefined ? { "--page-header-height": `${context.headerHeight.value}px` } : {}),
@@ -53,12 +67,14 @@ export const PageHeader = defineComponent({
53
67
  name: "PageHeader",
54
68
  props: {
55
69
  /**
56
- * Shows a divider once the content has scrolled under the header.
70
+ * Shows a divider once the content has scrolled under the header: on a
71
+ * desktop layout, and on a phone with a `"hard"` or `"glass"` background.
57
72
  * Turn it off when the content already draws a line of
58
73
  * its own at that place.
59
74
  * @default true
60
75
  */
61
76
  divider: { type: Boolean, default: true },
77
+ /** How the bar meets the content scrolled under it on a phone. @default "glass" */
62
78
  background: { type: String, default: "glass" },
63
79
  },
64
80
  setup(props, { slots }) {
@@ -137,20 +153,36 @@ export const PageContent = defineComponent({
137
153
  fill: { type: Boolean, default: false },
138
154
  },
139
155
  setup(props, { attrs, slots }) {
140
- const { scrolled } = injectPageContext("PageContent");
156
+ const { scrolled, contentBelow, setScrollY, notifyScroll } = injectPageContext("PageContent");
157
+ const element = ref(null);
158
+ let stop;
159
+ onMounted(() => {
160
+ if (!element.value)
161
+ return;
162
+ stop = observeScrollEdges(element.value, (edges) => {
163
+ scrolled.value = edges.scrolled;
164
+ contentBelow.value = edges.contentBelow;
165
+ });
166
+ });
167
+ onBeforeUnmount(() => { stop?.(); scrolled.value = false; contentBelow.value = false; });
141
168
  const onScroll = (event) => {
142
- scrolled.value = event.currentTarget.scrollTop > SCROLLED_AFTER;
169
+ const top = event.currentTarget.scrollTop;
170
+ setScrollY(top);
171
+ notifyScroll(top);
143
172
  };
144
- return () => h("div", mergeProps({ "class": s.Content, "data-fill": props.fill ? "" : undefined, onScroll }, attrs), [h("div", { class: s.Column }, slots.default?.())]);
173
+ return () => h("div", mergeProps({ "ref": element, "class": s.Content, "data-fill": props.fill ? "" : undefined, onScroll }, attrs), [h("div", { class: s.Column }, slots.default?.())]);
145
174
  },
146
175
  });
147
176
  /** Actions that remain below the scrolling content (React `Page.Footer`). */
148
177
  export const PageFooter = defineComponent({
149
178
  name: "PageFooter",
150
- props: { background: { type: String, default: "glass" } },
179
+ props: {
180
+ /** How the bar meets the content scrolled under it on a phone. @default "soft" */
181
+ background: { type: String, default: "soft" },
182
+ },
151
183
  setup(props, { slots }) {
152
184
  const element = ref(null);
153
- const { footerHeight } = injectPageContext("PageFooter");
185
+ const { contentBelow, footerHeight } = injectPageContext("PageFooter");
154
186
  const boundary = useFloatingBoundaryRegistration();
155
187
  const setFooter = (node) => {
156
188
  element.value = node instanceof HTMLElement ? node : null;
@@ -169,7 +201,7 @@ export const PageFooter = defineComponent({
169
201
  observer.observe(footer, { box: "border-box" });
170
202
  });
171
203
  onBeforeUnmount(() => { observer?.disconnect(); footerHeight.value = 0; });
172
- return () => h("div", { ref: setFooter, class: s.Footer, "data-background": props.background }, [
204
+ return () => h("div", { ref: setFooter, class: s.Footer, "data-background": props.background, "data-content-below": contentBelow.value ? "" : undefined }, [
173
205
  h("div", { class: s.FooterContent }, slots.default?.()),
174
206
  ]);
175
207
  },
@@ -1 +1 @@
1
- {"version":3,"file":"Page.js","sourceRoot":"","sources":["../../../../src/components/Page/Page.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,CAAC,EACD,MAAM,EACN,UAAU,EACV,SAAS,EACT,eAAe,EACf,OAAO,EACP,GAAG,GAKJ,MAAM,KAAK,CAAA;AACZ,OAAO,EAAE,4BAA4B,EAAE,+BAA+B,EAAE,MAAM,0CAA0C,CAAA;AACxH,OAAO,EAAE,YAAY,EAAyB,MAAM,uBAAuB,CAAA;AAC3E,OAAO,CAAC,MAAM,gDAAgD,CAAA;AAU9D,gEAAgE;AAChE,MAAM,cAAc,GAAG,CAAC,CAAA;AAGxB,MAAM,YAAY,GAA8B,MAAM,CAAC,MAAM,CAAC,CAAA;AAE9D,SAAS,iBAAiB,CAAC,IAAY;IACrC,MAAM,QAAQ,GAAG,MAAM,CAAC,YAAY,EAAE,IAAI,CAAC,CAAA;IAC3C,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,MAAM,IAAI,KAAK,CAAC,GAAG,IAAI,2BAA2B,CAAC,CAAA;IACrD,CAAC;IACD,OAAO,QAAQ,CAAA;AACjB,CAAC;AAED,MAAM,aAAa,GAAG,eAAe,C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AK,GAAG,IAAI,YAAY,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAA;YACzD,QAAQ,EAAE,SAAS,CAAC,IAAI,CAAC,CAAA;QAC3B,CAAC,CAAA;QACD,IAAI,QAAoC,CAAA;QACxC,SAAS,CAAC,GAAG,EAAE;YACb,MAAM,MAAM,GAAG,OAAO,CAAC,KAAK,CAAA;YAC5B,IAAI,CAAC,MAAM;gBAAE,OAAM;YACnB,MAAM,MAAM,GAAG,GAAG,EAAE,GAAG,YAAY,CAAC,KAAK,GAAG,MAAM,CAAC,YAAY,CAAA,CAAC,CAAC,CAAA;YACjE,MAAM,EAAE,CAAA;YACR,IAAI,OAAO,cAAc,KAAK,WAAW;gBAAE,OAAM;YACjD,QAAQ,GAAG,IAAI,cAAc,CAAC,MAAM,CAAC,CAAA;YACrC,QAAQ,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,GAAG,EAAE,YAAY,EAAE,CAAC,CAAA;QACjD,CAAC,CAAC,CAAA;QACF,eAAe,CAAC,GAAG,EAAE,GAAG,QAAQ,EAAE,UAAU,EAAE,CAAC,CAAC,YAAY,CAAC,KAAK,GAAG,CAAC,CAAA,CAAC,CAAC,CAAC,CAAA;QACzE,OAAO,GAAG,EAAE,CAAC,CAAC,CAAC,KAAK,EAAE,EAAE,GAAG,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,iBAAiB,EAAE,KAAK,CAAC,UAAU,EAAE,EAAE;YAC9F,CAAC,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC,aAAa,EAAE,EAAE,KAAK,CAAC,OAAO,EAAE,EAAE,CAAC;SACxD,CAAC,CAAA;IACJ,CAAC;CACF,CAAC,CAAA","sourcesContent":["import {\n defineComponent,\n h,\n inject,\n mergeProps,\n onMounted,\n onBeforeUnmount,\n provide,\n ref,\n type HTMLAttributes,\n type InjectionKey,\n type PropType,\n type Ref,\n} from \"vue\"\nimport { provideFloatingBoundaryScope, useFloatingBoundaryRegistration } from \"../../composables/useFloatingBoundary.js\"\nimport { TOOLBAR_HOST, type ToolbarPlacement } from \"../Toolbar/Toolbar.js\"\nimport s from \"@plexui/styles/components/Page/Page.module.css\"\n\n// Vue port of packages/ui/src/components/Page/Page.tsx. Exports are flat\n// (`PageHeader` for `Page.Header`, ...). As in React, caller attributes are\n// applied after the page's own (`class` is merged), so they win.\n\nexport type PageBarBackground = \"glass\" | \"solid\"\n\nexport type PageWidth = \"full\" | \"wide\" | \"column\"\n\n// A trackpad's small settle at the top must not flash the line.\nconst SCROLLED_AFTER = 4\n\ntype PageContext = { scrolled: Ref<boolean>; footerHeight: Ref<number>; headerHeight: Ref<number | undefined> }\nconst PAGE_CONTEXT: InjectionKey<PageContext> = Symbol(\"Page\")\n\nfunction injectPageContext(part: string): PageContext {\n const scrolled = inject(PAGE_CONTEXT, null)\n if (!scrolled) {\n throw new Error(`${part} must be used within Page`)\n }\n return scrolled\n}\n\nconst PageComponent = defineComponent({\n name: \"Page\",\n props: {\n /**\n * Width of the column that header and content share: `\"full\"` (edge to\n * edge, for tables), `\"wide\"` (1280px, centred, for overviews) or `\"column\"`\n * (768px, centred, for settings and forms). Set `--page-width` on the page\n * for any other width.\n * @default \"full\"\n */\n width: { type: String as PropType<PageWidth>, default: \"full\" },\n /** Mobile canvas and grouped-field palette. @default \"plain\" */\n surface: { type: String as PropType<\"plain\" | \"grouped\">, default: \"plain\" },\n },\n setup(props, { slots }) {\n const boundary = provideFloatingBoundaryScope()\n const context = { scrolled: ref(false), footerHeight: ref(0), headerHeight: ref<number>() }\n provide(PAGE_CONTEXT, context)\n // A phone Toolbar replaces the header and footer bars; it reports its own heights.\n const toolbarTop = ref<number>()\n const toolbarBottom = ref<number>()\n provide(TOOLBAR_HOST, {\n kind: \"page\",\n scrolled: context.scrolled,\n setHeight: (placement: ToolbarPlacement, height: number | undefined) => { (placement === \"top\" ? toolbarTop : toolbarBottom).value = height },\n })\n return () => h(\"div\", { \"ref\": boundary.setRoot, \"class\": s.Page, \"data-width\": props.width, \"data-surface\": props.surface,\n style: {\n \"--page-footer-height\": `${context.footerHeight.value}px`,\n ...(context.headerHeight.value !== undefined ? { \"--page-header-height\": `${context.headerHeight.value}px` } : {}),\n ...(toolbarTop.value !== undefined ? { \"--page-toolbar-height\": `${toolbarTop.value}px` } : {}),\n ...(toolbarBottom.value !== undefined ? { \"--page-toolbar-bottom-height\": `${toolbarBottom.value}px` } : {}),\n } }, slots.default?.())\n },\n})\n\n/** Props of `Page`. */\nexport type PageProps = { width?: PageWidth; surface?: \"plain\" | \"grouped\" } & HTMLAttributes\n\nexport const Page = PageComponent as typeof PageComponent & { new (): { $props: PageProps } }\n\n/** The band above the content, one column with it (React `Page.Header`). */\nexport const PageHeader = defineComponent({\n name: \"PageHeader\",\n props: {\n /**\n * Shows a divider once the content has scrolled under the header.\n * Turn it off when the content already draws a line of\n * its own at that place.\n * @default true\n */\n divider: { type: Boolean, default: true },\n background: { type: String as PropType<PageBarBackground>, default: \"glass\" },\n },\n setup(props, { slots }) {\n const { scrolled, headerHeight } = injectPageContext(\"PageHeader\")\n const element = ref<HTMLElement | null>(null)\n let observer: ResizeObserver | undefined\n onMounted(() => {\n const header = element.value\n if (!header) return\n const update = () => { headerHeight.value = header.offsetHeight }\n update()\n observer = typeof ResizeObserver !== \"undefined\" ? new ResizeObserver(update) : undefined\n observer?.observe(header, { box: \"border-box\" })\n })\n onBeforeUnmount(() => { observer?.disconnect(); headerHeight.value = undefined })\n\n return () =>\n h(\"div\", { \"ref\": element, \"class\": s.Header, \"data-background\": props.background, \"data-scrolled\": scrolled.value ? \"\" : undefined, \"data-divider\": props.divider ? \"\" : undefined }, [\n h(\"div\", { class: s.Head }, slots.default?.()),\n ])\n },\n})\n\nfunction part(name: string, tag: string, className: string) {\n return defineComponent({\n name,\n setup(_, { slots }) {\n return () => h(tag, { class: className }, slots.default?.())\n },\n })\n}\n\n/** The row of the title and the actions (React `Page.Bar`). */\nexport const PageBar = defineComponent({\n name: \"PageBar\",\n setup(_, { slots }) {\n const element = ref<HTMLElement | null>(null)\n let observer: ResizeObserver | undefined\n let children: MutationObserver | undefined\n onMounted(() => {\n const bar = element.value\n if (!bar) return\n const sides = () => bar.querySelectorAll<HTMLElement>(`:scope > .${s.Leading}, :scope > .${s.Actions}`)\n const update = () => {\n const width = Math.max(44, ...Array.from(sides(), (side) => side.offsetWidth))\n bar.style.setProperty(\"--page-bar-side-width\", `${width}px`)\n }\n observer = typeof ResizeObserver !== \"undefined\" ? new ResizeObserver(update) : undefined\n const observeSides = () => { observer?.disconnect(); sides().forEach((side) => observer?.observe(side, { box: \"border-box\" })); update() }\n observeSides()\n children = new MutationObserver(observeSides)\n children.observe(bar, { childList: true })\n })\n onBeforeUnmount(() => { observer?.disconnect(); children?.disconnect() })\n return () => h(\"div\", { ref: element, class: s.Bar }, slots.default?.())\n },\n})\n/** Navigation controls on the leading side (React `Page.Leading`). */\nexport const PageLeading = part(\"PageLeading\", \"div\", s.Leading)\n/** Title with what stands beside it, a subtitle under it on a phone (React `Page.Heading`). */\nexport const PageHeading = part(\"PageHeading\", \"div\", s.Heading)\n/** Page heading, an `<h1>` (React `Page.Title`). */\nexport const PageTitle = part(\"PageTitle\", \"h1\", s.Title)\n/** Status of the page, a flow container for badges and text (React `Page.Subtitle`). */\nexport const PageSubtitle = part(\"PageSubtitle\", \"div\", s.Subtitle)\n/** Buttons on the trailing side of the bar (React `Page.Actions`). */\nexport const PageActions = part(\"PageActions\", \"div\", s.Actions)\n\n/** The part of the page that scrolls (React `Page.Content`). */\nexport const PageContent = defineComponent({\n name: \"PageContent\",\n inheritAttrs: false,\n props: {\n /**\n * The content fills the page and scrolls inside itself, as a table does:\n * the page stops scrolling from 768px up.\n * @default false\n */\n fill: { type: Boolean, default: false },\n },\n setup(props, { attrs, slots }) {\n const { scrolled } = injectPageContext(\"PageContent\")\n\n const onScroll = (event: Event) => {\n scrolled.value = (event.currentTarget as HTMLElement).scrollTop > SCROLLED_AFTER\n }\n\n return () =>\n h(\n \"div\",\n mergeProps(\n { \"class\": s.Content, \"data-fill\": props.fill ? \"\" : undefined, onScroll },\n attrs,\n ),\n [h(\"div\", { class: s.Column }, slots.default?.())],\n )\n },\n})\n\n/** Actions that remain below the scrolling content (React `Page.Footer`). */\nexport const PageFooter = defineComponent({\n name: \"PageFooter\",\n props: { background: { type: String as PropType<PageBarBackground>, default: \"glass\" } },\n setup(props, { slots }) {\n const element = ref<HTMLElement | null>(null)\n const { footerHeight } = injectPageContext(\"PageFooter\")\n const boundary = useFloatingBoundaryRegistration()\n const setFooter = (node: unknown) => {\n element.value = node instanceof HTMLElement ? node : null\n boundary?.setFooter(node)\n }\n let observer: ResizeObserver | undefined\n onMounted(() => {\n const footer = element.value\n if (!footer) return\n const update = () => { footerHeight.value = footer.offsetHeight }\n update()\n if (typeof ResizeObserver === \"undefined\") return\n observer = new ResizeObserver(update)\n observer.observe(footer, { box: \"border-box\" })\n })\n onBeforeUnmount(() => { observer?.disconnect(); footerHeight.value = 0 })\n return () => h(\"div\", { ref: setFooter, class: s.Footer, \"data-background\": props.background }, [\n h(\"div\", { class: s.FooterContent }, slots.default?.()),\n ])\n },\n})\n\n/** Props of the Page parts: native attributes of their element. */\nexport type PageSlotProps = HTMLAttributes\n\nexport type PageFooterProps = PageSlotProps & { background?: PageBarBackground }\n"]}
1
+ {"version":3,"file":"Page.js","sourceRoot":"","sources":["../../../../src/components/Page/Page.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,CAAC,EACD,MAAM,EACN,UAAU,EACV,SAAS,EACT,eAAe,EACf,OAAO,EACP,GAAG,GAKJ,MAAM,KAAK,CAAA;AACZ,OAAO,EAAE,4BAA4B,EAAE,+BAA+B,EAAE,MAAM,0CAA0C,CAAA;AACxH,OAAO,EAAE,YAAY,EAA6C,MAAM,uBAAuB,CAAA;AAC/F,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAA;AAC7D,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A;YACR,IAAI,OAAO,cAAc,KAAK,WAAW;gBAAE,OAAM;YACjD,QAAQ,GAAG,IAAI,cAAc,CAAC,MAAM,CAAC,CAAA;YACrC,QAAQ,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,GAAG,EAAE,YAAY,EAAE,CAAC,CAAA;QACjD,CAAC,CAAC,CAAA;QACF,eAAe,CAAC,GAAG,EAAE,GAAG,QAAQ,EAAE,UAAU,EAAE,CAAC,CAAC,YAAY,CAAC,KAAK,GAAG,CAAC,CAAA,CAAC,CAAC,CAAC,CAAA;QACzE,OAAO,GAAG,EAAE,CAAC,CAAC,CAAC,KAAK,EAAE,EAAE,GAAG,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,iBAAiB,EAAE,KAAK,CAAC,UAAU,EAAE,oBAAoB,EAAE,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,EAAE,EAAE;YACzJ,CAAC,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC,aAAa,EAAE,EAAE,KAAK,CAAC,OAAO,EAAE,EAAE,CAAC;SACxD,CAAC,CAAA;IACJ,CAAC;CACF,CAAC,CAAA","sourcesContent":["import {\n defineComponent,\n h,\n inject,\n mergeProps,\n onMounted,\n onBeforeUnmount,\n provide,\n ref,\n type HTMLAttributes,\n type InjectionKey,\n type PropType,\n type Ref,\n} from \"vue\"\nimport { provideFloatingBoundaryScope, useFloatingBoundaryRegistration } from \"../../composables/useFloatingBoundary.js\"\nimport { TOOLBAR_HOST, type BarBackground, type ToolbarPlacement } from \"../Toolbar/Toolbar.js\"\nimport { observeScrollEdges } from \"../../lib/scrollEdges.js\"\nimport s from \"@plexui/styles/components/Page/Page.module.css\"\n\n// Vue port of packages/ui/src/components/Page/Page.tsx. Exports are flat\n// (`PageHeader` for `Page.Header`, ...). As in React, caller attributes are\n// applied after the page's own (`class` is merged), so they win.\n\n/** How a phone bar of the page meets the content scrolled under it; see `BarBackground`. */\nexport type PageBarBackground = BarBackground\n\nexport type PageWidth = \"full\" | \"wide\" | \"column\"\n\ntype PageContext = {\n /** Content has scrolled under the header. */\n scrolled: Ref<boolean>\n /** Content continues under the footer. */\n contentBelow: Ref<boolean>\n footerHeight: Ref<number>\n headerHeight: Ref<number | undefined>\n /** Writes the content's scroll offset to the page as `--page-scroll-y`, which a large Toolbar title follows. */\n setScrollY: (scrollY: number) => void\n /** Tells the bars that follow the scroll, such as a minimizing TabBar, the content's scroll offset. */\n notifyScroll: (scrollY: number) => void\n}\nconst PAGE_CONTEXT: InjectionKey<PageContext> = Symbol(\"Page\")\n\nfunction injectPageContext(part: string): PageContext {\n const scrolled = inject(PAGE_CONTEXT, null)\n if (!scrolled) {\n throw new Error(`${part} must be used within Page`)\n }\n return scrolled\n}\n\nconst PageComponent = defineComponent({\n name: \"Page\",\n props: {\n /**\n * Width of the column that header and content share: `\"full\"` (edge to\n * edge, for tables), `\"wide\"` (1280px, centred, for overviews) or `\"column\"`\n * (768px, centred, for settings and forms). Set `--page-width` on the page\n * for any other width.\n * @default \"full\"\n */\n width: { type: String as PropType<PageWidth>, default: \"full\" },\n /** Mobile canvas and grouped-field palette. @default \"plain\" */\n surface: { type: String as PropType<\"plain\" | \"grouped\">, default: \"plain\" },\n },\n setup(props, { slots }) {\n const boundary = provideFloatingBoundaryScope()\n let root: HTMLElement | null = null\n const setRoot = (node: unknown) => {\n root = node instanceof HTMLElement ? node : null\n boundary.setRoot(node)\n }\n // Written straight to the element: a scroll frame must not render the page again.\n const setScrollY = (scrollY: number) => root?.style.setProperty(\"--page-scroll-y\", String(Math.max(0, scrollY)))\n const scrollListeners = new Set<(scrollTop: number) => void>()\n const notifyScroll = (scrollY: number) => scrollListeners.forEach((listener) => listener(scrollY))\n const subscribeScroll = (listener: (scrollTop: number) => void) => {\n scrollListeners.add(listener)\n return () => { scrollListeners.delete(listener) }\n }\n const context = { scrolled: ref(false), contentBelow: ref(false), footerHeight: ref(0), headerHeight: ref<number>(), setScrollY, notifyScroll }\n provide(PAGE_CONTEXT, context)\n // A phone Toolbar replaces the header and footer bars; it reports its own heights.\n const toolbarTop = ref<number>()\n const toolbarBottom = ref<number>()\n provide(TOOLBAR_HOST, {\n kind: \"page\",\n scrolled: context.scrolled,\n contentBelow: context.contentBelow,\n subscribeScroll,\n setHeight: (placement: ToolbarPlacement, height: number | undefined) => { (placement === \"top\" ? toolbarTop : toolbarBottom).value = height },\n })\n return () => h(\"div\", { \"ref\": setRoot, \"class\": s.Page, \"data-width\": props.width, \"data-surface\": props.surface,\n style: {\n \"--page-footer-height\": `${context.footerHeight.value}px`,\n ...(context.headerHeight.value !== undefined ? { \"--page-header-height\": `${context.headerHeight.value}px` } : {}),\n ...(toolbarTop.value !== undefined ? { \"--page-toolbar-height\": `${toolbarTop.value}px` } : {}),\n ...(toolbarBottom.value !== undefined ? { \"--page-toolbar-bottom-height\": `${toolbarBottom.value}px` } : {}),\n } }, slots.default?.())\n },\n})\n\n/** Props of `Page`. */\nexport type PageProps = { width?: PageWidth; surface?: \"plain\" | \"grouped\" } & HTMLAttributes\n\nexport const Page = PageComponent as typeof PageComponent & { new (): { $props: PageProps } }\n\n/** The band above the content, one column with it (React `Page.Header`). */\nexport const PageHeader = defineComponent({\n name: \"PageHeader\",\n props: {\n /**\n * Shows a divider once the content has scrolled under the header: on a\n * desktop layout, and on a phone with a `\"hard\"` or `\"glass\"` background.\n * Turn it off when the content already draws a line of\n * its own at that place.\n * @default true\n */\n divider: { type: Boolean, default: true },\n /** How the bar meets the content scrolled under it on a phone. @default \"glass\" */\n background: { type: String as PropType<PageBarBackground>, default: \"glass\" },\n },\n setup(props, { slots }) {\n const { scrolled, headerHeight } = injectPageContext(\"PageHeader\")\n const element = ref<HTMLElement | null>(null)\n let observer: ResizeObserver | undefined\n onMounted(() => {\n const header = element.value\n if (!header) return\n const update = () => { headerHeight.value = header.offsetHeight }\n update()\n observer = typeof ResizeObserver !== \"undefined\" ? new ResizeObserver(update) : undefined\n observer?.observe(header, { box: \"border-box\" })\n })\n onBeforeUnmount(() => { observer?.disconnect(); headerHeight.value = undefined })\n\n return () =>\n h(\"div\", { \"ref\": element, \"class\": s.Header, \"data-background\": props.background, \"data-scrolled\": scrolled.value ? \"\" : undefined, \"data-divider\": props.divider ? \"\" : undefined }, [\n h(\"div\", { class: s.Head }, slots.default?.()),\n ])\n },\n})\n\nfunction part(name: string, tag: string, className: string) {\n return defineComponent({\n name,\n setup(_, { slots }) {\n return () => h(tag, { class: className }, slots.default?.())\n },\n })\n}\n\n/** The row of the title and the actions (React `Page.Bar`). */\nexport const PageBar = defineComponent({\n name: \"PageBar\",\n setup(_, { slots }) {\n const element = ref<HTMLElement | null>(null)\n let observer: ResizeObserver | undefined\n let children: MutationObserver | undefined\n onMounted(() => {\n const bar = element.value\n if (!bar) return\n const sides = () => bar.querySelectorAll<HTMLElement>(`:scope > .${s.Leading}, :scope > .${s.Actions}`)\n const update = () => {\n const width = Math.max(44, ...Array.from(sides(), (side) => side.offsetWidth))\n bar.style.setProperty(\"--page-bar-side-width\", `${width}px`)\n }\n observer = typeof ResizeObserver !== \"undefined\" ? new ResizeObserver(update) : undefined\n const observeSides = () => { observer?.disconnect(); sides().forEach((side) => observer?.observe(side, { box: \"border-box\" })); update() }\n observeSides()\n children = new MutationObserver(observeSides)\n children.observe(bar, { childList: true })\n })\n onBeforeUnmount(() => { observer?.disconnect(); children?.disconnect() })\n return () => h(\"div\", { ref: element, class: s.Bar }, slots.default?.())\n },\n})\n/** Navigation controls on the leading side (React `Page.Leading`). */\nexport const PageLeading = part(\"PageLeading\", \"div\", s.Leading)\n/** Title with what stands beside it, a subtitle under it on a phone (React `Page.Heading`). */\nexport const PageHeading = part(\"PageHeading\", \"div\", s.Heading)\n/** Page heading, an `<h1>` (React `Page.Title`). */\nexport const PageTitle = part(\"PageTitle\", \"h1\", s.Title)\n/** Status of the page, a flow container for badges and text (React `Page.Subtitle`). */\nexport const PageSubtitle = part(\"PageSubtitle\", \"div\", s.Subtitle)\n/** Buttons on the trailing side of the bar (React `Page.Actions`). */\nexport const PageActions = part(\"PageActions\", \"div\", s.Actions)\n\n/** The part of the page that scrolls (React `Page.Content`). */\nexport const PageContent = defineComponent({\n name: \"PageContent\",\n inheritAttrs: false,\n props: {\n /**\n * The content fills the page and scrolls inside itself, as a table does:\n * the page stops scrolling from 768px up.\n * @default false\n */\n fill: { type: Boolean, default: false },\n },\n setup(props, { attrs, slots }) {\n const { scrolled, contentBelow, setScrollY, notifyScroll } = injectPageContext(\"PageContent\")\n const element = ref<HTMLElement | null>(null)\n let stop: (() => void) | undefined\n onMounted(() => {\n if (!element.value) return\n stop = observeScrollEdges(element.value, (edges) => {\n scrolled.value = edges.scrolled\n contentBelow.value = edges.contentBelow\n })\n })\n onBeforeUnmount(() => { stop?.(); scrolled.value = false; contentBelow.value = false })\n\n const onScroll = (event: Event) => {\n const top = (event.currentTarget as HTMLElement).scrollTop\n setScrollY(top)\n notifyScroll(top)\n }\n\n return () =>\n h(\n \"div\",\n mergeProps(\n { \"ref\": element, \"class\": s.Content, \"data-fill\": props.fill ? \"\" : undefined, onScroll },\n attrs,\n ),\n [h(\"div\", { class: s.Column }, slots.default?.())],\n )\n },\n})\n\n/** Actions that remain below the scrolling content (React `Page.Footer`). */\nexport const PageFooter = defineComponent({\n name: \"PageFooter\",\n props: {\n /** How the bar meets the content scrolled under it on a phone. @default \"soft\" */\n background: { type: String as PropType<PageBarBackground>, default: \"soft\" },\n },\n setup(props, { slots }) {\n const element = ref<HTMLElement | null>(null)\n const { contentBelow, footerHeight } = injectPageContext(\"PageFooter\")\n const boundary = useFloatingBoundaryRegistration()\n const setFooter = (node: unknown) => {\n element.value = node instanceof HTMLElement ? node : null\n boundary?.setFooter(node)\n }\n let observer: ResizeObserver | undefined\n onMounted(() => {\n const footer = element.value\n if (!footer) return\n const update = () => { footerHeight.value = footer.offsetHeight }\n update()\n if (typeof ResizeObserver === \"undefined\") return\n observer = new ResizeObserver(update)\n observer.observe(footer, { box: \"border-box\" })\n })\n onBeforeUnmount(() => { observer?.disconnect(); footerHeight.value = 0 })\n return () => h(\"div\", { ref: setFooter, class: s.Footer, \"data-background\": props.background, \"data-content-below\": contentBelow.value ? \"\" : undefined }, [\n h(\"div\", { class: s.FooterContent }, slots.default?.()),\n ])\n },\n})\n\n/** Props of the Page parts: native attributes of their element. */\nexport type PageSlotProps = HTMLAttributes\n\nexport type PageFooterProps = PageSlotProps & { background?: PageBarBackground }\n"]}
@@ -0,0 +1,210 @@
1
+ import { computed, defineComponent, h, ref } from "vue";
2
+ import s from "@plexui/styles/components/PageControl/PageControl.module.css";
3
+ /**
4
+ * The size of each indicator, after the variants of the iOS 26 kit Page control (507:24679). Up to six pages
5
+ * show full size. Seven show six, and the one past them at 6px. From eight a window of full dots holds the current
6
+ * page: six at either end, otherwise five with the current one in the middle, and the two dots past each side of
7
+ * the window shrink to 6px and 4px; the rest hide.
8
+ */
9
+ export const pageControlDots = (count, current) => {
10
+ const sizes = Array.from({ length: Math.max(0, count) }, () => "hidden");
11
+ const show = (from, to, size) => {
12
+ for (let i = Math.max(0, from); i <= Math.min(sizes.length - 1, to); i++)
13
+ sizes[i] = size;
14
+ };
15
+ if (count <= 6) {
16
+ show(0, count - 1, "full");
17
+ return sizes;
18
+ }
19
+ if (count === 7) {
20
+ const start = current >= 6 ? 1 : 0;
21
+ show(0, 6, "small");
22
+ show(start, start + 5, "full");
23
+ return sizes;
24
+ }
25
+ const [from, to] = current <= 3 ? [0, 5] : current >= count - 4 ? [count - 6, count - 1] : [current - 2, current + 2];
26
+ show(from - 2, from - 2, "smaller");
27
+ show(from - 1, from - 1, "small");
28
+ show(to + 1, to + 1, "small");
29
+ show(to + 2, to + 2, "smaller");
30
+ show(from, to, "full");
31
+ return sizes;
32
+ };
33
+ const clampIndex = (index, count) => Math.min(Math.max(index, 0), Math.max(0, count - 1));
34
+ const defaultValueText = (index, count) => `Page ${index + 1} of ${count}`;
35
+ /** A drag shorter than this is a tap. */
36
+ const SCRUB_THRESHOLD = 8;
37
+ const isRtl = (element) => element.closest("[dir]")?.getAttribute("dir") === "rtl";
38
+ /** Distance between the centers of two full dots: the dot size plus the gap. */
39
+ const pitchOf = (element) => {
40
+ const styles = getComputedStyle(element);
41
+ const pitch = parseFloat(styles.getPropertyValue("--page-control-dot-size")) + parseFloat(styles.columnGap);
42
+ return Number.isFinite(pitch) && pitch > 0 ? pitch : 16;
43
+ };
44
+ const PageControlComponent = defineComponent({
45
+ name: "PageControl",
46
+ inheritAttrs: false,
47
+ props: {
48
+ /** The `id` of the page control. */
49
+ id: String,
50
+ /** The number of pages. */
51
+ count: { type: Number, required: true },
52
+ /** The controlled index of the current page, from 0. Bind with `v-model:value`. */
53
+ value: { type: Number, default: undefined },
54
+ /** The index of the page when it is initially rendered. Use when you do not need to control the page. @default 0 */
55
+ defaultValue: { type: Number, default: 0 },
56
+ /**
57
+ * The rounded background behind the indicators: `automatic` shows it while a pointer presses or scrubs,
58
+ * `prominent` always, `minimal` never and turns off scrubbing, as in iOS. @default "automatic"
59
+ */
60
+ background: { type: String, default: "automatic" },
61
+ /** The text assistive technology reads for the current page. @default (index, count) => `Page ${index + 1} of ${count}` */
62
+ valueText: { type: Function, default: defaultValueText },
63
+ /** Accessible name of the page control, when no visible label names it. @default "Pages" */
64
+ ariaLabel: String,
65
+ /** The `id` of the visible label of the page control. */
66
+ ariaLabelledby: String,
67
+ /** The `id` of the element that shows the pages. */
68
+ ariaControls: String,
69
+ },
70
+ emits: {
71
+ /** The page changed */
72
+ "update:value": (index) => typeof index === "number",
73
+ /** The page changed (React `onChange`) */
74
+ change: (index, details) => typeof index === "number" && typeof details === "object",
75
+ /** The page control gained focus */
76
+ focus: (event) => event.type === "focus",
77
+ /** The page control lost focus */
78
+ blur: (event) => event.type === "blur",
79
+ },
80
+ setup(props, { attrs, emit }) {
81
+ const internalValue = ref(props.defaultValue);
82
+ const current = computed(() => clampIndex(props.value ?? internalValue.value, props.count));
83
+ const interacting = ref(false);
84
+ let press = null;
85
+ const commit = (next, scrubbing) => {
86
+ const index = clampIndex(next, props.count);
87
+ if (index === current.value)
88
+ return;
89
+ if (props.value === undefined)
90
+ internalValue.value = index;
91
+ emit("update:value", index);
92
+ emit("change", index, { scrubbing });
93
+ };
94
+ const end = () => {
95
+ press = null;
96
+ interacting.value = false;
97
+ };
98
+ const handlePointerDown = (event) => {
99
+ const element = event.currentTarget;
100
+ if (event.button !== 0 || props.count < 1 || !(element instanceof HTMLElement))
101
+ return;
102
+ element.setPointerCapture?.(event.pointerId);
103
+ press = { pointerId: event.pointerId, pointerType: event.pointerType, startX: event.clientX, startIndex: current.value, scrubbing: false };
104
+ interacting.value = true;
105
+ };
106
+ const handlePointerMove = (event) => {
107
+ const state = press;
108
+ const element = event.currentTarget;
109
+ if (!state || state.pointerId !== event.pointerId || props.background === "minimal" || !(element instanceof HTMLElement))
110
+ return;
111
+ const direction = isRtl(element) ? -1 : 1;
112
+ const dx = (event.clientX - state.startX) * direction;
113
+ if (!state.scrubbing && Math.abs(dx) < SCRUB_THRESHOLD)
114
+ return;
115
+ state.scrubbing = true;
116
+ const rect = element.getBoundingClientRect();
117
+ const before = direction === 1 ? event.clientX < rect.left : event.clientX > rect.right;
118
+ const after = direction === 1 ? event.clientX > rect.right : event.clientX < rect.left;
119
+ if (before)
120
+ return commit(0, true);
121
+ if (after)
122
+ return commit(props.count - 1, true);
123
+ commit(state.startIndex + Math.round(dx / pitchOf(element)), true);
124
+ };
125
+ const handlePointerUp = (event) => {
126
+ const state = press;
127
+ const element = event.currentTarget;
128
+ if (!state || state.pointerId !== event.pointerId || !(element instanceof HTMLElement))
129
+ return;
130
+ end();
131
+ if (state.scrubbing)
132
+ return;
133
+ const dots = [...element.querySelectorAll("[data-index]")].filter((dot) => dot.dataset.size !== "hidden");
134
+ const centerOf = (dot) => {
135
+ const rect = dot.getBoundingClientRect();
136
+ return rect.left + rect.width / 2;
137
+ };
138
+ if (state.pointerType === "mouse" || state.pointerType === "pen") {
139
+ const nearest = dots.reduce((best, dot) => !best || Math.abs(centerOf(dot) - event.clientX) < Math.abs(centerOf(best) - event.clientX) ? dot : best, undefined);
140
+ if (nearest)
141
+ commit(Number(nearest.dataset.index), false);
142
+ return;
143
+ }
144
+ const currentDot = dots.find((dot) => Number(dot.dataset.index) === current.value);
145
+ if (!currentDot)
146
+ return;
147
+ const later = isRtl(element) ? event.clientX < centerOf(currentDot) : event.clientX > centerOf(currentDot);
148
+ commit(current.value + (later ? 1 : -1), false);
149
+ };
150
+ const handleKeyDown = (event) => {
151
+ const element = event.currentTarget;
152
+ if (event.altKey || event.ctrlKey || event.metaKey || !(element instanceof HTMLElement))
153
+ return;
154
+ const forward = isRtl(element) ? -1 : 1;
155
+ const keys = {
156
+ ArrowRight: current.value + forward,
157
+ ArrowLeft: current.value - forward,
158
+ ArrowUp: current.value + 1,
159
+ ArrowDown: current.value - 1,
160
+ Home: 0,
161
+ End: props.count - 1,
162
+ };
163
+ const next = keys[event.key];
164
+ if (next === undefined)
165
+ return;
166
+ event.preventDefault();
167
+ commit(next, false);
168
+ };
169
+ return () => h("div", {
170
+ ...attrs,
171
+ "id": props.id,
172
+ "role": "slider",
173
+ "tabindex": 0,
174
+ "aria-orientation": "horizontal",
175
+ "aria-valuemin": 1,
176
+ "aria-valuemax": Math.max(1, props.count),
177
+ "aria-valuenow": current.value + 1,
178
+ "aria-valuetext": props.valueText(current.value, props.count),
179
+ "aria-label": props.ariaLabel ?? (props.ariaLabelledby ? undefined : "Pages"),
180
+ "aria-labelledby": props.ariaLabelledby,
181
+ "aria-controls": props.ariaControls,
182
+ "class": [s.PageControl, attrs.class],
183
+ "data-background": props.background,
184
+ "data-interacting": interacting.value ? "" : undefined,
185
+ "onPointerdown": handlePointerDown,
186
+ "onPointermove": handlePointerMove,
187
+ "onPointerup": handlePointerUp,
188
+ "onPointercancel": end,
189
+ "onLostpointercapture": end,
190
+ "onKeydown": handleKeyDown,
191
+ "onFocus": (event) => emit("focus", event),
192
+ "onBlur": (event) => emit("blur", event),
193
+ }, pageControlDots(props.count, current.value).map((size, index) => h("span", {
194
+ "key": index,
195
+ "class": s.Dot,
196
+ "aria-hidden": "true",
197
+ "data-index": index,
198
+ "data-size": size,
199
+ "data-current": index === current.value ? "" : undefined,
200
+ })));
201
+ },
202
+ });
203
+ /**
204
+ * A row of dots, one for each page, the current one solid, as the iOS 26 page control. Tapping the leading or
205
+ * trailing side of the current dot shows the previous or next page; a mouse or pen picks a dot. Dragging across
206
+ * scrubs page by page, and past either end goes to the first or last page. It is a slider for assistive
207
+ * technology: Left and Right (or Up and Down) move one page, Home and End go to the first and last.
208
+ */
209
+ export const PageControl = PageControlComponent;
210
+ //# sourceMappingURL=PageControl.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PageControl.js","sourceRoot":"","sources":["../../../../src/components/PageControl/PageControl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,CAAC,EAAE,GAAG,EAAiB,MAAM,KAAK,CAAA;AACtE,OAAO,CAAC,MAAM,8DAA8D,CAAA;AAc5E;;;;;GAKG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,KAAa,EAAE,OAAe,EAAwB,EAAE;IACtF,MAAM,KAAK,GAAyB,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,CAAA;IAC9F,MAAM,IAAI,GAAG,CAAC,IAAY,EAAE,EAAU,EAAE,IAAwB,EAAE,EAAE;QAClE,KAAK,IAAI,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,EAAE,CAAC,IAAI,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE;YAAE,KAAK,CAAC,CAAC,CAAC,G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B,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC;YACtD,QAAQ,EAAE,CAAC,KAAiB,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC;SACrD,EAAE,eAAe,CAAC,KAAK,CAAC,KAAK,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,EAAE;YAC5E,KAAK,EAAE,KAAK;YACZ,OAAO,EAAE,CAAC,CAAC,GAAG;YACd,aAAa,EAAE,MAAM;YACrB,YAAY,EAAE,KAAK;YACnB,WAAW,EAAE,IAAI;YACjB,cAAc,EAAE,KAAK,KAAK,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS;SACzD,CAAC,CAAC,CAAC,CAAA;IACN,CAAC;CACF,CAAC,CAAA;AAOF;;;;;GAKG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,oBAAoB,CAAA","sourcesContent":["import { computed, defineComponent, h, ref, type PropType } from \"vue\"\nimport s from \"@plexui/styles/components/PageControl/PageControl.module.css\"\n\n// Vue port of packages/ui/src/components/PageControl/PageControl.tsx: the same DOM (a slider with one dot for\n// each page), the same window of full and shrinking dots, taps, scrubbing and keys. React's `value` + `onChange`\n// become `value` + `update:value` (`v-model:value`) and `change`, which also receives the details.\n\n/** How an indicator shows: full size, one of the two shrinking sizes past the window, or hidden. */\nexport type PageControlDotSize = \"full\" | \"small\" | \"smaller\" | \"hidden\"\n\nexport type PageControlChangeDetails = {\n /** The change came from scrubbing: show the page without the scrolling animation, as the HIG asks. */\n scrubbing: boolean\n}\n\n/**\n * The size of each indicator, after the variants of the iOS 26 kit Page control (507:24679). Up to six pages\n * show full size. Seven show six, and the one past them at 6px. From eight a window of full dots holds the current\n * page: six at either end, otherwise five with the current one in the middle, and the two dots past each side of\n * the window shrink to 6px and 4px; the rest hide.\n */\nexport const pageControlDots = (count: number, current: number): PageControlDotSize[] => {\n const sizes: PageControlDotSize[] = Array.from({ length: Math.max(0, count) }, () => \"hidden\")\n const show = (from: number, to: number, size: PageControlDotSize) => {\n for (let i = Math.max(0, from); i <= Math.min(sizes.length - 1, to); i++) sizes[i] = size\n }\n if (count <= 6) {\n show(0, count - 1, \"full\")\n return sizes\n }\n if (count === 7) {\n const start = current >= 6 ? 1 : 0\n show(0, 6, \"small\")\n show(start, start + 5, \"full\")\n return sizes\n }\n const [from, to] = current <= 3 ? [0, 5] : current >= count - 4 ? [count - 6, count - 1] : [current - 2, current + 2]\n show(from - 2, from - 2, \"smaller\")\n show(from - 1, from - 1, \"small\")\n show(to + 1, to + 1, \"small\")\n show(to + 2, to + 2, \"smaller\")\n show(from, to, \"full\")\n return sizes\n}\n\nconst clampIndex = (index: number, count: number) => Math.min(Math.max(index, 0), Math.max(0, count - 1))\nconst defaultValueText = (index: number, count: number) => `Page ${index + 1} of ${count}`\n/** A drag shorter than this is a tap. */\nconst SCRUB_THRESHOLD = 8\n\ntype Press = { pointerId: number; pointerType: string; startX: number; startIndex: number; scrubbing: boolean }\n\nconst isRtl = (element: HTMLElement) => element.closest(\"[dir]\")?.getAttribute(\"dir\") === \"rtl\"\n\n/** Distance between the centers of two full dots: the dot size plus the gap. */\nconst pitchOf = (element: HTMLElement) => {\n const styles = getComputedStyle(element)\n const pitch = parseFloat(styles.getPropertyValue(\"--page-control-dot-size\")) + parseFloat(styles.columnGap)\n return Number.isFinite(pitch) && pitch > 0 ? pitch : 16\n}\n\nconst PageControlComponent = defineComponent({\n name: \"PageControl\",\n inheritAttrs: false,\n props: {\n /** The `id` of the page control. */\n id: String,\n /** The number of pages. */\n count: { type: Number, required: true },\n /** The controlled index of the current page, from 0. Bind with `v-model:value`. */\n value: { type: Number, default: undefined },\n /** The index of the page when it is initially rendered. Use when you do not need to control the page. @default 0 */\n defaultValue: { type: Number, default: 0 },\n /**\n * The rounded background behind the indicators: `automatic` shows it while a pointer presses or scrubs,\n * `prominent` always, `minimal` never and turns off scrubbing, as in iOS. @default \"automatic\"\n */\n background: { type: String as PropType<\"automatic\" | \"prominent\" | \"minimal\">, default: \"automatic\" },\n /** The text assistive technology reads for the current page. @default (index, count) => `Page ${index + 1} of ${count}` */\n valueText: { type: Function as PropType<(index: number, count: number) => string>, default: defaultValueText },\n /** Accessible name of the page control, when no visible label names it. @default \"Pages\" */\n ariaLabel: String,\n /** The `id` of the visible label of the page control. */\n ariaLabelledby: String,\n /** The `id` of the element that shows the pages. */\n ariaControls: String,\n },\n emits: {\n /** The page changed */\n \"update:value\": (index: number) => typeof index === \"number\",\n /** The page changed (React `onChange`) */\n change: (index: number, details: PageControlChangeDetails) => typeof index === \"number\" && typeof details === \"object\",\n /** The page control gained focus */\n focus: (event: FocusEvent) => event.type === \"focus\",\n /** The page control lost focus */\n blur: (event: FocusEvent) => event.type === \"blur\",\n },\n setup(props, { attrs, emit }) {\n const internalValue = ref(props.defaultValue)\n const current = computed(() => clampIndex(props.value ?? internalValue.value, props.count))\n const interacting = ref(false)\n let press: Press | null = null\n\n const commit = (next: number, scrubbing: boolean) => {\n const index = clampIndex(next, props.count)\n if (index === current.value) return\n if (props.value === undefined) internalValue.value = index\n emit(\"update:value\", index)\n emit(\"change\", index, { scrubbing })\n }\n\n const end = () => {\n press = null\n interacting.value = false\n }\n\n const handlePointerDown = (event: PointerEvent) => {\n const element = event.currentTarget\n if (event.button !== 0 || props.count < 1 || !(element instanceof HTMLElement)) return\n element.setPointerCapture?.(event.pointerId)\n press = { pointerId: event.pointerId, pointerType: event.pointerType, startX: event.clientX, startIndex: current.value, scrubbing: false }\n interacting.value = true\n }\n\n const handlePointerMove = (event: PointerEvent) => {\n const state = press\n const element = event.currentTarget\n if (!state || state.pointerId !== event.pointerId || props.background === \"minimal\" || !(element instanceof HTMLElement)) return\n const direction = isRtl(element) ? -1 : 1\n const dx = (event.clientX - state.startX) * direction\n if (!state.scrubbing && Math.abs(dx) < SCRUB_THRESHOLD) return\n state.scrubbing = true\n const rect = element.getBoundingClientRect()\n const before = direction === 1 ? event.clientX < rect.left : event.clientX > rect.right\n const after = direction === 1 ? event.clientX > rect.right : event.clientX < rect.left\n if (before) return commit(0, true)\n if (after) return commit(props.count - 1, true)\n commit(state.startIndex + Math.round(dx / pitchOf(element)), true)\n }\n\n const handlePointerUp = (event: PointerEvent) => {\n const state = press\n const element = event.currentTarget\n if (!state || state.pointerId !== event.pointerId || !(element instanceof HTMLElement)) return\n end()\n if (state.scrubbing) return\n const dots = [...element.querySelectorAll<HTMLElement>(\"[data-index]\")].filter((dot) => dot.dataset.size !== \"hidden\")\n const centerOf = (dot: HTMLElement) => {\n const rect = dot.getBoundingClientRect()\n return rect.left + rect.width / 2\n }\n if (state.pointerType === \"mouse\" || state.pointerType === \"pen\") {\n const nearest = dots.reduce<HTMLElement | undefined>((best, dot) =>\n !best || Math.abs(centerOf(dot) - event.clientX) < Math.abs(centerOf(best) - event.clientX) ? dot : best, undefined)\n if (nearest) commit(Number(nearest.dataset.index), false)\n return\n }\n const currentDot = dots.find((dot) => Number(dot.dataset.index) === current.value)\n if (!currentDot) return\n const later = isRtl(element) ? event.clientX < centerOf(currentDot) : event.clientX > centerOf(currentDot)\n commit(current.value + (later ? 1 : -1), false)\n }\n\n const handleKeyDown = (event: KeyboardEvent) => {\n const element = event.currentTarget\n if (event.altKey || event.ctrlKey || event.metaKey || !(element instanceof HTMLElement)) return\n const forward = isRtl(element) ? -1 : 1\n const keys: Record<string, number> = {\n ArrowRight: current.value + forward,\n ArrowLeft: current.value - forward,\n ArrowUp: current.value + 1,\n ArrowDown: current.value - 1,\n Home: 0,\n End: props.count - 1,\n }\n const next = keys[event.key]\n if (next === undefined) return\n event.preventDefault()\n commit(next, false)\n }\n\n return () => h(\"div\", {\n ...attrs,\n \"id\": props.id,\n \"role\": \"slider\",\n \"tabindex\": 0,\n \"aria-orientation\": \"horizontal\",\n \"aria-valuemin\": 1,\n \"aria-valuemax\": Math.max(1, props.count),\n \"aria-valuenow\": current.value + 1,\n \"aria-valuetext\": props.valueText(current.value, props.count),\n \"aria-label\": props.ariaLabel ?? (props.ariaLabelledby ? undefined : \"Pages\"),\n \"aria-labelledby\": props.ariaLabelledby,\n \"aria-controls\": props.ariaControls,\n \"class\": [s.PageControl, attrs.class],\n \"data-background\": props.background,\n \"data-interacting\": interacting.value ? \"\" : undefined,\n \"onPointerdown\": handlePointerDown,\n \"onPointermove\": handlePointerMove,\n \"onPointerup\": handlePointerUp,\n \"onPointercancel\": end,\n \"onLostpointercapture\": end,\n \"onKeydown\": handleKeyDown,\n \"onFocus\": (event: FocusEvent) => emit(\"focus\", event),\n \"onBlur\": (event: FocusEvent) => emit(\"blur\", event),\n }, pageControlDots(props.count, current.value).map((size, index) => h(\"span\", {\n \"key\": index,\n \"class\": s.Dot,\n \"aria-hidden\": \"true\",\n \"data-index\": index,\n \"data-size\": size,\n \"data-current\": index === current.value ? \"\" : undefined,\n })))\n },\n})\n\ntype PageControlOwnProps = InstanceType<typeof PageControlComponent>[\"$props\"]\n\n/** PageControl props. */\nexport type PageControlProps = PageControlOwnProps\n\n/**\n * A row of dots, one for each page, the current one solid, as the iOS 26 page control. Tapping the leading or\n * trailing side of the current dot shows the previous or next page; a mouse or pen picks a dot. Dragging across\n * scrubs page by page, and past either end goes to the first or last page. It is a slider for assistive\n * technology: Left and Right (or Up and Down) move one page, Home and End go to the first and last.\n */\nexport const PageControl = PageControlComponent\n"]}
@@ -0,0 +1,2 @@
1
+ export { PageControl, pageControlDots } from "./PageControl.js";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/PageControl/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,eAAe,EAAiF,MAAM,kBAAkB,CAAA","sourcesContent":["export { PageControl, pageControlDots, type PageControlChangeDetails, type PageControlDotSize, type PageControlProps } from \"./PageControl.js\"\n"]}
@@ -0,0 +1,50 @@
1
+ import clsx from "clsx";
2
+ import { computed, defineComponent, h, inject, onBeforeUnmount, onMounted, provide, ref, shallowRef, } from "vue";
3
+ import s from "@plexui/styles/components/PhoneLayout/PhoneLayout.module.css";
4
+ import { PHONE_MEDIA } from "../../lib/phoneLayout.js";
5
+ /** Provided inside a PhoneLayout and a Dialog. */
6
+ export const PHONE_LAYOUT = Symbol("PhoneLayout");
7
+ /**
8
+ * Lays out what it holds as on a phone at any window width, such as a phone frame on a desktop page: components take
9
+ * their phone presentation inside it, and a Dialog opened inside it covers the box instead of the window.
10
+ */
11
+ export const PhoneLayout = defineComponent({
12
+ name: "PhoneLayout",
13
+ inheritAttrs: false,
14
+ setup(_props, { slots, attrs }) {
15
+ const container = shallowRef(null);
16
+ provide(PHONE_LAYOUT, { container, phone: ref(true) });
17
+ return () => h("div", { ...attrs, ref: container, class: clsx(s.PhoneLayout, attrs.class), "data-plex-layout": "phone" }, slots.default?.());
18
+ },
19
+ });
20
+ /**
21
+ * Whether components here are laid out as on a phone: inside a PhoneLayout (or a Dialog with `layout="phone"`), or
22
+ * in a window 767px wide or narrower. The server answers false outside a PhoneLayout.
23
+ */
24
+ export const usePhoneLayout = () => {
25
+ const scope = inject(PHONE_LAYOUT, null);
26
+ const narrow = ref(false);
27
+ let query = null;
28
+ const update = () => { narrow.value = query?.matches ?? false; };
29
+ onMounted(() => {
30
+ if (typeof window.matchMedia !== "function")
31
+ return;
32
+ query = window.matchMedia(PHONE_MEDIA);
33
+ update();
34
+ // Safari before 14 has only the older listener methods
35
+ if (typeof query.addEventListener === "function")
36
+ query.addEventListener("change", update);
37
+ else
38
+ query.addListener(update);
39
+ });
40
+ onBeforeUnmount(() => {
41
+ if (!query)
42
+ return;
43
+ if (typeof query.removeEventListener === "function")
44
+ query.removeEventListener("change", update);
45
+ else
46
+ query.removeListener(update);
47
+ });
48
+ return computed(() => !!scope?.phone.value || narrow.value);
49
+ };
50
+ //# sourceMappingURL=PhoneLayout.js.map
@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AAC,CAAA;IACzB,IAAI,KAAK,GAA0B,IAAI,CAAA;IACvC,MAAM,MAAM,GAAG,GAAG,EAAE,GAAG,MAAM,CAAC,KAAK,GAAG,KAAK,EAAE,OAAO,IAAI,KAAK,CAAA,CAAC,CAAC,CAAA;IAC/D,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,OAAO,MAAM,CAAC,UAAU,KAAK,UAAU;YAAE,OAAM;QACnD,KAAK,GAAG,MAAM,CAAC,UAAU,CAAC,WAAW,CAAC,CAAA;QACtC,MAAM,EAAE,CAAA;QACR,uDAAuD;QACvD,IAAI,OAAO,KAAK,CAAC,gBAAgB,KAAK,UAAU;YAAE,KAAK,CAAC,gBAAgB,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAA;;YACrF,KAAK,CAAC,WAAW,CAAC,MAAM,CAAC,CAAA;IAChC,CAAC,CAAC,CAAA;IACF,eAAe,CAAC,GAAG,EAAE;QACnB,IAAI,CAAC,KAAK;YAAE,OAAM;QAClB,IAAI,OAAO,KAAK,CAAC,mBAAmB,KAAK,UAAU;YAAE,KAAK,CAAC,mBAAmB,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAA;;YAC3F,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,CAAA;IACnC,CAAC,CAAC,CAAA;IACF,OAAO,QAAQ,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,KAAK,EAAE,KAAK,CAAC,KAAK,IAAI,MAAM,CAAC,KAAK,CAAC,CAAA;AAC7D,CAAC,CAAA","sourcesContent":["import clsx from \"clsx\"\nimport {\n computed,\n defineComponent,\n h,\n inject,\n onBeforeUnmount,\n onMounted,\n provide,\n ref,\n shallowRef,\n type ComputedRef,\n type InjectionKey,\n type Ref,\n} from \"vue\"\nimport s from \"@plexui/styles/components/PhoneLayout/PhoneLayout.module.css\"\nimport { PHONE_MEDIA } from \"../../lib/phoneLayout.js\"\n\nexport type PhoneLayoutValue = {\n /** Where dialogs inside the layout portal to: the PhoneLayout box, or null for the document body. */\n container: Ref<HTMLElement | null>\n /** Whether what is inside is laid out as on a phone: always inside a PhoneLayout, as its `layout` says in a Dialog. */\n phone: Readonly<Ref<boolean>>\n}\n\n/** Provided inside a PhoneLayout and a Dialog. */\nexport const PHONE_LAYOUT: InjectionKey<PhoneLayoutValue> = Symbol(\"PhoneLayout\")\n\n/**\n * Lays out what it holds as on a phone at any window width, such as a phone frame on a desktop page: components take\n * their phone presentation inside it, and a Dialog opened inside it covers the box instead of the window.\n */\nexport const PhoneLayout = defineComponent({\n name: \"PhoneLayout\",\n inheritAttrs: false,\n setup(_props, { slots, attrs }) {\n const container = shallowRef<HTMLElement | null>(null)\n provide(PHONE_LAYOUT, { container, phone: ref(true) })\n return () =>\n h(\n \"div\",\n { ...attrs, ref: container, class: clsx(s.PhoneLayout, attrs.class as string | undefined), \"data-plex-layout\": \"phone\" },\n slots.default?.(),\n )\n },\n})\n\n/**\n * Whether components here are laid out as on a phone: inside a PhoneLayout (or a Dialog with `layout=\"phone\"`), or\n * in a window 767px wide or narrower. The server answers false outside a PhoneLayout.\n */\nexport const usePhoneLayout = (): ComputedRef<boolean> => {\n const scope = inject(PHONE_LAYOUT, null)\n const narrow = ref(false)\n let query: MediaQueryList | null = null\n const update = () => { narrow.value = query?.matches ?? false }\n onMounted(() => {\n if (typeof window.matchMedia !== \"function\") return\n query = window.matchMedia(PHONE_MEDIA)\n update()\n // Safari before 14 has only the older listener methods\n if (typeof query.addEventListener === \"function\") query.addEventListener(\"change\", update)\n else query.addListener(update)\n })\n onBeforeUnmount(() => {\n if (!query) return\n if (typeof query.removeEventListener === \"function\") query.removeEventListener(\"change\", update)\n else query.removeListener(update)\n })\n return computed(() => !!scope?.phone.value || narrow.value)\n}\n"]}
@@ -0,0 +1,2 @@
1
+ export { PHONE_LAYOUT, PhoneLayout, usePhoneLayout } from "./PhoneLayout.js";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/PhoneLayout/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,cAAc,EAAyB,MAAM,kBAAkB,CAAA","sourcesContent":["export { PHONE_LAYOUT, PhoneLayout, usePhoneLayout, type PhoneLayoutValue } from \"./PhoneLayout.js\"\n"]}
@@ -1,6 +1,7 @@
1
1
  import { computed, createCommentVNode, defineComponent, h, markRaw, nextTick, onBeforeUnmount, onMounted, provide, ref, shallowRef, watch, watchPostEffect, } from "vue";
2
2
  import { PopoverAnchor as RekaPopoverAnchor, PopoverContent as RekaPopoverContent, PopoverPortal as RekaPopoverPortal, PopoverRoot as RekaPopoverRoot, injectPopoverRootContext, useForwardExpose, useId, } from "reka-ui";
3
3
  import { useEscCloseStack } from "../../composables/useEscCloseStack.js";
4
+ import { provideFieldColumns, provideFieldRow } from "../../lib/fieldRow.js";
4
5
  import { dataAttributes, focusableElements, keepMovedFocus, preventDefaultHandler, toCssVariables } from "../../lib/helpers.js";
5
6
  import { TransitionGroup } from "../Transition/index.js";
6
7
  import { overlayTiming } from "../Transition/shared.js";
@@ -243,7 +244,7 @@ const PopoverContentImpl = defineComponent({
243
244
  return;
244
245
  pressedOutside = true;
245
246
  setOpen(false);
246
- });
247
+ }, () => contentRef.value);
247
248
  const handleCloseAutoFocus = (event) => {
248
249
  if (showOnHover.value || pressedOutside)
249
250
  event.preventDefault();
@@ -418,6 +419,9 @@ export const PopoverContent = defineComponent({
418
419
  props: contentProps,
419
420
  setup(props, { slots, attrs }) {
420
421
  const { open, showOnHover, setOpen } = usePopoverContext();
422
+ // A popup opened from a Field row is not that row: its own controls keep their usual shape and menus
423
+ provideFieldRow(() => false);
424
+ provideFieldColumns(() => false);
421
425
  useEscCloseStack(open, () => {
422
426
  setOpen(false);
423
427
  });