viewkitjs 0.32.0 → 0.34.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 (285) hide show
  1. package/CHANGELOG.md +98 -0
  2. package/fields/dist/index.d.ts +1 -1
  3. package/fields/dist/index.js +1 -1
  4. package/fields/dist/query/evaluate.d.ts +7 -0
  5. package/fields/dist/query/exact-number.d.ts +8 -2
  6. package/fields/dist/query/exact-number.js +14 -1
  7. package/fields/dist/query/sort.js +13 -10
  8. package/fields/dist/registry.js +5 -1
  9. package/fields/dist/types.d.ts +4 -1
  10. package/fields/dist/zod.d.ts +5 -0
  11. package/fields/dist/zod.js +10 -1
  12. package/fields/docs/guides/contact-values.md +12 -0
  13. package/fields/docs/guides/field-types.md +1 -1
  14. package/fields/docs/guides/queries.md +3 -1
  15. package/fields/docs/reference/fields.md +1 -0
  16. package/package.json +1 -1
  17. package/postgres/dist/check.js +4 -1
  18. package/postgres/dist/definitions/formula-forms.js +3 -1
  19. package/postgres/dist/definitions/money.js +2 -1
  20. package/postgres/dist/page.js +6 -3
  21. package/postgres/dist/rules.d.ts +15 -1
  22. package/postgres/dist/rules.js +16 -0
  23. package/postgres/dist/sort.js +7 -2
  24. package/postgres/docs/guides/definitions.md +1 -1
  25. package/postgres/docs/guides/field-map.md +1 -1
  26. package/postgres/docs/reference/definitions.md +1 -1
  27. package/postgres/docs/reference/postgres.md +1 -1
  28. package/views/dist/atoms/ToolbarButton.d.ts +1 -1
  29. package/views/dist/atoms/ToolbarButton.js +4 -3
  30. package/views/dist/atoms/frame-parts.d.ts +6 -0
  31. package/views/dist/atoms/frame-parts.js +15 -0
  32. package/views/dist/atoms/types.d.ts +16 -7
  33. package/views/dist/cells/cell-title.d.ts +3 -1
  34. package/views/dist/cells/cell-title.js +2 -2
  35. package/views/dist/cells/cell-values.js +2 -2
  36. package/views/dist/contract.d.ts +46 -11
  37. package/views/dist/contract.js +157 -0
  38. package/views/dist/controls/alert/alert.js +2 -1
  39. package/views/dist/controls/alert-dialog/alert-dialog.js +3 -2
  40. package/views/dist/controls/bulk-bar/bulk-bar.js +25 -22
  41. package/views/dist/controls/button/map-button.js +2 -0
  42. package/views/dist/controls/checkbox/checkbox.d.ts +3 -2
  43. package/views/dist/controls/checkbox/checkbox.js +2 -2
  44. package/views/dist/controls/compound-editor/compound-editor.d.ts +1 -1
  45. package/views/dist/controls/compound-editor/name-parts.js +4 -4
  46. package/views/dist/controls/compound-editor/place-parts.js +19 -19
  47. package/views/dist/controls/compound-editor/range-parts.js +14 -14
  48. package/views/dist/controls/compound-editor/row.d.ts +3 -1
  49. package/views/dist/controls/compound-editor/row.js +2 -2
  50. package/views/dist/controls/controls.d.ts +4 -0
  51. package/views/dist/controls/controls.js +4 -0
  52. package/views/dist/controls/customize/customize.js +43 -39
  53. package/views/dist/controls/customize/map-customize-body.d.ts +2 -0
  54. package/views/dist/controls/customize/map-customize-body.js +7 -2
  55. package/views/dist/controls/date-editor/date-days.js +2 -2
  56. package/views/dist/controls/date-editor/date-editor.d.ts +3 -0
  57. package/views/dist/controls/date-editor/date-editor.js +27 -21
  58. package/views/dist/controls/date-editor/date-parts.js +6 -6
  59. package/views/dist/controls/date-editor/map-calendar.js +3 -1
  60. package/views/dist/controls/date-editor/map-date-body.d.ts +1 -1
  61. package/views/dist/controls/date-editor/map-date-body.js +7 -3
  62. package/views/dist/controls/date-editor.css +2 -2
  63. package/views/dist/controls/field/field.d.ts +3 -0
  64. package/views/dist/controls/field/field.js +6 -6
  65. package/views/dist/controls/filter-editor/block.d.ts +2 -2
  66. package/views/dist/controls/filter-editor/block.js +5 -5
  67. package/views/dist/controls/filter-editor/filter-editor.js +31 -33
  68. package/views/dist/controls/filter-editor/how.d.ts +3 -1
  69. package/views/dist/controls/filter-editor/map-filter-body.d.ts +3 -0
  70. package/views/dist/controls/filter-editor/map-filter-body.js +11 -4
  71. package/views/dist/controls/filter-editor/map-rules.js +1 -1
  72. package/views/dist/controls/filter-editor/parts.d.ts +3 -1
  73. package/views/dist/controls/filter-editor/parts.js +8 -6
  74. package/views/dist/controls/group-editor/group-editor.js +17 -14
  75. package/views/dist/controls/group-editor/map-group-body.d.ts +1 -0
  76. package/views/dist/controls/group-editor/map-group-body.js +5 -1
  77. package/views/dist/controls/index.d.ts +2 -0
  78. package/views/dist/controls/index.js +1 -0
  79. package/views/dist/controls/input/input.js +4 -3
  80. package/views/dist/controls/input/map-input.js +2 -0
  81. package/views/dist/controls/internal/editor-parts.js +1 -1
  82. package/views/dist/controls/internal/head-button.d.ts +9 -0
  83. package/views/dist/controls/internal/head-button.js +13 -0
  84. package/views/dist/controls/internal/map-panel-controls.d.ts +8 -0
  85. package/views/dist/controls/internal/map-panel-controls.js +20 -0
  86. package/views/dist/controls/internal/panel-controls.d.ts +58 -0
  87. package/views/dist/controls/internal/panel-controls.js +240 -0
  88. package/views/dist/controls/internal/part-slot.d.ts +12 -0
  89. package/views/dist/controls/internal/part-slot.js +5 -0
  90. package/views/dist/controls/links-editor/links-editor.d.ts +1 -1
  91. package/views/dist/controls/links-editor/links-editor.js +27 -27
  92. package/views/dist/controls/menu/map-menu.d.ts +2 -2
  93. package/views/dist/controls/menu/map-menu.js +15 -12
  94. package/views/dist/controls/menu/menu.d.ts +3 -0
  95. package/views/dist/controls/menu/menu.js +5 -5
  96. package/views/dist/controls/menu-list/menu-list.d.ts +14 -4
  97. package/views/dist/controls/menu-list/menu-list.js +23 -22
  98. package/views/dist/controls/modal/modal.js +5 -3
  99. package/views/dist/controls/notice/notice.d.ts +3 -1
  100. package/views/dist/controls/notice/notice.js +2 -2
  101. package/views/dist/controls/number-editor/map-number-body.js +5 -1
  102. package/views/dist/controls/number-editor/number-editor.d.ts +1 -1
  103. package/views/dist/controls/number-editor/number-editor.js +16 -16
  104. package/views/dist/controls/number-field/number-field.js +5 -3
  105. package/views/dist/controls/pane/map-pane.d.ts +3 -0
  106. package/views/dist/controls/pane/map-pane.js +5 -0
  107. package/views/dist/controls/pane/pane.d.ts +4 -2
  108. package/views/dist/controls/pane/pane.js +4 -4
  109. package/views/dist/controls/picker/map-fields-body.js +25 -1
  110. package/views/dist/controls/picker/picker.d.ts +2 -0
  111. package/views/dist/controls/picker/picker.js +37 -36
  112. package/views/dist/controls/picker/rows.d.ts +4 -0
  113. package/views/dist/controls/picker.css +10 -1
  114. package/views/dist/controls/popover/map-popover.d.ts +1 -1
  115. package/views/dist/controls/popover/map-popover.js +4 -2
  116. package/views/dist/controls/quick-filters/map-quick-filters-body.d.ts +2 -1
  117. package/views/dist/controls/quick-filters/map-quick-filters-body.js +7 -3
  118. package/views/dist/controls/quick-filters/quick-filters.js +8 -6
  119. package/views/dist/controls/radio/radio.d.ts +3 -0
  120. package/views/dist/controls/radio/radio.js +4 -3
  121. package/views/dist/controls/select/map-select.d.ts +3 -0
  122. package/views/dist/controls/select/map-select.js +8 -0
  123. package/views/dist/controls/select/select.d.ts +3 -0
  124. package/views/dist/controls/select/select.js +3 -3
  125. package/views/dist/controls/setting-row/looks.js +5 -5
  126. package/views/dist/controls/setting-row/setting-row.d.ts +3 -1
  127. package/views/dist/controls/setting-row/setting-row.js +3 -1
  128. package/views/dist/controls/setting-row.css +3 -2
  129. package/views/dist/controls/sheet/bottom-sheet.d.ts +8 -2
  130. package/views/dist/controls/sheet/bottom-sheet.js +4 -4
  131. package/views/dist/controls/sheet/map-sheet.js +1 -1
  132. package/views/dist/controls/sort-editor/map-sort-body.d.ts +1 -0
  133. package/views/dist/controls/sort-editor/map-sort-body.js +8 -4
  134. package/views/dist/controls/sort-editor/sort-editor.js +24 -26
  135. package/views/dist/controls/sort-editor.css +5 -0
  136. package/views/dist/controls/text-editor/map-text-body.js +5 -1
  137. package/views/dist/controls/text-editor/text-editor.d.ts +1 -1
  138. package/views/dist/controls/text-editor/text-editor.js +11 -10
  139. package/views/dist/controls/toolbar/toolbar.d.ts +4 -2
  140. package/views/dist/controls/toolbar/toolbar.js +2 -2
  141. package/views/dist/controls/toolbar-button/atom-toolbar-button.d.ts +3 -3
  142. package/views/dist/controls/toolbar-button/atom-toolbar-button.js +7 -6
  143. package/views/dist/controls/values-editor/values-editor.d.ts +1 -1
  144. package/views/dist/controls/values-editor/values-editor.js +22 -22
  145. package/views/dist/controls/views-list/map-view-menu.d.ts +3 -2
  146. package/views/dist/controls/views-list/map-view-menu.js +7 -3
  147. package/views/dist/controls/views-list/map-views-list-body.d.ts +2 -1
  148. package/views/dist/controls/views-list/map-views-list-body.js +6 -5
  149. package/views/dist/controls/views-list/view-menu.js +9 -10
  150. package/views/dist/controls/views-list/views-list.js +6 -6
  151. package/views/dist/editors/EditorPanel.js +4 -4
  152. package/views/dist/field-row/FieldRow.js +13 -0
  153. package/views/dist/fields/money.d.ts +5 -2
  154. package/views/dist/fields/money.js +14 -2
  155. package/views/dist/grid/chrome/GridTable.js +4 -1
  156. package/views/dist/grid/chrome/cell-clipboard.d.ts +4 -2
  157. package/views/dist/grid/chrome/cell-clipboard.js +2 -2
  158. package/views/dist/grid/chrome/cells.js +3 -1
  159. package/views/dist/grid/chrome/grid-row-menu-items.js +1 -1
  160. package/views/dist/grid/chrome/useGridKeyboard.d.ts +4 -1
  161. package/views/dist/grid/chrome/useGridKeyboard.js +29 -6
  162. package/views/dist/grid/chrome/useGridTableInteractionModel.js +9 -2
  163. package/views/dist/grid/core/clipboard-model.d.ts +3 -1
  164. package/views/dist/grid/core/clipboard-model.js +9 -8
  165. package/views/dist/grid/core/editing-controller.d.ts +3 -0
  166. package/views/dist/grid/core/editing-controller.js +6 -0
  167. package/views/dist/grid/core/edits-sink.d.ts +19 -0
  168. package/views/dist/grid/core/edits-sink.js +2 -0
  169. package/views/dist/grid/core/spreadsheet-operations.js +1 -1
  170. package/views/dist/grid/core/useGridEditing.d.ts +5 -0
  171. package/views/dist/grid/core/useGridEditing.js +6 -0
  172. package/views/dist/list/answer.d.ts +40 -0
  173. package/views/dist/list/answer.js +43 -0
  174. package/views/dist/list/bulk-bar.d.ts +7 -0
  175. package/views/dist/list/bulk-bar.js +10 -0
  176. package/views/dist/list/columns.d.ts +24 -0
  177. package/views/dist/list/columns.js +27 -0
  178. package/views/dist/list/edits.d.ts +19 -0
  179. package/views/dist/list/edits.js +56 -0
  180. package/views/dist/list/grid.d.ts +11 -0
  181. package/views/dist/list/grid.js +76 -0
  182. package/views/dist/list/index.d.ts +14 -1
  183. package/views/dist/list/index.js +4 -1
  184. package/views/dist/list/link.d.ts +8 -0
  185. package/views/dist/list/link.js +78 -0
  186. package/views/dist/list/list.d.ts +74 -0
  187. package/views/dist/list/list.js +18 -0
  188. package/views/dist/list/parts.js +11 -3
  189. package/views/dist/list/root-base.d.ts +46 -0
  190. package/views/dist/list/root-base.js +137 -0
  191. package/views/dist/list/root.d.ts +35 -34
  192. package/views/dist/list/root.js +153 -113
  193. package/views/dist/list/source-answers.d.ts +39 -0
  194. package/views/dist/list/source-answers.js +225 -0
  195. package/views/dist/list/store.d.ts +37 -5
  196. package/views/dist/list/store.js +31 -0
  197. package/views/dist/list/toolbar.d.ts +3 -2
  198. package/views/dist/list/toolbar.js +23 -5
  199. package/views/dist/list/views-axis.js +4 -2
  200. package/views/dist/list/views.d.ts +7 -2
  201. package/views/dist/list/views.js +16 -5
  202. package/views/dist/model/column-capabilities.d.ts +13 -0
  203. package/views/dist/model/column-capabilities.js +23 -2
  204. package/views/dist/model/column-schema.d.ts +11 -1
  205. package/views/dist/model/view-rules.js +1 -0
  206. package/views/dist/panels/model.d.ts +2 -0
  207. package/views/dist/panels/react/toolbar/ReadyToolbar.d.ts +21 -2
  208. package/views/dist/panels/react/toolbar/ReadyToolbar.js +2 -2
  209. package/views/dist/panels/react/toolbar/Toolbar.d.ts +12 -1
  210. package/views/dist/panels/react/toolbar/Toolbar.js +20 -6
  211. package/views/dist/panels/react/toolbar/ToolbarAdvancedFilters.js +4 -3
  212. package/views/dist/panels/react/toolbar/ToolbarAsideFilter.js +2 -2
  213. package/views/dist/panels/react/toolbar/ToolbarBarFilter.js +4 -4
  214. package/views/dist/panels/react/toolbar/ToolbarButton.js +4 -1
  215. package/views/dist/panels/react/toolbar/ToolbarFilter.js +1 -1
  216. package/views/dist/panels/react/toolbar/ToolbarFilterAdd.js +4 -3
  217. package/views/dist/panels/react/toolbar/ToolbarFilterSheet.js +1 -1
  218. package/views/dist/panels/react/toolbar/ToolbarFilters.js +5 -4
  219. package/views/dist/panels/react/toolbar/ToolbarNew.js +1 -1
  220. package/views/dist/panels/react/toolbar/ToolbarOptions.js +1 -1
  221. package/views/dist/panels/react/toolbar/ToolbarQuickFilters.js +1 -1
  222. package/views/dist/panels/react/toolbar/ToolbarSearch.js +1 -1
  223. package/views/dist/panels/react/toolbar/ToolbarSort.js +2 -2
  224. package/views/dist/panels/react/toolbar/ToolbarSortPill.js +8 -5
  225. package/views/dist/panels/react/toolbar/context.d.ts +31 -1
  226. package/views/dist/panels/react/toolbar/context.js +4 -0
  227. package/views/dist/panels/react/toolbar/pane-host.d.ts +6 -0
  228. package/views/dist/panels/react/toolbar/pane-host.js +17 -0
  229. package/views/dist/panels/react/toolbar/panel-part.d.ts +4 -1
  230. package/views/dist/panels/react/toolbar/panel-part.js +7 -4
  231. package/views/dist/panels/react.d.ts +1 -1
  232. package/views/dist/panels/settings/filter-groups.js +6 -1
  233. package/views/dist/provider/ViewsProvider.d.ts +7 -2
  234. package/views/dist/provider/ViewsProvider.js +18 -1
  235. package/views/dist/provider/components.d.ts +90 -2
  236. package/views/dist/provider/components.js +1 -1
  237. package/views/dist/provider/context.d.ts +4 -1
  238. package/views/dist/provider/own-control.d.ts +4 -0
  239. package/views/dist/provider/own-control.js +7 -0
  240. package/views/dist/provider/select-items.d.ts +3 -0
  241. package/views/dist/provider/select-items.js +6 -0
  242. package/views/dist/react.d.ts +4 -2
  243. package/views/dist/react.js +2 -0
  244. package/views/dist/styles.css +107 -80
  245. package/views/dist/styles.unlayered.css +107 -80
  246. package/views/docs/contract.md +310 -7
  247. package/views/docs/controls/alert-dialog.md +4 -0
  248. package/views/docs/controls/alert.md +4 -0
  249. package/views/docs/controls/bulk-bar.md +4 -0
  250. package/views/docs/controls/compound-editor.md +4 -0
  251. package/views/docs/controls/customize.md +8 -0
  252. package/views/docs/controls/date-editor.md +6 -0
  253. package/views/docs/controls/field.md +4 -0
  254. package/views/docs/controls/filter-editor.md +8 -0
  255. package/views/docs/controls/group-editor.md +8 -0
  256. package/views/docs/controls/input.md +4 -0
  257. package/views/docs/controls/links-editor.md +4 -0
  258. package/views/docs/controls/menu-list.md +8 -0
  259. package/views/docs/controls/menu.md +6 -0
  260. package/views/docs/controls/modal.md +4 -0
  261. package/views/docs/controls/notice.md +4 -0
  262. package/views/docs/controls/number-editor.md +6 -0
  263. package/views/docs/controls/pane.md +4 -0
  264. package/views/docs/controls/picker.md +8 -0
  265. package/views/docs/controls/quick-filters.md +8 -0
  266. package/views/docs/controls/radio.md +4 -0
  267. package/views/docs/controls/select.md +8 -0
  268. package/views/docs/controls/sheet.md +4 -0
  269. package/views/docs/controls/sort-editor.md +8 -0
  270. package/views/docs/controls/text-editor.md +6 -0
  271. package/views/docs/controls/toolbar.md +4 -0
  272. package/views/docs/controls/values-editor.md +4 -0
  273. package/views/docs/controls/views-list.md +8 -0
  274. package/views/docs/guides/the-grid.md +2 -2
  275. package/views/docs/guides/the-provider.md +19 -2
  276. package/views/docs/reference/controls.md +11 -7
  277. package/views/docs/reference/field-row.md +1 -1
  278. package/views/docs/reference/grid.md +1 -1
  279. package/views/docs/reference/list.md +143 -11
  280. package/views/docs/reference/looks.md +1 -1
  281. package/views/docs/reference/panels-react.md +6 -5
  282. package/views/docs/reference/react.md +19 -12
  283. package/views/docs/reference/views.md +11 -5
  284. package/views/docs/reshaping.md +17 -1
  285. package/views/skills/views/SKILL.md +1 -1
@@ -35,6 +35,9 @@ export interface FieldProps {
35
35
  /** Which form its quiet label takes: the device's unless said (the phone's below the app's line or in a PhoneHost screen).
36
36
  * Its responsive layout and sizes are always the device's. */
37
37
  form?: "computer" | "phone";
38
+ /** Its public name and which one it is (VK-989), drawn on the field's root in every form: a field editor's part. */
39
+ "data-slot"?: string;
40
+ "data-key"?: string;
38
41
  className?: string;
39
42
  children: React.ReactNode;
40
43
  }
@@ -19,23 +19,23 @@ export function Field(props) {
19
19
  const card = React.useContext(FieldRowsCardContext), settingRow = React.useContext(SettingRowField);
20
20
  return card ? _jsx(FieldAsRow, { ...props, card: card }) : settingRow ? _jsx(FieldAsSettingRow, { ...props }) : _jsx(FieldBox, { ...props });
21
21
  }
22
- function FieldAsSettingRow({ label, required = false, note, error, keepNote = false, disabled, nativeLabel = true, labelId, className, children }) {
22
+ function FieldAsSettingRow({ label, required = false, note, error, keepNote = false, disabled, nativeLabel = true, labelId, className, children, "data-slot": partSlot, "data-key": partKey }) {
23
23
  const errors = errorsOf(error), invalid = errors.length > 0, name = typeof label === "string" ? label : undefined;
24
24
  const end = React.useMemo(() => ({ name }), [name]);
25
- return (_jsxs(BaseField.Root, { className: cx("o-setting-row o-setting-row-field", className), "data-setting-row-kind": "field", invalid: invalid, disabled: disabled, "data-kit": "field", children: [_jsxs("span", { className: "o-choice-text", children: [label != null && _jsxs(BaseField.Label, { className: "o-choice-label", id: labelId, ...(nativeLabel ? {} : { nativeLabel: false, render: _jsx("span", {}) }), children: [label, required && _jsx("span", { className: "o-field-req", "aria-hidden": "true", children: "*" })] }), note != null && (!invalid || keepNote) && _jsx(BaseField.Description, { className: "o-choice-note", children: note }), invalid && _jsx(BaseField.Error, { className: "o-choice-note o-setting-row-error", match: true, children: _jsx(ErrorWords, { errors: errors }) })] }), _jsx("span", { className: "o-setting-row-end", children: _jsx(SettingRowField.Provider, { value: false, children: _jsx(AtSettingRowEnd.Provider, { value: end, children: children }) }) })] }));
25
+ return (_jsxs(BaseField.Root, { className: cx("o-setting-row o-setting-row-field", className), "data-slot": partSlot, "data-key": partKey, "data-setting-row-kind": "field", invalid: invalid, disabled: disabled, "data-kit": "field", children: [_jsxs("span", { className: "o-choice-text", children: [label != null && _jsxs(BaseField.Label, { className: "o-choice-label", id: labelId, ...(nativeLabel ? {} : { nativeLabel: false, render: _jsx("span", {}) }), children: [label, required && _jsx("span", { className: "o-field-req", "aria-hidden": "true", children: "*" })] }), note != null && (!invalid || keepNote) && _jsx(BaseField.Description, { className: "o-choice-note", children: note }), invalid && _jsx(BaseField.Error, { className: "o-choice-note o-setting-row-error", match: true, children: _jsx(ErrorWords, { errors: errors }) })] }), _jsx("span", { className: "o-setting-row-end", children: _jsx(SettingRowField.Provider, { value: false, children: _jsx(AtSettingRowEnd.Provider, { value: end, children: children }) }) })] }));
26
26
  }
27
27
  const useBeforePaint = typeof window === "undefined" ? React.useEffect : React.useLayoutEffect;
28
- function FieldAsRow({ card, label, required = false, note, error, disabled, nativeLabel = true, labelId, className, children }) {
28
+ function FieldAsRow({ card, label, required = false, note, error, disabled, nativeLabel = true, labelId, className, children, "data-slot": partSlot, "data-key": partKey }) {
29
29
  const errors = errorsOf(error), invalid = errors.length > 0, device = usePhoneForm();
30
30
  const id = React.useId(), noted = note != null && !invalid, wants = noted || invalid, { enter, need, slot } = card, at = slot(id);
31
31
  useBeforePaint(() => enter(id), [enter, id]);
32
32
  useBeforePaint(() => { need(id, wants); return () => need(id, false); }, [need, id, wants]);
33
- return (_jsxs(BaseField.Root, { className: cx("o-field o-field-row", className), "data-field-in": "rows", ...phoneMark(device), invalid: invalid, disabled: disabled, "data-kit": "field", children: [label != null && _jsxs(BaseField.Label, { className: "o-field-row-label", id: labelId, ...(nativeLabel ? {} : { nativeLabel: false, render: _jsx("span", {}) }), children: [label, required && _jsx("span", { className: "o-field-req", "aria-hidden": "true", children: "*" })] }), _jsx(FieldRowsCardContext.Provider, { value: null, children: _jsx(InFieldRow.Provider, { value: true, children: children }) }), at && wants && createPortal(_jsxs(_Fragment, { children: [noted && _jsx(BaseField.Description, { className: "o-field-note", children: note }), invalid && _jsx(BaseField.Error, { className: "o-field-error", match: true, children: _jsx(ErrorWords, { errors: errors }) })] }), at)] }));
33
+ return (_jsxs(BaseField.Root, { className: cx("o-field o-field-row", className), "data-slot": partSlot, "data-key": partKey, "data-field-in": "rows", ...phoneMark(device), invalid: invalid, disabled: disabled, "data-kit": "field", children: [label != null && _jsxs(BaseField.Label, { className: "o-field-row-label", id: labelId, ...(nativeLabel ? {} : { nativeLabel: false, render: _jsx("span", {}) }), children: [label, required && _jsx("span", { className: "o-field-req", "aria-hidden": "true", children: "*" })] }), _jsx(FieldRowsCardContext.Provider, { value: null, children: _jsx(InFieldRow.Provider, { value: true, children: children }) }), at && wants && createPortal(_jsxs(_Fragment, { children: [noted && _jsx(BaseField.Description, { className: "o-field-note", children: note }), invalid && _jsx(BaseField.Error, { className: "o-field-error", match: true, children: _jsx(ErrorWords, { errors: errors }) })] }), at)] }));
34
34
  }
35
- function FieldBox({ label, required = false, note, error, keepNote = false, orientation = "vertical", disabled, nativeLabel = true, labelId, quietLabel = false, form, className, children }) {
35
+ function FieldBox({ label, required = false, note, error, keepNote = false, orientation = "vertical", disabled, nativeLabel = true, labelId, quietLabel = false, form, className, children, "data-slot": partSlot, "data-key": partKey }) {
36
36
  const errors = errorsOf(error), invalid = errors.length > 0;
37
37
  const phone = usePhoneForm(form), device = usePhoneForm(), inRow = React.useContext(InFieldRow);
38
- return (_jsxs(BaseField.Root, { className: cx("o-field", className), "data-orientation": orientation === "vertical" ? undefined : orientation, "data-field-label": quietLabel ? "quiet" : undefined, "data-field-form": quietLabel && phone ? "phone" : undefined, ...phoneMark(device), invalid: invalid, disabled: disabled, "data-kit": "field", children: [label != null && _jsxs(BaseField.Label, { className: "o-field-label", id: labelId, ...(nativeLabel ? {} : { nativeLabel: false, render: _jsx("span", {}) }), children: [label, required && _jsx("span", { className: "o-field-req", "aria-hidden": "true", children: "*" })] }), inRow ? _jsx(InFieldRow.Provider, { value: false, children: children }) : children, note != null && (!invalid || keepNote) && _jsx(BaseField.Description, { className: "o-field-note", children: note }), invalid && _jsx(BaseField.Error, { className: "o-field-error", match: true, children: _jsx(ErrorWords, { errors: errors }) })] }));
38
+ return (_jsxs(BaseField.Root, { className: cx("o-field", className), "data-slot": partSlot, "data-key": partKey, "data-orientation": orientation === "vertical" ? undefined : orientation, "data-field-label": quietLabel ? "quiet" : undefined, "data-field-form": quietLabel && phone ? "phone" : undefined, ...phoneMark(device), invalid: invalid, disabled: disabled, "data-kit": "field", children: [label != null && _jsxs(BaseField.Label, { className: "o-field-label", id: labelId, ...(nativeLabel ? {} : { nativeLabel: false, render: _jsx("span", {}) }), children: [label, required && _jsx("span", { className: "o-field-req", "aria-hidden": "true", children: "*" })] }), inRow ? _jsx(InFieldRow.Provider, { value: false, children: children }) : children, note != null && (!invalid || keepNote) && _jsx(BaseField.Description, { className: "o-field-note", children: note }), invalid && _jsx(BaseField.Error, { className: "o-field-error", match: true, children: _jsx(ErrorWords, { errors: errors }) })] }));
39
39
  }
40
40
  function SetDisabled({ disabled, children }) {
41
41
  const outer = useFieldRootContext();
@@ -1,5 +1,5 @@
1
- import { type MenuEntry } from "../menu/menu.js";
2
- import { type SelectItem } from "../select/select.js";
1
+ import type { MenuEntry } from "../menu/menu.js";
2
+ import type { SelectItem } from "../select/select.js";
3
3
  import type { Quantifier } from "./rules.js";
4
4
  import type { FilterEditorWords } from "./words.js";
5
5
  /** A block's head: its relation's name and its quantifier's box. On a phone the box's press turns the sheet to its step (`step`). */
@@ -1,17 +1,17 @@
1
1
  "use client";
2
2
  import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
3
- import { Button } from "../button/button.js";
4
3
  import { DOTS_UP, glyph, MORE_LOOK } from "../internal/editor-parts.js";
5
- import { Menu } from "../menu/menu.js";
4
+ import { usePanelControls } from "../internal/panel-controls.js";
6
5
  import { MENU_LIST_CARD_FRAME } from "../menu-list/looks.js";
7
6
  import { MenuList } from "../menu-list/menu-list.js";
8
- import { Select } from "../select/select.js";
9
7
  export function BlockHead({ id, label, items, value, onPick, size, step }) {
10
- return (_jsxs("div", { className: "o-filter-editor-block-head", "data-block-head": id, children: [_jsxs("span", { className: "o-filter-editor-relation", children: [label, ":"] }), _jsx(Select, { size: size, listWidth: "rows", "aria-label": label, items: items, value: value, ...(step ?? {}), onValueChange: (v) => { if (typeof v === "string" && v !== value)
8
+ const { Select } = usePanelControls();
9
+ return (_jsxs("div", { className: "o-filter-editor-block-head", "data-slot": "vk-filter-group-head", "data-block-head": id, children: [_jsxs("span", { className: "o-filter-editor-relation", children: [label, ":"] }), _jsx(Select, { size: size, listWidth: "rows", "aria-label": label, "data-slot": "vk-filter-quantifier", items: items, value: value, ...(step ?? {}), onValueChange: (v) => { if (typeof v === "string" && v !== value)
11
10
  onPick(v); } })] }));
12
11
  }
13
12
  export function GroupMenu({ entries, words }) {
14
- return _jsx(Menu, { label: words.groupActions, align: "end", entries: entries, trigger: _jsx(Button, { kind: "quiet", shape: "icon", size: "xs", look: MORE_LOOK, className: "o-filter-editor-more", "aria-label": words.groupActions, icon: glyph(DOTS_UP) }) });
13
+ const { Button, Menu } = usePanelControls();
14
+ return _jsx(Menu, { label: words.groupActions, align: "end", entries: entries, trigger: _jsx(Button, { kind: "quiet", shape: "icon", size: "xs", look: MORE_LOOK, className: "o-filter-editor-more", "data-slot": "vk-filter-group-more", "aria-label": words.groupActions, icon: glyph(DOTS_UP) }) });
15
15
  }
16
16
  export function MenuStep({ label, entries, onClose, words }) {
17
17
  const rows = entries.map((e) => {
@@ -1,19 +1,15 @@
1
1
  "use client";
2
2
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
3
  import * as React from "react";
4
- import { Button } from "../button/button.js";
5
4
  import { cellText } from "../date-editor/calendar.js";
6
5
  import { DateEditor, useDateEditor } from "../date-editor/date-editor.js";
7
6
  import { asSelect, DOTS, DOTS_LOOK, DOTS_UP, glyph, MORE_LOOK, PLUS, TRASH, useDecide, useStandingRoom } from "../internal/editor-parts.js";
8
7
  import { PhoneHost, phoneMark, usePhone } from "../internal/phone.js";
8
+ import { usePanelControls } from "../internal/panel-controls.js";
9
9
  import { openerAt, useStepReturn } from "../internal/step-return.js";
10
- import { Input } from "../input/input.js";
11
- import { Menu } from "../menu/menu.js";
12
10
  import { NumberField } from "../number-field/number-field.js";
13
11
  import { Picker, usePicker } from "../picker/picker.js";
14
12
  import { itemLabel } from "../picker/rows.js";
15
- import { Popover } from "../popover/popover.js";
16
- import { Select } from "../select/select.js";
17
13
  import { Tooltip } from "../tooltip/tooltip.js";
18
14
  import { HOW, wayOf } from "./how.js";
19
15
  import { PairValue } from "./parts.js";
@@ -23,7 +19,7 @@ import { filterWords } from "./words.js";
23
19
  const GROUP = ["M4 7a3 3 0 0 1 3 -3h10a3 3 0 0 1 3 3v10a3 3 0 0 1 -3 3h-10a3 3 0 0 1 -3 -3z", "M8 9h8", "M8 13h5"];
24
20
  const TURNS = ["M7 4l-3 3l3 3", "M4 7h13", "M17 20l3 -3l-3 -3", "M20 17h-13"];
25
21
  function DateValue({ name, value, onValue, open, onOpenChange, phone, size, placeholder }) {
26
- const box = React.useRef(null);
22
+ const box = React.useRef(null), { Input, Popover } = usePanelControls();
27
23
  return (_jsxs("div", { ref: box, className: "o-filter-editor-date", children: [_jsx(Input, { readOnly: true, size: size, "aria-label": name, "aria-haspopup": "dialog", "aria-expanded": open, placeholder: placeholder, value: value ? cellText(value, value) : "", className: "o-filter-editor-date-box", onClick: () => onOpenChange(!open), onKeyDown: (e) => { if (e.key === "Enter" || e.key === " " || e.key === "ArrowDown") {
28
24
  e.preventDefault();
29
25
  onOpenChange(true);
@@ -33,7 +29,7 @@ function DateStep({ name, value, onValue, onDone }) {
33
29
  return _jsx(_Fragment, { children: useDateEditor({ label: name, value, onValueChange: onValue, onDone, form: "phone", draft: "shell" }).body });
34
30
  }
35
31
  function OwnValue({ name, own, open, onOpenChange, phone, size, placeholder }) {
36
- const box = React.useRef(null), takes = own.body != null;
32
+ const box = React.useRef(null), takes = own.body != null, { Input, Popover } = usePanelControls();
37
33
  return (_jsxs("div", { ref: box, className: "o-filter-editor-own", children: [_jsx(Input, { readOnly: true, size: size, "aria-label": name, "aria-haspopup": takes ? "dialog" : undefined, "aria-expanded": takes ? open : undefined, placeholder: placeholder, value: own.value ?? "", disabled: !takes, className: "o-filter-editor-own-box", onClick: () => { if (takes)
38
34
  onOpenChange(!open); }, onKeyDown: (e) => { if (takes && (e.key === "Enter" || e.key === " " || e.key === "ArrowDown")) {
39
35
  e.preventDefault();
@@ -43,6 +39,7 @@ function OwnValue({ name, own, open, onOpenChange, phone, size, placeholder }) {
43
39
  export function useFilterEditor(props) {
44
40
  const { label, fields, filter, onFilterChange, onDone, standing = false, ids, levels } = props;
45
41
  const w = filterWords(props.words), words = w.picker ? { words: w.picker } : {};
42
+ const { Button, Select, Menu, Popover, Input } = usePanelControls();
46
43
  const screen = React.useContext(PhoneHost), small = usePhone(), way = props.form ?? (screen || small ? "phone" : "computer");
47
44
  const phone = way === "phone", stacked = phone || way === "narrow";
48
45
  const now = React.useRef(filter);
@@ -76,17 +73,17 @@ export function useFilterEditor(props) {
76
73
  if (!r || !field || !takes || takes === "none")
77
74
  return void setOpen(null);
78
75
  if (field.choices || field.type === "date")
79
- return void box?.querySelector(".o-select-field")?.focus({ preventScroll: true });
76
+ return void (box?.querySelector(".o-select-field") ?? box?.querySelector("button, select, [role='combobox']"))?.focus({ preventScroll: true });
80
77
  box?.querySelector("input")?.focus({ preventScroll: true });
81
78
  setOpen(null);
82
79
  }, [open, root, standing]);
83
80
  const opener = (id) => (o) => setOpen((x) => (o ? id : x === id ? null : x));
84
81
  const back = () => setStep(null);
85
82
  useStepReturn(root, !phone || !step ? [] : [step.list === "add" ? ((group) => openerAt(() => `[data-add-to="${CSS.escape(group)}"]`))(step.group)
86
- : step.list === "quantifier" ? ((group) => openerAt(() => `[data-block-head="${CSS.escape(group)}"] .o-select-field`))(step.group)
83
+ : step.list === "quantifier" ? ((group) => openerAt(() => `[data-block-head="${CSS.escape(group)}"] [data-slot="vk-filter-quantifier"]`))(step.group)
87
84
  : step.list === "menu" ? ((item) => openerAt(() => `[data-more-of="${CSS.escape(item)}"]`))(step.item)
88
- : ((id, list) => openerAt(() => (list === "value" ? `[data-value-of="${CSS.escape(id)}"] :is(.o-select-field, input, button)`
89
- : `.o-filter-editor-rule[data-rule="${CSS.escape(id)}"] .o-filter-editor-${list} .o-select-field`)))(step.rule, step.list)]);
85
+ : ((id, list) => openerAt(() => (list === "value" ? `[data-value-of="${CSS.escape(id)}"] :is(.o-select-field, input, button, select, [role='combobox'])`
86
+ : `.o-filter-editor-rule[data-rule="${CSS.escape(id)}"] .o-filter-editor-${list} [data-slot="vk-filter-${list}"]`)))(step.rule, step.list)]);
90
87
  const add = (group, field) => {
91
88
  if (typeof field !== "string")
92
89
  return;
@@ -114,7 +111,7 @@ export function useFilterEditor(props) {
114
111
  const [adding, setAdding] = React.useState(null);
115
112
  const gone = filter.relation?.gone;
116
113
  const addButton = (group, kind, size) => {
117
- const add = (_jsx(Button, { kind: kind, size: size, icon: glyph(PLUS), className: "o-filter-editor-add", "data-add-to": group, "aria-haspopup": "dialog", "aria-disabled": gone ? true : undefined, "aria-expanded": phone ? step?.list === "add" && step.group === group : adding?.group === group, onClick: (e) => { if (gone)
114
+ const add = (_jsx(Button, { kind: kind, size: size, icon: glyph(PLUS), className: "o-filter-editor-add", "data-slot": "vk-filter-add", "data-add-to": group, "aria-haspopup": "dialog", "aria-disabled": gone ? true : undefined, "aria-expanded": phone ? step?.list === "add" && step.group === group : adding?.group === group, onClick: (e) => { if (gone)
118
115
  return; const at = e.currentTarget; if (phone)
119
116
  setStep({ list: "add", group });
120
117
  else
@@ -175,7 +172,7 @@ export function useFilterEditor(props) {
175
172
  : stepDate && stepRule ? _jsx(DateStep, { name: labelOf(stepRule), value: typeof stepRule.value === "string" ? stepRule.value : null, onValue: set(stepRule.id), onDone: back })
176
173
  : stepList.body;
177
174
  const size = phone ? "lg" : "sm";
178
- const moreStep = (id, label) => (_jsx(Button, { kind: "quiet", shape: "icon", size: "40x44", look: DOTS_LOOK, className: "o-filter-editor-more", "data-more-of": id, "aria-label": label, "aria-haspopup": "dialog", icon: glyph(DOTS), onClick: () => setStep({ list: "menu", item: id }) }));
175
+ const moreStep = (id, label, slot) => (_jsx(Button, { kind: "quiet", shape: "icon", size: "40x44", look: DOTS_LOOK, className: "o-filter-editor-more", "data-slot": slot, "data-more-of": id, "aria-label": label, "aria-haspopup": "dialog", icon: glyph(DOTS), onClick: () => setStep({ list: "menu", item: id }) }));
179
176
  const stepOf = (s) => (phone ? { open: false, onOpenChange: (o) => { if (o)
180
177
  setStep(s); } } : {});
181
178
  const valueBox = (r, field, takes, own) => {
@@ -199,20 +196,21 @@ export function useFilterEditor(props) {
199
196
  };
200
197
  function groupEntries(g) {
201
198
  const can = canExclude(filter, g.id);
202
- return [{ kind: "check", label: w.exclude, checked: !!g.exclude, ...(can ? {} : { disabled: w.excludeNeedsAnd }),
199
+ return [{ kind: "check", label: w.exclude, checked: !!g.exclude, slot: { slot: "vk-filter-group-action", key: "exclude" }, ...(can ? {} : { disabled: w.excludeNeedsAnd }),
203
200
  onCheckedChange: (on) => change(setExclude(now.current, g.id, on)) }];
204
201
  }
205
202
  function ruleEntries(r) {
206
203
  const aside = r.aside;
204
+ const act = (key) => ({ slot: { slot: "vk-filter-rule-action", key } });
207
205
  if (aside)
208
- return [{ icon: null, label: aside.why, disabled: aside.why },
209
- ...(aside.putBack ? [{ icon: null, label: w.putBack, onSelect: () => change(putBack(now.current, r.id)) }] : []),
210
- { icon: glyph(TRASH), label: w.deleteRule, danger: true, onSelect: () => remove(r.id) }];
206
+ return [{ icon: null, label: aside.why, disabled: aside.why, ...act("why") },
207
+ ...(aside.putBack ? [{ icon: null, label: w.putBack, onSelect: () => change(putBack(now.current, r.id)), ...act("put-back") }] : []),
208
+ { icon: glyph(TRASH), label: w.deleteRule, danger: true, onSelect: () => remove(r.id), ...act("delete") }];
211
209
  const blockable = !!relationOf(fields, r.field) && !blockAround(filter, r.id) && canGroup(filter, r.id, levels);
212
- return [...(canGroup(filter, r.id, levels) ? [{ icon: glyph(GROUP), label: w.toGroup, onSelect: () => change(toGroup(now.current, r.id, ids, levels)) }] : []),
213
- ...(blockable ? [{ kind: "separator" }, { kind: "pick", value: "any", choices: QUANTIFIERS.filter((q) => q !== "every" || isWhole(r, fields)).map((q) => ({ value: q, label: w.quantifier(q) })),
210
+ return [...(canGroup(filter, r.id, levels) ? [{ icon: glyph(GROUP), label: w.toGroup, onSelect: () => change(toGroup(now.current, r.id, ids, levels)), ...act("convert") }] : []),
211
+ ...(blockable ? [{ kind: "separator" }, { kind: "pick", value: "any", choices: QUANTIFIERS.filter((q) => q !== "every" || isWhole(r, fields)).map((q) => ({ value: q, label: w.quantifier(q), ...act(q) })),
214
212
  onChoose: (q) => change(toBlock(now.current, r.id, q, fields, ids, levels)) }, { kind: "separator" }] : []),
215
- { icon: glyph(TRASH), label: w.deleteRule, danger: true, onSelect: () => remove(r.id) }];
213
+ { icon: glyph(TRASH), label: w.deleteRule, danger: true, onSelect: () => remove(r.id), ...act("delete") }];
216
214
  }
217
215
  const ruleRow = (r) => {
218
216
  const field = fieldOf(fields, r.field), own = ownOf(r), aside = r.aside, name = labelOf(r);
@@ -221,28 +219,28 @@ export function useFilterEditor(props) {
221
219
  const entries = ruleEntries(r), fieldItems = asSelect(fieldsIn(filter, r.id, fields));
222
220
  const why = (node) => (aside ? _jsx(Tooltip, { label: aside.why, reason: true, side: "bottom", children: _jsx("span", { className: "o-filter-editor-why", children: node }) }) : node);
223
221
  const wayPlaceholder = own && !kitWay ? own.way : w.way(r.how);
224
- return (_jsxs("div", { className: "o-filter-editor-rule", "data-rule": r.id, "data-whole": (field || own) && isWhole(r, fields) ? "" : undefined, "data-set-aside": aside || (!field && !own) ? "" : undefined, "data-aside": aside ? "" : undefined, children: [_jsxs("div", { className: "o-filter-editor-boxes", children: [_jsx("div", { className: "o-filter-editor-field", children: why(_jsx(Select, { size: size, listWidth: "rows", "aria-label": w.field, items: fieldItems, value: field && !aside ? r.field : null, placeholder: name, search: w.search, ...stepOf({ list: "field", rule: r.id }), onValueChange: (v) => { if (typeof v === "string" && (v !== r.field || aside))
225
- pointAt(r.id, v); } })) }), _jsx("div", { className: "o-filter-editor-how", children: why(_jsx(Select, { size: size, listWidth: "rows", "aria-label": w.how, items: ways, value: field && kitWay && !aside ? r.how : null, placeholder: wayPlaceholder, disabled: !!aside || (!field && !!own), ...(field || !own ? stepOf({ list: "how", rule: r.id }) : {}), onValueChange: (v) => { if (typeof v === "string" && v !== r.how)
226
- change(changeRule(now.current, r.id, { how: v }, fields)); } })) }), aside && own?.value != null && (_jsx("div", { className: "o-filter-editor-value", "data-value-of": r.id, "data-value-box": "own", children: why(_jsx(Input, { readOnly: true, disabled: true, size: size, "aria-label": name, value: own.value, className: "o-filter-editor-own-box" })) })), !aside && takes && takes !== "none" && (field || own) && (_jsx("div", { className: "o-filter-editor-value", "data-value-of": r.id, "data-value-box": own ? "own" : field?.choices ? "choice" : takes === "two" ? "pair" : field?.type === "date" ? "date" : "typed", children: valueBox(r, field ?? { value: r.field, label: name, type: "text" }, takes, own) }))] }), phone ? moreStep(r.id, w.ruleOf(name))
227
- : _jsx(Menu, { label: w.ruleOf(name), align: "end", entries: entries, trigger: _jsx(Button, { kind: "quiet", shape: "icon", size: "xs", look: MORE_LOOK, className: "o-filter-editor-more", "aria-label": w.ruleOf(name), icon: glyph(DOTS_UP) }) })] }));
222
+ return (_jsxs("div", { className: "o-filter-editor-rule", "data-slot": "vk-filter-rule", "data-key": r.field, "data-rule": r.id, "data-whole": (field || own) && isWhole(r, fields) ? "" : undefined, "data-set-aside": aside || (!field && !own) ? "" : undefined, "data-aside": aside ? "" : undefined, children: [_jsxs("div", { className: "o-filter-editor-boxes", children: [_jsx("div", { className: "o-filter-editor-field", children: why(_jsx(Select, { size: size, listWidth: "rows", "aria-label": w.field, "data-slot": "vk-filter-field", items: fieldItems, value: field && !aside ? r.field : null, placeholder: name, search: w.search, ...stepOf({ list: "field", rule: r.id }), onValueChange: (v) => { if (typeof v === "string" && (v !== r.field || aside))
223
+ pointAt(r.id, v); } })) }), _jsx("div", { className: "o-filter-editor-how", children: why(_jsx(Select, { size: size, listWidth: "rows", "aria-label": w.how, "data-slot": "vk-filter-how", items: ways, value: field && kitWay && !aside ? r.how : null, placeholder: wayPlaceholder, disabled: !!aside || (!field && !!own), ...(field || !own ? stepOf({ list: "how", rule: r.id }) : {}), onValueChange: (v) => { if (typeof v === "string" && v !== r.how)
224
+ change(changeRule(now.current, r.id, { how: v }, fields)); } })) }), aside && own?.value != null && (_jsx("div", { className: "o-filter-editor-value", "data-slot": "vk-filter-value", "data-value-of": r.id, "data-value-box": "own", children: why(_jsx(Input, { readOnly: true, disabled: true, size: size, "aria-label": name, value: own.value, className: "o-filter-editor-own-box" })) })), !aside && takes && takes !== "none" && (field || own) && (_jsx("div", { className: "o-filter-editor-value", "data-slot": "vk-filter-value", "data-value-of": r.id, "data-value-box": own ? "own" : field?.choices ? "choice" : takes === "two" ? "pair" : field?.type === "date" ? "date" : "typed", children: valueBox(r, field ?? { value: r.field, label: name, type: "text" }, takes, own) }))] }), phone ? moreStep(r.id, w.ruleOf(name), "vk-filter-rule-more")
225
+ : _jsx(Menu, { label: w.ruleOf(name), align: "end", entries: entries, trigger: _jsx(Button, { kind: "quiet", shape: "icon", size: "xs", look: MORE_LOOK, className: "o-filter-editor-more", "data-slot": "vk-filter-rule-more", "aria-label": w.ruleOf(name), icon: glyph(DOTS_UP) }) })] }));
228
226
  };
229
- const lead = (g, i) => i === 0 ? _jsx("span", { className: "o-filter-editor-where", children: w.where })
230
- : i === 1 && !g.exclude ? _jsx(Button, { kind: "outline", size: "sm", className: "o-filter-editor-join", iconEnd: glyph(TURNS), onClick: () => change(setJoin(now.current, g.id, g.join === "and" ? "or" : "and")), children: w.join(g.join) })
231
- : _jsx("span", { className: "o-filter-editor-joined", children: w.join(g.join) });
227
+ const lead = (g, i) => i === 0 ? _jsx("span", { className: "o-filter-editor-where", "data-slot": "vk-filter-where", children: w.where })
228
+ : i === 1 && !g.exclude ? _jsx(Button, { kind: "outline", size: "sm", className: "o-filter-editor-join", "data-slot": "vk-filter-join", iconEnd: glyph(TURNS), onClick: () => change(setJoin(now.current, g.id, g.join === "and" ? "or" : "and")), children: w.join(g.join) })
229
+ : _jsx("span", { className: "o-filter-editor-joined", "data-slot": "vk-filter-joined", children: w.join(g.join) });
232
230
  const blockHead = (g) => g.relation && (_jsx(BlockHead, { id: g.id, label: blockLabel(g), items: quantifiersOf(g), value: g.relation.quantifier, size: size, onPick: (q) => change(setQuantifier(now.current, g.id, q)), ...(phone ? { step: { open: false, onOpenChange: (o) => { if (o)
233
231
  setStep({ list: "quantifier", group: g.id }); } } } : {}) }));
234
- const groupMore = (g) => (phone ? moreStep(g.id, w.groupActions) : _jsx(GroupMenu, { entries: groupEntries(g), words: w }));
235
- const top = _jsxs(_Fragment, { children: [filter.exclude && _jsx("p", { className: "o-filter-editor-excluded", children: w.excluded }), blockHead(filter)] });
236
- const level = (g, depth) => (_jsx("div", { className: "o-filter-editor-rules", role: "list", "aria-label": depth ? w.group : label, children: g.rules.map((item, i) => (_jsxs("div", { role: "listitem", className: "o-filter-editor-item", children: [lead(g, i), isBlock(item) ? (_jsxs("div", { className: "o-filter-editor-group o-filter-editor-block", "data-group": item.id, "data-block": item.id, children: [blockHead(item), level(item, depth + 1), _jsxs("div", { className: "o-filter-editor-foot", children: [addButton(item.id, stacked ? "quiet" : "outline", phone ? "44" : "sm"), _jsx(Button, { kind: "quiet", size: phone ? "44" : "sm", className: "o-filter-editor-delete", onClick: () => remove(item.id), children: w.deleteRule })] })] })) : isGroup(item) ? (_jsxs("div", { className: "o-filter-editor-group", "data-group": item.id, children: [item.exclude && _jsx("p", { className: "o-filter-editor-excluded", children: w.excluded }), level(item, depth + 1), _jsxs("div", { className: "o-filter-editor-foot", children: [addButton(item.id, stacked ? "quiet" : "outline", phone ? "44" : "sm"), _jsx(Button, { kind: "quiet", size: phone ? "44" : "sm", className: "o-filter-editor-delete", onClick: () => remove(item.id), children: w.deleteGroup }), groupMore(item)] })] })) : ruleRow(item)] }, item.id))) }));
232
+ const groupMore = (g) => (phone ? moreStep(g.id, w.groupActions, "vk-filter-group-more") : _jsx(GroupMenu, { entries: groupEntries(g), words: w }));
233
+ const top = _jsxs(_Fragment, { children: [filter.exclude && _jsx("p", { className: "o-filter-editor-excluded", "data-slot": "vk-filter-excluded", children: w.excluded }), blockHead(filter)] });
234
+ const level = (g, depth) => (_jsx("div", { className: "o-filter-editor-rules", "data-slot": "vk-filter-rules", role: "list", "aria-label": depth ? w.group : label, children: g.rules.map((item, i) => (_jsxs("div", { role: "listitem", className: "o-filter-editor-item", "data-slot": "vk-filter-item", "data-index": i, children: [lead(g, i), isBlock(item) ? (_jsxs("div", { className: "o-filter-editor-group o-filter-editor-block", "data-slot": "vk-filter-group", "data-group": item.id, "data-block": item.id, children: [blockHead(item), level(item, depth + 1), _jsxs("div", { className: "o-filter-editor-foot", "data-slot": "vk-filter-foot", children: [addButton(item.id, stacked ? "quiet" : "outline", phone ? "44" : "sm"), _jsx(Button, { kind: "quiet", size: phone ? "44" : "sm", className: "o-filter-editor-delete", "data-slot": "vk-filter-delete", onClick: () => remove(item.id), children: w.deleteRule })] })] })) : isGroup(item) ? (_jsxs("div", { className: "o-filter-editor-group", "data-slot": "vk-filter-group", "data-group": item.id, children: [item.exclude && _jsx("p", { className: "o-filter-editor-excluded", "data-slot": "vk-filter-excluded", children: w.excluded }), level(item, depth + 1), _jsxs("div", { className: "o-filter-editor-foot", "data-slot": "vk-filter-foot", children: [addButton(item.id, stacked ? "quiet" : "outline", phone ? "44" : "sm"), _jsx(Button, { kind: "quiet", size: phone ? "44" : "sm", className: "o-filter-editor-delete", "data-slot": "vk-filter-delete", onClick: () => remove(item.id), children: w.deleteGroup }), groupMore(item)] })] })) : ruleRow(item)] }, item.id))) }));
237
235
  const addingPopover = !standing && (_jsx(Popover, { open: !!adding, onOpenChange: (o) => { if (!o)
238
236
  setAdding(null); }, anchor: adding?.at, className: "w-fit min-w-[calc(var(--vk-spacing,var(--spacing))*48)]", "aria-label": w.add, children: adding && _jsx(Picker, { label: w.add, items: fieldsIn(filter, adding.group, fields), value: null, onValueChange: (v) => add(adding.group, v), onDone: () => setAdding(null), search: w.search, searchShown: true, form: "computer", ...words }) }));
239
237
  if (stacked) {
240
- const body = (_jsx("div", { ref: placeRoot, className: "o-filter-editor", "data-kit": "filter-editor", "data-filter-form": way, role: phone ? undefined : "group", "aria-label": phone ? undefined : label, tabIndex: -1, style: room ? { paddingBottom: room } : undefined, ...phoneMark(!!screen || small), "data-filter-step": stepTitle !== undefined ? step?.list : undefined, children: stepTitle !== undefined ? stepBody : _jsxs(_Fragment, { children: [top, filter.rules.length ? level(filter, 0)
241
- : _jsxs("div", { className: "o-filter-editor-none", children: [_jsx("p", { className: "o-filter-editor-none-head", children: w.none }), _jsx("p", { className: "o-filter-editor-none-line", children: w.noneLine })] }), _jsxs("div", { className: "o-filter-editor-acts", children: [addButton(filter.id, filter.rules.length ? "outline" : "primary", phone ? "44" : "sm"), filter.rules.length > 0 && _jsx(Button, { kind: "quiet", size: phone ? "44" : "sm", className: "o-filter-editor-clear", onClick: clear, children: w.clearAll }), props.excludable && groupMore(filter)] }), !phone && addingPopover] }) }));
238
+ const body = (_jsx("div", { ref: placeRoot, className: "o-filter-editor", "data-slot": "vk-filter", "data-kit": "filter-editor", "data-filter-form": way, role: phone ? undefined : "group", "aria-label": phone ? undefined : label, tabIndex: -1, style: room ? { paddingBottom: room } : undefined, ...phoneMark(!!screen || small), "data-filter-step": stepTitle !== undefined ? step?.list : undefined, children: stepTitle !== undefined ? stepBody : _jsxs(_Fragment, { children: [top, filter.rules.length ? level(filter, 0)
239
+ : _jsxs("div", { className: "o-filter-editor-none", "data-slot": "vk-filter-none", children: [_jsx("p", { className: "o-filter-editor-none-head", children: w.none }), _jsx("p", { className: "o-filter-editor-none-line", children: w.noneLine })] }), _jsxs("div", { className: "o-filter-editor-acts", "data-slot": "vk-filter-foot", children: [addButton(filter.id, filter.rules.length ? "outline" : "primary", phone ? "44" : "sm"), filter.rules.length > 0 && _jsx(Button, { kind: "quiet", size: phone ? "44" : "sm", className: "o-filter-editor-clear", "data-slot": "vk-filter-clear", onClick: clear, children: w.clearAll }), props.excludable && groupMore(filter)] }), !phone && addingPopover] }) }));
242
240
  return { body, head: !phone ? {} : stepTitle !== undefined ? { onBack: back } : decide.head, ...(stepTitle !== undefined ? { title: stepTitle } : {}) };
243
241
  }
244
242
  const fieldsAlone = !filter.rules.length && !filter.relation;
245
- const body = (_jsx("div", { ref: placeRoot, className: "o-filter-editor", "data-kit": "filter-editor", "data-filter-form": "computer", role: "group", "aria-label": label, tabIndex: -1, "data-filter-fields": fieldsAlone ? "" : undefined, style: room ? { paddingBottom: room } : undefined, ...phoneMark(!!screen || small), children: !fieldsAlone ? _jsxs(_Fragment, { children: [top, level(filter, 0), _jsxs("div", { className: "o-filter-editor-foot", children: [addButton(filter.id, "outline", "sm"), _jsx(Button, { kind: "quiet", size: "sm", className: "o-filter-editor-clear", onClick: clear, children: w.clearAllFilters }), props.excludable && groupMore(filter)] }), addingPopover] }) : (_jsx(Picker, { label: label, items: fields, value: null, onValueChange: (v) => add(filter.id, v), search: w.search, searchShown: true, form: "computer", ...words })) }));
243
+ const body = (_jsx("div", { ref: placeRoot, className: "o-filter-editor", "data-slot": "vk-filter", "data-kit": "filter-editor", "data-filter-form": "computer", role: "group", "aria-label": label, tabIndex: -1, "data-filter-fields": fieldsAlone ? "" : undefined, style: room ? { paddingBottom: room } : undefined, ...phoneMark(!!screen || small), children: !fieldsAlone ? _jsxs(_Fragment, { children: [top, level(filter, 0), _jsxs("div", { className: "o-filter-editor-foot", "data-slot": "vk-filter-foot", children: [addButton(filter.id, "outline", "sm"), _jsx(Button, { kind: "quiet", size: "sm", className: "o-filter-editor-clear", "data-slot": "vk-filter-clear", onClick: clear, children: w.clearAllFilters }), props.excludable && groupMore(filter)] }), addingPopover] }) : (_jsx(Picker, { label: label, items: fields, value: null, onValueChange: (v) => add(filter.id, v), search: w.search, searchShown: true, form: "computer", ...words })) }));
246
244
  return { body, head: {} };
247
245
  }
248
246
  export const useFilterEditorParts = useFilterEditor;
@@ -9,11 +9,13 @@ export interface FilterWay {
9
9
  takes: Takes;
10
10
  }
11
11
  /** A field a list filters by: the Picker's item, with its type; a choice's values (a stage's, a person's, a record's), each a
12
- * Picker's item with its mark; a related record's fields one level in (a deal's Company), each typed too. */
12
+ * Picker's item with its mark; a related record's fields one level in (a deal's Company), each typed too; a number that
13
+ * holds whole numbers only (`integer`), whose box rounds what is typed. */
13
14
  export interface FilterField extends PickerItem {
14
15
  type: FieldType;
15
16
  choices?: PickerItem[];
16
17
  level?: FilterField[];
18
+ integer?: boolean;
17
19
  }
18
20
  /** Each type's ways, in the order they are offered; the first is a new rule's. */
19
21
  export declare const HOW: Record<FieldType, FilterWay[]>;
@@ -20,6 +20,7 @@ export declare function useMapFilterBody(p: ViewsFilterBodyProps, words: FilterE
20
20
  change: (next: KitGroup) => void;
21
21
  own: (rule: KitRule) => FilterOwn | null;
22
22
  };
23
+ /** ViewKit's filter body, its controls the app's where the provider's `panelControls` names them (VK-1013). */
23
24
  export declare function MapFilterBody(props: ViewsFilterBodyProps): import("react/jsx-runtime").JSX.Element;
24
25
  /** The rule as a one-rule kit filter, with the kit's fields for it; null where the kit draws no rule of it, or where a choice has no
25
26
  * values to offer, which ViewKit's own body then draws. */
@@ -29,5 +30,7 @@ export declare function partOf(rule: ViewKitRule, field: ViewsFilterPartBodyProp
29
30
  } | null;
30
31
  /** The kit filter's one rule as ViewKit's, naming the field and part the rule handed did; null where it holds none. */
31
32
  export declare function ruleBack(next: KitGroup, rule: ViewKitRule, kit: KitFields): ViewKitRule | null;
33
+ /** ViewKit's body for one part of a filter on the filter bar, its typed value the app's Input where the provider's `panelControls`
34
+ * names it (VK-1014). */
32
35
  export declare function MapFilterPartBody(props: ViewsFilterPartBodyProps): import("react/jsx-runtime").JSX.Element;
33
36
  export {};
@@ -8,11 +8,12 @@ import { useToldStep } from "../internal/told-step.js";
8
8
  import { HeaderBar } from "../phone-header/header-bar.js";
9
9
  import { pickerItemsOf, pickerWordsOf } from "../picker/map-picker.js";
10
10
  import { Picker } from "../picker/picker.js";
11
- import { SheetButton } from "../sheet/bottom-sheet.js";
12
11
  import { useFilterEditor } from "./filter-editor.js";
13
12
  import { kitFieldsOf, kitFilterOf, rulesFor, viewKitFilterOf, writeRules, CHOICE, RELATION_WAY } from "./map-rules.js";
14
13
  import { FilterPartBody } from "./parts.js";
15
14
  import { changeRule, fieldOf, isOwnWay, rulesOf } from "./rules.js";
15
+ import { PanelHeadButton } from "../internal/head-button.js";
16
+ import { PanelControlsFromViews } from "../internal/map-panel-controls.js";
16
17
  const BACK = ["M5 12l14 0", "M5 12l6 6", "M5 12l6 -6"];
17
18
  export function filterWordsOf(say) {
18
19
  return {
@@ -137,6 +138,9 @@ export function useMapFilterBody(p, words, say, AppIcon, wayWord) {
137
138
  return { kit, filter: read.filter, change: (next) => write(next), own: ownOf };
138
139
  }
139
140
  export function MapFilterBody(props) {
141
+ return _jsx(PanelControlsFromViews, { children: _jsx(FilterBodyInner, { ...props }) });
142
+ }
143
+ function FilterBodyInner(props) {
140
144
  const views = React.useContext(ViewsContext);
141
145
  const say = views?.messages ?? resolveViewsMessage;
142
146
  const words = React.useMemo(() => filterWordsOf(say), [say]);
@@ -148,10 +152,10 @@ export function MapFilterBody(props) {
148
152
  const { actions } = props;
149
153
  if (!actions)
150
154
  return _jsx(_Fragment, { children: parts.body });
151
- const done = actions.done && _jsx(SheetButton, { kind: "primary", "aria-label": actions.done.label, icon: glyph(TICK), onClick: actions.done.onPress });
155
+ const done = actions.done && _jsx(PanelHeadButton, { "data-slot": "vk-editor-save", kind: "primary", "aria-label": actions.done.label, icon: glyph(TICK), onClick: actions.done.onPress });
152
156
  return (_jsxs(_Fragment, { children: [parts.title !== undefined
153
- ? _jsx(BodyHead, { title: parts.title, left: _jsx(SheetButton, { "aria-label": words.back, className: "o-sheet-back", icon: glyph(BACK), onClick: parts.head.onBack }), right: done || _jsx("span", {}) })
154
- : _jsx(BodyHead, { title: props.label, left: _jsx(SheetButton, { "aria-label": actions.close.label, icon: glyph(X), onClick: actions.close.onPress }), right: done || _jsx("span", {}) }), parts.body] }));
157
+ ? _jsx(BodyHead, { title: parts.title, left: _jsx(PanelHeadButton, { "data-slot": "vk-editor-back", "aria-label": words.back, className: "o-sheet-back", icon: glyph(BACK), onClick: parts.head.onBack }), right: done || _jsx("span", {}) })
158
+ : _jsx(BodyHead, { title: props.label, left: _jsx(PanelHeadButton, { "data-slot": "vk-editor-close", "aria-label": actions.close.label, icon: glyph(X), onClick: actions.close.onPress }), right: done || _jsx("span", {}) }), parts.body] }));
155
159
  }
156
160
  export function partOf(rule, field, choices) {
157
161
  const kit = kitFieldsOf([field], choices), [f] = kit.fields, { filter } = kitFilterOf({ op: "and", items: [rule] }, kit);
@@ -166,6 +170,9 @@ export function ruleBack(next, rule, kit) {
166
170
  return { ...only, fieldKey: rule.fieldKey, ...(rule.part !== undefined ? { part: rule.part } : {}) };
167
171
  }
168
172
  export function MapFilterPartBody(props) {
173
+ return _jsx(PanelControlsFromViews, { children: _jsx(FilterPartBodyInner, { ...props }) });
174
+ }
175
+ function FilterPartBodyInner(props) {
169
176
  const views = React.useContext(ViewsContext);
170
177
  const say = views?.messages ?? resolveViewsMessage;
171
178
  const words = React.useMemo(() => filterWordsOf(say), [say]);
@@ -39,7 +39,7 @@ export function kitFieldsOf(fields, choices, relation) {
39
39
  }
40
40
  const values = type === "checkbox" ? CHECKED : CHOICE.has(type) ? choices(f.fieldKey, from, f.part) : undefined;
41
41
  at.set(value, place);
42
- return [{ value, label: f.label, type, ...(values ? { choices: values } : {}) }];
42
+ return [{ value, label: f.label, type, ...(values ? { choices: values } : {}), ...(f.integer ? { integer: true } : {}) }];
43
43
  };
44
44
  const own = (f, from) => field(f, f.key, { fieldKey: f.fieldKey, ...(f.part !== undefined ? { part: f.part } : {}) }, from);
45
45
  const relations = new Map();
@@ -36,11 +36,13 @@ export declare function valuePlaceholder(field: FilterField, w?: FilterEditorWor
36
36
  /** The body a Popover holds under the part of a filter pressed: the fields, its type's ways, or its value in its type's own. */
37
37
  export declare function FilterPartBody({ part, rule: ruleId, label, fields, filter, onFilterChange, onDone, own, form, words: given }: FilterPartProps): import("react/jsx-runtime").JSX.Element | null;
38
38
  /** A range's From and To: two Number fields, an en dash between, each named by its end; either may be left empty. */
39
- export declare function PairValue({ name, value, onValue, size, onKeyDown, words: given }: {
39
+ export declare function PairValue({ name, value, onValue, size, onKeyDown, words: given, slot }: {
40
40
  name: string;
41
41
  value: [number | null, number | null];
42
42
  onValue: (v: [number | null, number | null]) => void;
43
43
  size?: "sm" | "lg";
44
44
  onKeyDown?: (e: React.KeyboardEvent) => void;
45
45
  words?: Partial<FilterEditorWords>;
46
+ /** Its public name, on the pair: the filter bar's popover hands `vk-filter-part-pair` (VK-1003). */
47
+ slot?: string;
46
48
  }): import("react/jsx-runtime").JSX.Element;
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { DateEditor } from "../date-editor/date-editor.js";
4
- import { Input } from "../input/input.js";
4
+ import { usePanelControls } from "../internal/panel-controls.js";
5
5
  import { NumberField } from "../number-field/number-field.js";
6
6
  import { Picker } from "../picker/picker.js";
7
7
  import { itemLabel } from "../picker/rows.js";
@@ -52,7 +52,7 @@ export function FilterPartBody({ part, rule: ruleId, label, fields, filter, onFi
52
52
  return _jsx(Picker, { label: name, items: field.choices, multiple: several, value: value, form: form, onDone: onDone, ...words, onValueChange: (v) => set({ value: several ? (Array.isArray(v) ? v : []) : typeof v === "string" ? v : null }) });
53
53
  }
54
54
  if (takes === "two")
55
- return _jsx(PairValue, { name: name, value: isPair(r.value) ? r.value : [null, null], onValue: (v) => set({ value: v }), words: w, onKeyDown: (e) => { if (e.key === "Enter") {
55
+ return _jsx(PairValue, { name: name, value: isPair(r.value) ? r.value : [null, null], onValue: (v) => set({ value: v }), words: w, slot: "vk-filter-part-pair", onKeyDown: (e) => { if (e.key === "Enter") {
56
56
  e.preventDefault();
57
57
  onDone();
58
58
  } } });
@@ -60,16 +60,18 @@ export function FilterPartBody({ part, rule: ruleId, label, fields, filter, onFi
60
60
  return _jsx(DateEditor, { label: name, value: typeof r.value === "string" ? r.value : null, onValueChange: (v) => set({ value: v }), onDone: onDone, form: form });
61
61
  return _jsx(TypedValue, { rule: r, field: field, name: name, set: set, onDone: onDone, w: w });
62
62
  }
63
- export function PairValue({ name, value, onValue, size, onKeyDown, words: given }) {
63
+ export function PairValue({ name, value, onValue, size, onKeyDown, words: given, slot }) {
64
64
  const w = filterWords(given), [from, to] = value;
65
- return (_jsxs("div", { className: "o-filter-editor-pair", children: [_jsx(NumberField, { size: size, steppers: false, "aria-label": w.fromOf(name), placeholder: w.from, value: from, onValueChange: (v) => onValue([v ?? null, to]), onKeyDown: onKeyDown }), _jsx("span", { className: "o-filter-editor-dash", "aria-hidden": "true", children: "\u2013" }), _jsx(NumberField, { size: size, steppers: false, "aria-label": w.toOf(name), placeholder: w.to, value: to, onValueChange: (v) => onValue([from, v ?? null]), onKeyDown: onKeyDown })] }));
65
+ return (_jsxs("div", { className: "o-filter-editor-pair", ...(slot ? { "data-slot": slot } : {}), children: [_jsx(NumberField, { size: size, steppers: false, "aria-label": w.fromOf(name), placeholder: w.from, value: from, onValueChange: (v) => onValue([v ?? null, to]), onKeyDown: onKeyDown }), _jsx("span", { className: "o-filter-editor-dash", "aria-hidden": "true", children: "\u2013" }), _jsx(NumberField, { size: size, steppers: false, "aria-label": w.toOf(name), placeholder: w.to, value: to, onValueChange: (v) => onValue([from, v ?? null]), onKeyDown: onKeyDown })] }));
66
66
  }
67
+ const WHOLE = { maximumFractionDigits: 0 };
67
68
  function TypedValue({ rule: r, field, name, set, onDone, w }) {
68
69
  const enter = (e) => { if (e.key === "Enter") {
69
70
  e.preventDefault();
70
71
  onDone();
71
72
  } };
73
+ const { Input } = usePanelControls();
72
74
  return field.type === "number" || field.type === "range"
73
- ? _jsx(NumberField, { "aria-label": name, placeholder: valuePlaceholder(field, w), value: typeof r.value === "number" ? r.value : null, onValueChange: (v) => set({ value: v ?? null }), onKeyDown: enter })
74
- : _jsx(Input, { "aria-label": name, placeholder: valuePlaceholder(field, w), value: typeof r.value === "string" ? r.value : "", onChange: (e) => set({ value: e.target.value }), onKeyDown: enter });
75
+ ? _jsx(NumberField, { "data-slot": "vk-filter-part-value", "aria-label": name, placeholder: valuePlaceholder(field, w), value: typeof r.value === "number" ? r.value : null, format: field.integer ? WHOLE : undefined, onValueChange: (v) => set({ value: v ?? null }), onKeyDown: enter })
76
+ : _jsx(Input, { "data-slot": "vk-filter-part-value", "aria-label": name, placeholder: valuePlaceholder(field, w), value: typeof r.value === "string" ? r.value : "", onChange: (e) => set({ value: e.target.value }), onKeyDown: enter });
75
77
  }
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import * as React from "react";
4
- import { Button } from "../button/button.js";
4
+ import { usePanelControls } from "../internal/panel-controls.js";
5
5
  import { PhoneHost, phoneMark, usePhone } from "../internal/phone.js";
6
6
  import { useStepReturn } from "../internal/step-return.js";
7
7
  import { MENU_LIST_CARD_FRAME } from "../menu-list/looks.js";
@@ -18,6 +18,7 @@ function FieldsOnPhone(props) {
18
18
  }
19
19
  export function useGroupEditor(props) {
20
20
  const { label, fields, ownOrders = {}, group, values, onGroupChange, opens, orders = {}, manualOrder = true, steps = {} } = props;
21
+ const { Button } = usePanelControls();
21
22
  const w = groupWords(props.words), search = props.search ?? w.search;
22
23
  const NAMES = { field: w.groupBy, order: w.order, direction: w.direction, step: w.dateStep };
23
24
  const LEVEL_OF = Object.fromEntries(Object.entries(NAMES).map(([k, v]) => [v, k]));
@@ -58,28 +59,30 @@ export function useGroupEditor(props) {
58
59
  const dateSteps = group ? stepsOf(group.field) : [], heldStep = group?.step ?? dateSteps[0]?.value ?? "";
59
60
  const hideEmptyTo = (on) => { if (now.current)
60
61
  change({ ...now.current, hideEmpty: on }); };
62
+ const setting = (key) => ({ slot: "vk-group-setting", key });
63
+ const named = (cs) => cs.map((c) => ({ ...c, slot: { slot: "vk-group-choice", key: c.value } }));
61
64
  const settings = [
62
- { kind: "choices", icon: null, label: NAMES.field, value: group?.field ?? "", choices: [], detail: groupLabel(group, fields, w.none) },
65
+ { kind: "choices", icon: null, label: NAMES.field, value: group?.field ?? "", choices: [], detail: groupLabel(group, fields, w.none), slot: setting("field") },
63
66
  ...(group ? [
64
- { kind: "choices", icon: null, label: NAMES.order, value: group.order, choices: ordersOf(group.field) },
67
+ { kind: "choices", icon: null, label: NAMES.order, value: group.order, choices: ordersOf(group.field), slot: setting("order") },
65
68
  directionTurns(group)
66
- ? { kind: "choices", icon: null, label: NAMES.direction, value: group.direction, choices: DIRECTIONS }
67
- : { icon: null, label: NAMES.direction, disabled: w.ownNoDirection },
68
- ...(dateSteps.length ? [{ kind: "choices", icon: null, label: NAMES.step, value: heldStep, choices: dateSteps }] : []),
69
- { kind: "check", label: w.hideEmpty, checked: group.hideEmpty, onCheckedChange: hideEmptyTo },
69
+ ? { kind: "choices", icon: null, label: NAMES.direction, value: group.direction, choices: DIRECTIONS, slot: setting("direction") }
70
+ : { icon: null, label: NAMES.direction, disabled: w.ownNoDirection, slot: setting("direction") },
71
+ ...(dateSteps.length ? [{ kind: "choices", icon: null, label: NAMES.step, value: heldStep, choices: dateSteps, slot: setting("step") }] : []),
72
+ { kind: "check", label: w.hideEmpty, checked: group.hideEmpty, onCheckedChange: hideEmptyTo, slot: setting("empty") },
70
73
  ] : []),
71
74
  ];
72
75
  const opened = (e) => { if ("label" in e && LEVEL_OF[e.label])
73
76
  open(LEVEL_OF[e.label]); };
74
77
  const groups = group ? orderedGroups(values, group).map((v) => ({ kind: "check", label: v.label, icon: v.mark, checked: !group.hidden.includes(v.value), grip: true,
75
- onCheckedChange: (on) => { if (now.current)
78
+ slot: { slot: "vk-group-value", key: v.value }, onCheckedChange: (on) => { if (now.current)
76
79
  change(setGroupShown(now.current, v.value, on)); } })) : [];
77
80
  const move = (from, to) => { if (now.current)
78
81
  change(moveGroup(now.current, values, from, to)); };
79
82
  const none = !!group && noneShown(group, values);
80
- const heading = (_jsxs("div", { className: "o-group-editor-heading", children: [_jsx("p", { className: "o-list-heading", children: w.groups }), _jsx(Button, { kind: "link", size: "line", onClick: () => { if (now.current)
83
+ const heading = (_jsxs("div", { className: "o-group-editor-heading", "data-slot": "vk-group-heading", children: [_jsx("p", { className: "o-list-heading", children: w.groups }), _jsx(Button, { kind: "link", size: "line", "data-slot": "vk-group-hide-all", onClick: () => { if (now.current)
81
84
  change(none ? showAllGroups(now.current) : hideAllGroups(now.current, values)); }, children: none ? w.showAll : w.hideAll })] }));
82
- const removeRow = { icon: null, label: w.remove, danger: true, onSelect: () => { change(null); setLevel(null); setFocusTo(NAMES.field); } };
85
+ const removeRow = { icon: null, label: w.remove, danger: true, slot: { slot: "vk-group-remove" }, onSelect: () => { change(null); setLevel(null); setFocusTo(NAMES.field); } };
83
86
  const foot = [{ kind: "separator" }, removeRow];
84
87
  const pickField = (v) => {
85
88
  if (v !== now.current?.field)
@@ -97,9 +100,9 @@ export function useGroupEditor(props) {
97
100
  back();
98
101
  };
99
102
  const choices = (which) => group
100
- ? [which === "order" ? { kind: "pick", value: group.order, choices: ordersOf(group.field), onChoose: pick(which) }
101
- : which === "direction" ? { kind: "pick", value: group.direction, choices: DIRECTIONS, onChoose: pick(which) }
102
- : { kind: "pick", value: heldStep, choices: dateSteps, onChoose: pick(which) }]
103
+ ? [which === "order" ? { kind: "pick", value: group.order, choices: named(ordersOf(group.field)), onChoose: pick(which) }
104
+ : which === "direction" ? { kind: "pick", value: group.direction, choices: named(DIRECTIONS), onChoose: pick(which) }
105
+ : { kind: "pick", value: heldStep, choices: named(dateSteps), onChoose: pick(which) }]
103
106
  : [];
104
107
  const at = level && (level === "field" || group) ? level : null;
105
108
  const form = phone ? "phone" : "computer";
@@ -118,7 +121,7 @@ export function useGroupEditor(props) {
118
121
  }
119
122
  const fieldLevel = at === "field" ? openLevels(fields, fieldLevels).slice(-1)[0] : undefined;
120
123
  const step = fieldLevel ? `field:${fieldLevels.join(">")}` : at ?? "settings";
121
- const body = (_jsx("div", { ref: placeRoot, className: "o-group-editor", "data-kit": "group-editor", "data-group-form": form, "data-group-level": at ?? "settings", ...phoneMark(!!screen || small), ...MENU_LIST_CARD_FRAME, children: phone ? _jsx(SheetStep, { step: step, back: wentBack, children: _jsx("div", { className: "o-group-editor-step", children: content }) }) : content }));
124
+ const body = (_jsx("div", { ref: placeRoot, className: "o-group-editor", "data-slot": "vk-group", "data-kit": "group-editor", "data-group-form": form, "data-group-level": at ?? "settings", ...phoneMark(!!screen || small), ...MENU_LIST_CARD_FRAME, children: phone ? _jsx(SheetStep, { step: step, back: wentBack, children: _jsx("div", { className: "o-group-editor-step", children: content }) }) : content }));
122
125
  return { body, level: fieldLevel ? { name: fieldLevel.label, back: backField } : at ? { name: NAMES[at], back } : null };
123
126
  }
124
127
  export function GroupEditor(props) {
@@ -16,4 +16,5 @@ export declare function kitGroupValuesOf(group: ViewsGroupValue, noValue: string
16
16
  export declare function viewKitGroupOf(next: ListGroup | null, now: ViewsGroupValue, dated?: boolean): ViewsGroupValue;
17
17
  /** ViewKit's group body's props as the group editor's. */
18
18
  export declare function groupEditorPropsOf(p: ViewsGroupBodyProps, words: GroupEditorWords): GroupEditorProps;
19
+ /** ViewKit's group editor, drawing the app's controls where the provider's `panelControls` names them (VK-1014). */
19
20
  export declare function MapGroupBody(props: ViewsGroupBodyProps): import("react/jsx-runtime").JSX.Element;
@@ -1,8 +1,9 @@
1
1
  "use client";
2
- import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
2
+ import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
3
3
  import * as React from "react";
4
4
  import { resolveViewsMessage } from "../../contract.js";
5
5
  import { ViewsContext } from "../../provider/context.js";
6
+ import { PanelControlsFromViews } from "../internal/map-panel-controls.js";
6
7
  import { useToldStep } from "../internal/told-step.js";
7
8
  import { pickerWordsOf } from "../picker/map-picker.js";
8
9
  import { useGroupEditor } from "./group-editor.js";
@@ -97,6 +98,9 @@ export function groupEditorPropsOf(p, words) {
97
98
  };
98
99
  }
99
100
  export function MapGroupBody(props) {
101
+ return _jsx(PanelControlsFromViews, { children: _jsx(GroupBodyInner, { ...props }) });
102
+ }
103
+ function GroupBodyInner(props) {
100
104
  const views = React.useContext(ViewsContext);
101
105
  const messages = views?.messages ?? resolveViewsMessage;
102
106
  const words = React.useMemo(() => groupEditorWordsOf(messages), [messages]);
@@ -46,6 +46,7 @@ export { COMPUTER_HOST, ComputerHost, PHONE_MARK, PhoneHost, PhoneLine, phoneMar
46
46
  export { drawnAt, focusWhereItStands, focusesInPlace, holdsThePage, keepsToItsList, overflows, scaleOf, scrollInList, scrollTopFor, scrollTopForDrag, staysInView, tapsInPlace, typesInto, } from "./internal/scroll.js";
47
47
  export { ContextMenu, Menu, MenuDots, useSheetMenus, type MenuChangeDetails, type MenuProps, type MenuWords, } from "./menu/menu.js";
48
48
  export { MapMenu, menuEntries } from "./menu/map-menu.js";
49
+ export { MapSelect } from "./select/map-select.js";
49
50
  export { Avatar, AvatarStack, initials, toneOf, type AvatarColour, type AvatarPresence, type AvatarProps, type AvatarSize, type AvatarStackPerson, type AvatarStackProps, } from "./avatar/avatar.js";
50
51
  export { PICKER_WORDS, Picker, PickerUnder, usePicker, type PickerAction, type PickerBoxSearch, type PickerDoing, type PickerLead, type PickerParts, type PickerProps, type PickerUnderProps, type PickerWords, } from "./picker/picker.js";
51
52
  export { exactMatch, findItem, fold, itemLabel, openLevels, orderMoved, pickerRows, searchShown, type PickerAs, type PickerItem, type PickerRow, type RowsInput, } from "./picker/rows.js";
@@ -133,3 +134,4 @@ export { LINKS_EDITOR_WORDS, linksWords, type LinksEditorWords } from "./links-e
133
134
  export { TagField, type TagFieldProps } from "./tag-field/tag-field.js";
134
135
  export { SettingChevron, SettingIcon, SettingRow, SettingRows, SwitchRow, SwitchRows, useSettingRowWorn, useSettingRowsRow, type SettingAction, type SettingRowProps, type SettingRowsProps, type SettingState, type SwitchRowProps } from "./setting-row/setting-row.js";
135
136
  export { SETTING_ROW_ATTRS, settingRowWornOf } from "./setting-row/looks.js";
137
+ export type { PartSlot } from "./internal/part-slot.js";
@@ -40,6 +40,7 @@ export { COMPUTER_HOST, ComputerHost, PHONE_MARK, PhoneHost, PhoneLine, phoneMar
40
40
  export { drawnAt, focusWhereItStands, focusesInPlace, holdsThePage, keepsToItsList, overflows, scaleOf, scrollInList, scrollTopFor, scrollTopForDrag, staysInView, tapsInPlace, typesInto, } from "./internal/scroll.js";
41
41
  export { ContextMenu, Menu, MenuDots, useSheetMenus, } from "./menu/menu.js";
42
42
  export { MapMenu, menuEntries } from "./menu/map-menu.js";
43
+ export { MapSelect } from "./select/map-select.js";
43
44
  export { Avatar, AvatarStack, initials, toneOf, } from "./avatar/avatar.js";
44
45
  export { PICKER_WORDS, Picker, PickerUnder, usePicker, } from "./picker/picker.js";
45
46
  export { exactMatch, findItem, fold, itemLabel, openLevels, orderMoved, pickerRows, searchShown, } from "./picker/rows.js";
@@ -17,7 +17,8 @@ export function pressGroup(e) {
17
17
  const on = e.target;
18
18
  if (on.closest(".o-input-segment"))
19
19
  return;
20
- const control = e.currentTarget.querySelector(":scope > .o-input-control") ?? e.currentTarget.querySelector(".o-input-segment");
20
+ const control = e.currentTarget.querySelector(":scope > .o-input-control") ?? e.currentTarget.querySelector(".o-input-segment")
21
+ ?? e.currentTarget.querySelector("input:not([type='hidden']):not([type='checkbox']):not([type='radio'])");
21
22
  if (e.defaultPrevented || !control || on.closest("a, input, textarea, select"))
22
23
  return;
23
24
  if (on.closest("button, [role='button']")) {
@@ -102,9 +103,9 @@ export const Input = React.forwardRef(function Input({ size = "md", numeric = fa
102
103
  const start = long && field && !set && minLines ? { minHeight: `calc(1lh * ${minLines} + var(--vk-spacing) * 4 + var(--vk-border-width) * 2)` } : undefined;
103
104
  const control = (attrs) => (_jsx(Control, { ref: refs, ...attrs, ...(long ? { render: _jsx("textarea", {}) } : {}), ...(set ? { rows: lines } : {}), ...props, ...fill(autofill) }));
104
105
  if (field) {
105
- const { "data-force": force, ...rest } = props;
106
+ const { "data-force": force, "data-slot": slot, "data-key": key, ...rest } = props;
106
107
  props = rest;
107
- return (_jsxs("span", { className: cx("o-input o-input-lone", inRow ? "o-input-inrow" : "o-smooth o-smooth-ease", sized(size), long && "o-input-long", grows && "o-input-grow", className), style: start || style ? { ...start, ...style } : undefined, "data-kit": "input", ...phoneMark(phone), ...(force != null ? { "data-force": force } : {}), ...(look ? inputOwnAttrs(look) : {}), onMouseDown: (e) => {
108
+ return (_jsxs("span", { className: cx("o-input o-input-lone", inRow ? "o-input-inrow" : "o-smooth o-smooth-ease", sized(size), long && "o-input-long", grows && "o-input-grow", className), style: start || style ? { ...start, ...style } : undefined, "data-kit": "input", ...phoneMark(phone), ...(force != null ? { "data-force": force } : {}), ...(slot != null ? { "data-slot": slot } : {}), ...(key != null ? { "data-key": key } : {}), ...(look ? inputOwnAttrs(look) : {}), onMouseDown: (e) => {
108
109
  const box = own.current;
109
110
  if (e.target !== e.currentTarget || !box || box.disabled)
110
111
  return;