viewkitjs 0.38.0 → 0.40.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 (309) hide show
  1. package/CHANGELOG.md +134 -0
  2. package/MIGRATION.md +32 -0
  3. package/fields/dist/derived.d.ts +7 -0
  4. package/fields/dist/derived.js +4 -0
  5. package/fields/dist/index.d.ts +1 -1
  6. package/fields/dist/index.js +1 -1
  7. package/fields/dist/messages.d.ts +5 -1
  8. package/fields/dist/messages.js +3 -0
  9. package/fields/dist/query/evaluate.d.ts +7 -1
  10. package/fields/dist/query/evaluate.js +8 -5
  11. package/fields/dist/query/figure-kinds.d.ts +2 -2
  12. package/fields/dist/query/figure-kinds.js +3 -0
  13. package/fields/dist/query/figures.d.ts +5 -3
  14. package/fields/dist/query/figures.js +13 -0
  15. package/fields/dist/query/filter.d.ts +7 -0
  16. package/fields/dist/query/filter.js +7 -1
  17. package/fields/dist/query/kit.d.ts +3 -2
  18. package/fields/dist/query/kit.js +1 -1
  19. package/fields/dist/query/layer.d.ts +6 -0
  20. package/fields/dist/query/layer.js +3 -0
  21. package/fields/dist/query/number.d.ts +3 -2
  22. package/fields/dist/query/number.js +5 -3
  23. package/fields/dist/query/read-rule.d.ts +1 -1
  24. package/fields/dist/query/read-rule.js +3 -0
  25. package/fields/docs/guides/queries.md +28 -24
  26. package/fields/docs/reference/fields.md +1 -0
  27. package/fields/docs/reference/query.md +9 -7
  28. package/package.json +2 -4
  29. package/postgres/dist/check.js +3 -1
  30. package/postgres/dist/definitions/storage.d.ts +3 -1
  31. package/postgres/dist/definitions/storage.js +3 -1
  32. package/postgres/dist/definitions/stored.js +13 -2
  33. package/postgres/dist/map.d.ts +5 -1
  34. package/postgres/dist/map.js +4 -0
  35. package/postgres/dist/records.js +6 -1
  36. package/postgres/docs/guides/definitions.md +1 -1
  37. package/postgres/docs/guides/field-map.md +3 -3
  38. package/postgres/docs/reference/postgres.md +1 -1
  39. package/views/dist/atoms/HeaderChrome.d.ts +7 -0
  40. package/views/dist/atoms/HeaderChrome.js +15 -0
  41. package/views/dist/atoms/ToolbarButton.d.ts +1 -1
  42. package/views/dist/atoms/ToolbarButton.js +2 -2
  43. package/views/dist/atoms/defaults.js +4 -0
  44. package/views/dist/atoms/types.d.ts +39 -2
  45. package/views/dist/contract.d.ts +38 -9
  46. package/views/dist/contract.js +64 -6
  47. package/views/dist/controls/avatar.css +1 -1
  48. package/views/dist/controls/customize/map-customize-body.js +1 -1
  49. package/views/dist/controls/field/field.d.ts +2 -14
  50. package/views/dist/controls/field/field.js +4 -9
  51. package/views/dist/controls/field/looks.d.ts +1 -1
  52. package/views/dist/controls/field/looks.js +7 -3
  53. package/views/dist/controls/field/tokens.d.ts +4 -0
  54. package/views/dist/controls/field/tokens.js +1 -0
  55. package/views/dist/controls/field.css +33 -0
  56. package/views/dist/controls/filter-editor/block.d.ts +3 -1
  57. package/views/dist/controls/filter-editor/block.js +4 -3
  58. package/views/dist/controls/filter-editor/filter-editor.d.ts +15 -2
  59. package/views/dist/controls/filter-editor/filter-editor.js +49 -16
  60. package/views/dist/controls/filter-editor/how.d.ts +11 -1
  61. package/views/dist/controls/filter-editor/map-filter-body.d.ts +4 -2
  62. package/views/dist/controls/filter-editor/map-filter-body.js +21 -11
  63. package/views/dist/controls/filter-editor/map-rules.d.ts +6 -4
  64. package/views/dist/controls/filter-editor/map-rules.js +7 -4
  65. package/views/dist/controls/filter-editor/parts.d.ts +14 -1
  66. package/views/dist/controls/filter-editor/parts.js +14 -0
  67. package/views/dist/controls/filter-editor.css +4 -1
  68. package/views/dist/controls/index.d.ts +0 -3
  69. package/views/dist/controls/index.js +0 -3
  70. package/views/dist/controls/input.css +1 -1
  71. package/views/dist/controls/internal/menu-items.d.ts +2 -0
  72. package/views/dist/controls/internal/menu-items.js +1 -1
  73. package/views/dist/controls/internal/part-slot.d.ts +1 -1
  74. package/views/dist/controls/internal/part-slot.js +1 -1
  75. package/views/dist/controls/internal/row-actions.d.ts +33 -0
  76. package/views/dist/controls/internal/row-actions.js +28 -0
  77. package/views/dist/controls/menu/map-menu.js +1 -1
  78. package/views/dist/controls/menu-list.css +1 -1
  79. package/views/dist/controls/picker/looks.d.ts +1 -1
  80. package/views/dist/controls/picker.css +2 -2
  81. package/views/dist/controls/popover/map-popover.d.ts +1 -1
  82. package/views/dist/controls/popover/map-popover.js +2 -2
  83. package/views/dist/controls/press.css +0 -1
  84. package/views/dist/controls/radio/radio.d.ts +1 -1
  85. package/views/dist/controls/radio/radio.js +1 -16
  86. package/views/dist/controls/sheet/bottom-sheet.d.ts +2 -2
  87. package/views/dist/controls/sheet/bottom-sheet.js +31 -24
  88. package/views/dist/controls/sheet/map-sheet.js +9 -6
  89. package/views/dist/controls/sort-editor/map-sort-body.js +1 -0
  90. package/views/dist/controls/sort-editor/sort-editor.d.ts +5 -1
  91. package/views/dist/controls/sort-editor/sort-editor.js +41 -13
  92. package/views/dist/controls/text-editor.css +22 -0
  93. package/views/dist/controls/tokens.js +0 -6
  94. package/views/dist/controls/toolbar/toolbar.js +2 -2
  95. package/views/dist/controls/toolbar-button/atom-toolbar-button.d.ts +1 -1
  96. package/views/dist/controls/toolbar-button/atom-toolbar-button.js +2 -2
  97. package/views/dist/editors/EditorPanel.js +1 -1
  98. package/views/dist/field-row/FieldRow.js +38 -16
  99. package/views/dist/field-row/editors/RowChipsEditor.js +3 -1
  100. package/views/dist/field-row/editors/RowDateEditor.js +3 -1
  101. package/views/dist/field-row/editors/RowNameEditor.js +3 -1
  102. package/views/dist/field-row/editors/RowPlaceEditor.js +4 -2
  103. package/views/dist/field-row/editors/RowRangeEditor.js +3 -1
  104. package/views/dist/field-row/editors/RowRelationEditor.js +5 -2
  105. package/views/dist/field-row/editors/RowSelectEditor.js +3 -1
  106. package/views/dist/field-row/editors/RowTextEditor.d.ts +7 -1
  107. package/views/dist/field-row/editors/RowTextEditor.js +28 -4
  108. package/views/dist/field-row/editors/RowValueListEditor.js +4 -4
  109. package/views/dist/field-row/editors/row-place.d.ts +33 -0
  110. package/views/dist/field-row/editors/row-place.js +141 -0
  111. package/views/dist/field-row/field-row-button.d.ts +9 -6
  112. package/views/dist/field-row/field-row-button.js +3 -3
  113. package/views/dist/field-row/row-target.d.ts +4 -1
  114. package/views/dist/field-row/row-target.js +1 -1
  115. package/views/dist/filters/duration-bound.d.ts +7 -0
  116. package/views/dist/filters/duration-bound.js +9 -0
  117. package/views/dist/filters/filter-model.d.ts +4 -0
  118. package/views/dist/filters/number-refused.d.ts +8 -0
  119. package/views/dist/filters/number-refused.js +4 -0
  120. package/views/dist/grid/chrome/GridAggregateMenu.d.ts +12 -11
  121. package/views/dist/grid/chrome/GridAggregateMenu.js +4 -3
  122. package/views/dist/grid/chrome/GridFooter.d.ts +12 -4
  123. package/views/dist/grid/chrome/GridFooter.js +11 -9
  124. package/views/dist/grid/chrome/GridHeader.js +4 -3
  125. package/views/dist/grid/chrome/GridResizeHandle.d.ts +7 -3
  126. package/views/dist/grid/chrome/GridResizeHandle.js +2 -3
  127. package/views/dist/grid/chrome/GridTable.js +1 -1
  128. package/views/dist/grid/chrome/GridTableSurface.js +1 -1
  129. package/views/dist/grid/chrome/grid-body-place.d.ts +2 -4
  130. package/views/dist/grid/chrome/grid-body-place.js +4 -5
  131. package/views/dist/grid/chrome/grid-figure-value.js +10 -4
  132. package/views/dist/grid/chrome/grid-table-props.d.ts +15 -4
  133. package/views/dist/grid/chrome/useGridTableInteractionModel.js +12 -2
  134. package/views/dist/grid/core/clipboard-model.js +42 -8
  135. package/views/dist/grid/core/commit-model.d.ts +3 -0
  136. package/views/dist/grid/core/editing-controller.d.ts +29 -1
  137. package/views/dist/grid/core/editing-controller.js +142 -12
  138. package/views/dist/grid/core/pending-reconciliation.d.ts +14 -0
  139. package/views/dist/grid/core/pending-reconciliation.js +20 -8
  140. package/views/dist/grid/core/save-path.d.ts +4 -2
  141. package/views/dist/grid/core/save-path.js +1 -1
  142. package/views/dist/grid/core/spreadsheet-operations.js +43 -5
  143. package/views/dist/grid/core/useGridEditing.d.ts +5 -1
  144. package/views/dist/grid/core/useGridEditing.js +4 -4
  145. package/views/dist/grid/core/written-alongside.d.ts +16 -0
  146. package/views/dist/grid/core/written-alongside.js +30 -0
  147. package/views/dist/grid/grid.css +8 -4
  148. package/views/dist/grid/index.d.ts +1 -1
  149. package/views/dist/grid/looks.d.ts +2 -2
  150. package/views/dist/internal/before-paint.d.ts +5 -0
  151. package/views/dist/internal/before-paint.js +17 -0
  152. package/views/dist/internal/field-rows.d.ts +0 -8
  153. package/views/dist/internal/field-rows.js +1 -3
  154. package/views/dist/internal/over-cell.d.ts +8 -0
  155. package/views/dist/internal/over-cell.js +5 -0
  156. package/views/dist/list/bar-keys.d.ts +8 -0
  157. package/views/dist/list/bar-keys.js +3 -0
  158. package/views/dist/list/bar-parts.d.ts +27 -0
  159. package/views/dist/list/bar-parts.js +38 -0
  160. package/views/dist/list/buttons/clear-save.d.ts +7 -0
  161. package/views/dist/list/buttons/clear-save.js +19 -0
  162. package/views/dist/list/buttons/customize.d.ts +28 -0
  163. package/views/dist/list/buttons/customize.js +31 -0
  164. package/views/dist/list/buttons/filter.d.ts +32 -0
  165. package/views/dist/list/buttons/filter.js +60 -0
  166. package/views/dist/list/buttons/new.d.ts +18 -0
  167. package/views/dist/list/buttons/new.js +21 -0
  168. package/views/dist/list/buttons/quick.d.ts +15 -0
  169. package/views/dist/list/buttons/quick.js +24 -0
  170. package/views/dist/list/buttons/search.d.ts +18 -0
  171. package/views/dist/list/buttons/search.js +17 -0
  172. package/views/dist/list/buttons/shared.d.ts +97 -0
  173. package/views/dist/list/buttons/shared.js +137 -0
  174. package/views/dist/list/buttons/sort-filter.d.ts +6 -0
  175. package/views/dist/list/buttons/sort-filter.js +16 -0
  176. package/views/dist/list/buttons/sort.d.ts +17 -0
  177. package/views/dist/list/buttons/sort.js +34 -0
  178. package/views/dist/list/buttons/views.d.ts +21 -0
  179. package/views/dist/list/buttons/views.js +38 -0
  180. package/views/dist/list/editor-menus.d.ts +13 -0
  181. package/views/dist/list/editor-menus.js +13 -0
  182. package/views/dist/list/edits.d.ts +3 -1
  183. package/views/dist/list/index.d.ts +41 -0
  184. package/views/dist/list/index.js +19 -0
  185. package/views/dist/list/layer.d.ts +13 -3
  186. package/views/dist/list/layer.js +13 -3
  187. package/views/dist/list/line.d.ts +58 -0
  188. package/views/dist/list/line.js +229 -0
  189. package/views/dist/list/list.d.ts +7 -1
  190. package/views/dist/list/list.js +2 -2
  191. package/views/dist/list/pane-box.d.ts +6 -0
  192. package/views/dist/list/pane-box.js +15 -0
  193. package/views/dist/list/panels/customize.d.ts +8 -0
  194. package/views/dist/list/panels/customize.js +23 -0
  195. package/views/dist/list/panels/filter-bar.d.ts +12 -0
  196. package/views/dist/list/panels/filter-bar.js +73 -0
  197. package/views/dist/list/panels/filter.d.ts +8 -0
  198. package/views/dist/list/panels/filter.js +23 -0
  199. package/views/dist/list/panels/quick.d.ts +7 -0
  200. package/views/dist/list/panels/quick.js +16 -0
  201. package/views/dist/list/panels/shared.d.ts +26 -0
  202. package/views/dist/list/panels/shared.js +36 -0
  203. package/views/dist/list/panels/sort.d.ts +8 -0
  204. package/views/dist/list/panels/sort.js +19 -0
  205. package/views/dist/list/panels/views.d.ts +13 -0
  206. package/views/dist/list/panels/views.js +27 -0
  207. package/views/dist/list/ready.d.ts +35 -0
  208. package/views/dist/list/ready.js +7 -0
  209. package/views/dist/list/root-base.d.ts +19 -1
  210. package/views/dist/list/root-base.js +13 -3
  211. package/views/dist/list/root.d.ts +1 -1
  212. package/views/dist/list/root.js +2 -2
  213. package/views/dist/list/store.d.ts +29 -0
  214. package/views/dist/list/store.js +48 -2
  215. package/views/dist/list/toolbar-model.d.ts +99 -0
  216. package/views/dist/list/toolbar-model.js +195 -0
  217. package/views/dist/list/toolbar.js +142 -329
  218. package/views/dist/list/views-axis.js +15 -4
  219. package/views/dist/list/views.d.ts +1 -1
  220. package/views/dist/list/views.js +4 -1
  221. package/views/dist/looks/index.d.ts +0 -1
  222. package/views/dist/looks/index.js +0 -1
  223. package/views/dist/looks/looks.d.ts +1 -1
  224. package/views/dist/looks/pieces.js +0 -2
  225. package/views/dist/model/aggregates.d.ts +18 -8
  226. package/views/dist/model/aggregates.js +16 -22
  227. package/views/dist/model/column-filters.js +10 -3
  228. package/views/dist/model/view-rules.js +1 -0
  229. package/views/dist/panels/filter/NumberFilterBody.js +6 -8
  230. package/views/dist/panels/labels.js +7 -2
  231. package/views/dist/panels/model.d.ts +3 -0
  232. package/views/dist/panels/react/filter/FilterEditor.d.ts +3 -1
  233. package/views/dist/panels/react/filter/FilterEditor.js +2 -2
  234. package/views/dist/panels/react/filter/filter-body.d.ts +3 -1
  235. package/views/dist/panels/react/filter/filter-body.js +7 -3
  236. package/views/dist/panels/react/sort/SortEditor.d.ts +3 -1
  237. package/views/dist/panels/react/sort/SortEditor.js +4 -4
  238. package/views/dist/panels/react/toolbar/Toolbar.d.ts +80 -3
  239. package/views/dist/panels/react/toolbar/Toolbar.js +85 -52
  240. package/views/dist/panels/react/toolbar/ToolbarBarSorts.d.ts +9 -0
  241. package/views/dist/panels/react/toolbar/ToolbarBarSorts.js +84 -0
  242. package/views/dist/panels/react/toolbar/ToolbarButton.d.ts +1 -1
  243. package/views/dist/panels/react/toolbar/ToolbarButton.js +5 -3
  244. package/views/dist/panels/react/toolbar/ToolbarFilterAdd.d.ts +4 -1
  245. package/views/dist/panels/react/toolbar/ToolbarFilterAdd.js +2 -2
  246. package/views/dist/panels/react/toolbar/ToolbarOptions.d.ts +30 -0
  247. package/views/dist/panels/react/toolbar/ToolbarOptions.js +6 -1
  248. package/views/dist/panels/react/toolbar/ToolbarSortPill.d.ts +5 -0
  249. package/views/dist/panels/react/toolbar/ToolbarSortPill.js +6 -4
  250. package/views/dist/panels/react/toolbar/ToolbarViews.d.ts +7 -1
  251. package/views/dist/panels/react/toolbar/ToolbarViews.js +4 -4
  252. package/views/dist/panels/react/toolbar/context.d.ts +4 -0
  253. package/views/dist/panels/react/toolbar/context.js +1 -0
  254. package/views/dist/panels/react/toolbar/sheet-host.d.ts +3 -0
  255. package/views/dist/panels/react/toolbar/sheet-host.js +6 -0
  256. package/views/dist/panels/react/toolbar/use-give-way.d.ts +6 -0
  257. package/views/dist/panels/react/toolbar/use-give-way.js +10 -3
  258. package/views/dist/panels/react/views-row/ViewPicker.d.ts +8 -1
  259. package/views/dist/panels/react/views-row/ViewPicker.js +12 -7
  260. package/views/dist/panels/settings/filter-groups.js +12 -0
  261. package/views/dist/panels/settings/input.d.ts +11 -0
  262. package/views/dist/panels/settings/layout.js +26 -0
  263. package/views/dist/panels/settings/person.d.ts +15 -0
  264. package/views/dist/panels/settings/person.js +6 -0
  265. package/views/dist/panels/toolbar/page-resets.js +14 -3
  266. package/views/dist/provider/components.d.ts +47 -4
  267. package/views/dist/react.d.ts +1 -1
  268. package/views/dist/styles.css +116 -257
  269. package/views/dist/styles.unlayered.css +116 -257
  270. package/views/docs/contract.md +28 -18
  271. package/views/docs/controls/field.md +2 -1
  272. package/views/docs/controls/filter-editor.md +1 -1
  273. package/views/docs/controls/menu.md +1 -1
  274. package/views/docs/controls/sort-editor.md +1 -1
  275. package/views/docs/guides/atoms.md +1 -0
  276. package/views/docs/guides/looks.md +1 -1
  277. package/views/docs/guides/the-grid.md +6 -4
  278. package/views/docs/guides/toolbar-parts.md +337 -0
  279. package/views/docs/index.md +4 -0
  280. package/views/docs/reference/controls.md +6 -44
  281. package/views/docs/reference/field-row.md +1 -1
  282. package/views/docs/reference/grid.md +8 -7
  283. package/views/docs/reference/list.md +184 -11
  284. package/views/docs/reference/looks.md +13 -16
  285. package/views/docs/reference/panels-react.md +7 -7
  286. package/views/docs/reference/panels.md +1 -1
  287. package/views/docs/reference/react.md +14 -11
  288. package/views/docs/reference/views.md +9 -7
  289. package/views/skills/views/SKILL.md +2 -1
  290. package/views/dist/controls/setting-row/looks.d.ts +0 -10
  291. package/views/dist/controls/setting-row/looks.js +0 -22
  292. package/views/dist/controls/setting-row/setting-row.d.ts +0 -102
  293. package/views/dist/controls/setting-row/setting-row.js +0 -135
  294. package/views/dist/controls/setting-row/tokens.d.ts +0 -156
  295. package/views/dist/controls/setting-row/tokens.js +0 -41
  296. package/views/dist/controls/setting-row.css +0 -216
  297. package/views/dist/controls/switch-row/switch-row.d.ts +0 -1
  298. package/views/dist/controls/switch-row/switch-row.js +0 -1
  299. package/views/dist/controls/switch-row/tokens.d.ts +0 -39
  300. package/views/dist/controls/switch-row/tokens.js +0 -12
  301. package/views/dist/controls/switch-row.css +0 -35
  302. package/views/dist/controls/tag-field/tag-field.d.ts +0 -24
  303. package/views/dist/controls/tag-field/tag-field.js +0 -25
  304. package/views/dist/controls/tag-field/tokens.d.ts +0 -23
  305. package/views/dist/controls/tag-field/tokens.js +0 -8
  306. package/views/dist/controls/tag-field.css +0 -32
  307. package/views/docs/controls/setting-row.md +0 -44
  308. package/views/docs/controls/switch-row.md +0 -15
  309. package/views/docs/controls/tag-field.md +0 -11
@@ -6,29 +6,70 @@ export type { ListAnswerState } from "./answer.js";
6
6
  export { ListBulkBar } from "./bulk-bar.js";
7
7
  export type { ListBulkBarProps } from "./bulk-bar.js";
8
8
  export type { ListChange } from "../grid/core/commit-model.js";
9
+ export { ListClearSave } from "./buttons/clear-save.js";
10
+ export type { ListClearSaveProps } from "./buttons/clear-save.js";
9
11
  export type { ListColumnOverride } from "./columns.js";
10
12
  export type { ListColumnsOverride } from "./columns.js";
13
+ export { ListCustomize } from "./buttons/customize.js";
14
+ export { ListCustomizePanel } from "./panels/customize.js";
15
+ export type { ListCustomizePanelProps } from "./panels/customize.js";
16
+ export type { ListCustomizeProps } from "./buttons/customize.js";
11
17
  export type { ListData } from "./root.js";
18
+ export { ListEditorMenus } from "./editor-menus.js";
19
+ export type { ListEditorMenusProps } from "./editor-menus.js";
12
20
  export type { ListFieldsRegistry } from "./columns.js";
13
21
  export { ListFill } from "./slot.js";
14
22
  export type { ListFillProps } from "./slot.js";
23
+ export { ListFilter } from "./buttons/filter.js";
24
+ export { ListFilterBar } from "./panels/filter-bar.js";
25
+ export type { ListFilterBarProps } from "./panels/filter-bar.js";
26
+ export { ListFilterPanel } from "./panels/filter.js";
27
+ export type { ListFilterPanelProps } from "./panels/filter.js";
28
+ export type { ListFilterProps } from "./buttons/filter.js";
29
+ export { ListGap } from "./line.js";
30
+ export type { ListGapProps } from "./line.js";
15
31
  export { ListGrid } from "./grid.js";
16
32
  export type { ListGridProps } from "./grid.js";
33
+ export { ListLine } from "./line.js";
34
+ export type { ListLineProps } from "./line.js";
17
35
  export type { ListMenus } from "./menu.js";
36
+ export { ListNew } from "./buttons/new.js";
37
+ export type { ListNewProps } from "./buttons/new.js";
38
+ export type { ListOpens } from "./buttons/shared.js";
39
+ export { ListPaneBox } from "./pane-box.js";
40
+ export type { ListPaneBoxProps } from "./pane-box.js";
41
+ export type { ListPanelShows } from "./panels/shared.js";
18
42
  export type { ListProps } from "./list.js";
43
+ export { ListQuickFilters } from "./buttons/quick.js";
44
+ export { ListQuickFiltersPanel } from "./panels/quick.js";
45
+ export type { ListQuickFiltersPanelProps } from "./panels/quick.js";
46
+ export type { ListQuickFiltersProps } from "./buttons/quick.js";
19
47
  export { ListRoot } from "./root.js";
20
48
  export type { ListRootProps } from "./root.js";
21
49
  export type { ListSave } from "../grid/core/commit-model.js";
50
+ export { ListSearch } from "./buttons/search.js";
51
+ export type { ListSearchProps } from "./buttons/search.js";
22
52
  export { ListSlot } from "./slot.js";
23
53
  export type { ListSlotProps } from "./slot.js";
54
+ export { ListSort } from "./buttons/sort.js";
55
+ export { ListSortFilter } from "./buttons/sort-filter.js";
56
+ export type { ListSortFilterProps } from "./buttons/sort-filter.js";
57
+ export { ListSortPanel } from "./panels/sort.js";
58
+ export type { ListSortPanelProps } from "./panels/sort.js";
59
+ export type { ListSortProps } from "./buttons/sort.js";
24
60
  export type { ListSource } from "./source.js";
25
61
  export type { ListState } from "./store.js";
26
62
  export { ListToolbar } from "./toolbar.js";
27
63
  export type { ListToolbarProps } from "./toolbar.js";
28
64
  export { menu } from "./menu.js";
29
65
  export type { MenuPlace } from "./menu.js";
66
+ export { ListViews } from "./buttons/views.js";
30
67
  export type { ListViewsOptions } from "./root.js";
68
+ export { ListViewsPanel } from "./panels/views.js";
69
+ export type { ListViewsPanelProps } from "./panels/views.js";
70
+ export type { ListViewsProps } from "./buttons/views.js";
31
71
  export type { ListViewsState } from "./views.js";
72
+ export type { ListWords } from "./buttons/shared.js";
32
73
  export type { SavedViewInput } from "./views-store.js";
33
74
  export { useList } from "./root.js";
34
75
  export type { ViewDraft } from "./views-store.js";
@@ -2,10 +2,29 @@ export { browserViewsStore } from "./browser-views-store.js";
2
2
  export { fetchSource } from "./source.js";
3
3
  export { List } from "./list.js";
4
4
  export { ListBulkBar } from "./bulk-bar.js";
5
+ export { ListClearSave } from "./buttons/clear-save.js";
6
+ export { ListCustomize } from "./buttons/customize.js";
7
+ export { ListCustomizePanel } from "./panels/customize.js";
8
+ export { ListEditorMenus } from "./editor-menus.js";
5
9
  export { ListFill } from "./slot.js";
10
+ export { ListFilter } from "./buttons/filter.js";
11
+ export { ListFilterBar } from "./panels/filter-bar.js";
12
+ export { ListFilterPanel } from "./panels/filter.js";
13
+ export { ListGap } from "./line.js";
6
14
  export { ListGrid } from "./grid.js";
15
+ export { ListLine } from "./line.js";
16
+ export { ListNew } from "./buttons/new.js";
17
+ export { ListPaneBox } from "./pane-box.js";
18
+ export { ListQuickFilters } from "./buttons/quick.js";
19
+ export { ListQuickFiltersPanel } from "./panels/quick.js";
7
20
  export { ListRoot } from "./root.js";
21
+ export { ListSearch } from "./buttons/search.js";
8
22
  export { ListSlot } from "./slot.js";
23
+ export { ListSort } from "./buttons/sort.js";
24
+ export { ListSortFilter } from "./buttons/sort-filter.js";
25
+ export { ListSortPanel } from "./panels/sort.js";
9
26
  export { ListToolbar } from "./toolbar.js";
10
27
  export { menu } from "./menu.js";
28
+ export { ListViews } from "./buttons/views.js";
29
+ export { ListViewsPanel } from "./panels/views.js";
11
30
  export { useList } from "./root.js";
@@ -1,8 +1,18 @@
1
1
  import type { ListPersonalLayer } from "viewkitjs/fields/query";
2
+ import { type ListPersonSwitch } from "../panels/settings/person.js";
3
+ import type { ListState } from "./store.js";
4
+ export type { ListPersonSwitch };
2
5
  /** A layer with nothing in it, every key present, so a store that merges a patch clears each one. */
3
6
  export declare const EMPTY_LAYER: ListPersonalLayer;
4
- /** Whether a person's layer holds anything that shows: a width, a fold, a look of their own, and on a phone (`phone`) their
5
- * phone's layout. */
6
- export declare function layerHolds(layer: ListPersonalLayer, { phone }?: {
7
+ /** Whether a person's layer holds anything that shows: a width, a fold, a look of their own, on a phone (`phone`) their
8
+ * phone's layout, and their toolbar where it counts (`person`). */
9
+ export declare function layerHolds(layer: ListPersonalLayer, { phone, person }?: {
7
10
  phone?: boolean;
11
+ person?: ListPersonSwitch;
8
12
  }): boolean;
13
+ /** When the filter bar stands for this person: their pick, where the app lets them set it and on a computer; else
14
+ * undefined, the app's own. */
15
+ export declare function personBar(state: ListState, phone: boolean): "added" | "always" | undefined;
16
+ /** The toolbar buttons' words for this person: undefined where the app doesn't let them set them; else their pick,
17
+ * icon and word (`both`) while they picked none. */
18
+ export declare function personWords(state: ListState): "both" | "icon" | "word" | undefined;
@@ -1,7 +1,17 @@
1
- export const EMPTY_LAYER = { look: {}, widths: {}, folded: [], phoneLayout: undefined };
2
- export function layerHolds(layer, { phone = true } = {}) {
1
+ import { toolbarCounts } from "../panels/settings/person.js";
2
+ export const EMPTY_LAYER = { look: {}, widths: {}, folded: [], phoneLayout: undefined, toolbar: undefined };
3
+ export function layerHolds(layer, { phone = true, person = {} } = {}) {
4
+ const toolbar = toolbarCounts(layer, { phone, person });
3
5
  return (Object.keys(layer.look ?? {}).length > 0 ||
4
6
  Object.keys(layer.widths ?? {}).length > 0 ||
5
7
  (layer.folded ?? []).length > 0 ||
6
- (phone && layer.phoneLayout !== undefined));
8
+ (phone && layer.phoneLayout !== undefined) ||
9
+ toolbar.bar ||
10
+ toolbar.words);
11
+ }
12
+ export function personBar(state, phone) {
13
+ return state.panels.personBar && !phone ? state.view.layer.toolbar?.bar : undefined;
14
+ }
15
+ export function personWords(state) {
16
+ return state.panels.personWords ? (state.view.layer.toolbar?.words ?? "both") : undefined;
7
17
  }
@@ -0,0 +1,58 @@
1
+ import { type ReactNode, type RefObject } from "react";
2
+ import { type FoldMenu, type FoldPlace, type ToolbarMore, type ToolbarOverflow } from "../panels/react/toolbar/Toolbar.js";
3
+ import type { ToolbarForm, ToolbarLine, ToolbarPlacement } from "../panels/toolbar/model.js";
4
+ export type ListLineProps = {
5
+ /** `row` (the default): a toolbar row, its buttons full size, named "List tools"; `bar`: a filter bar's line, a step
6
+ * smaller, named "Sort and filters". */
7
+ kind?: "row" | "bar";
8
+ /** ⋯ as data (as the ready toolbar's `menus.more`): handed the folded parts' rows, each keyed by its part, and which line it is
9
+ * (`row` or `bar`, the line's `kind`), it hands back the rows ⋯ shows. */
10
+ more?: ToolbarMore;
11
+ /** ⋯ as the app draws it (as the ready toolbar's `overflow`): its glyph, its class, or its whole button. */
12
+ overflow?: ToolbarOverflow;
13
+ className?: string;
14
+ children?: ReactNode;
15
+ };
16
+ export type ListGapProps = Record<string, never>;
17
+ /** A part's fold behaviour in a line (not on the door): its key (`data-toolbar-item`), and the ready toolbar's placement
18
+ * flags: words it may shed, view tabs and filters it may fold, whether it folds into ⋯ (and its row there), its role. */
19
+ export type LineItemMeta = Pick<ToolbarPlacement, "shed" | "tabs" | "filters" | "fold" | "role"> & {
20
+ key: string;
21
+ menu?: FoldMenu;
22
+ };
23
+ /** A line's form, where the ready toolbar says it (not on the door); absent, the screen's (`useLineForm`). */
24
+ export declare const LineForm: import("react").Context<ToolbarForm | null>;
25
+ /** The form of a line here (not on the door): the ready toolbar's, else a phone's off the provider's desktop query, else the
26
+ * row's (VK-1094). */
27
+ export declare function useLineForm(): ToolbarForm;
28
+ /** An item's place in a line the ready toolbar lays out (not on the door, VK-1106): its key in the line (and the name
29
+ * `data-toolbar-item` reads), its place's words, foot, class, button and panel, and its `shed` where the app's `toolbarParts`
30
+ * turned it. */
31
+ export type LinePlaceValue = {
32
+ id: string;
33
+ place?: Omit<FoldPlace, "key">;
34
+ shed?: boolean;
35
+ };
36
+ /** Each item's place in a seeded line (not on the door, VK-1106), handed to that item alone: what it draws inside reads none. */
37
+ export declare const LinePlace: import("react").Context<LinePlaceValue | null>;
38
+ /** The line as the ready toolbar arranged it (not on the door, VK-1106), its slots keyed by `LinePlace` ids, the gap's id
39
+ * `vk-gap`: the line lays out from it on every render, so its first paint (and the server's) is the arranged one. */
40
+ export declare const LineSeed: import("react").Context<ToolbarLine | null>;
41
+ /** The gap's id in a seeded line (not on the door, VK-1106). */
42
+ export declare const SEED_GAP = "vk-gap";
43
+ export declare function ListLine({ kind, more: reshape, overflow, className, children }: ListLineProps): ReactNode;
44
+ /** A part in the line around it, folding as `item` says (not on the door); outside a line, `children` as they are. Until it
45
+ * has registered, it stands unfolded at the line's start. */
46
+ export declare function LineItem({ item, children }: {
47
+ item: LineItemMeta;
48
+ children?: ReactNode;
49
+ }): ReactNode;
50
+ /** Empty room (VK-1105): in a line, it pushes what follows it to the line's end, the first one splitting the line's start
51
+ * from its end; anywhere else, the same room in a row of the app's. */
52
+ export declare function ListGap(_props: ListGapProps): ReactNode;
53
+ /** Whether a part stands in a `ListLine` (not on the door): the filter bar stands its pieces as the line's items there. */
54
+ export declare function useInLine(): boolean;
55
+ /** ⋯'s button of the line around a part (not on the door): a folded part whose panel is the app's own is called with it. */
56
+ export declare function useLineMore(): RefObject<HTMLButtonElement | null> | null;
57
+ /** A separator in a line (not on the door, VK-1106): `sep`, drawn only between two drawn items of its side. */
58
+ export declare function LineSep(): ReactNode;
@@ -0,0 +1,229 @@
1
+ "use client";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { Children, createContext, isValidElement, useCallback, useContext, useLayoutEffect, useMemo, useRef, useState, } from "react";
4
+ import { ToolbarRadioProvider } from "../panels/react/toolbar/context.js";
5
+ import { FoldItem, FoldOverflow, ToolbarSeparator, foldLineMark, useFoldLine, useLineName, } from "../panels/react/toolbar/Toolbar.js";
6
+ import { cx } from "../internal/cx.js";
7
+ import { useDesktop } from "../provider/desktop.js";
8
+ export const LineForm = createContext(null);
9
+ export function useLineForm() {
10
+ const told = useContext(LineForm);
11
+ const desktop = useDesktop();
12
+ return told ?? (desktop ? "row" : "phone");
13
+ }
14
+ export const LinePlace = createContext(null);
15
+ export const LineSeed = createContext(null);
16
+ export const SEED_GAP = "vk-gap";
17
+ const LineChild = createContext(null);
18
+ const LineContext = createContext(null);
19
+ let lastId = 0;
20
+ const nextId = () => `vk-line-item-${++lastId}`;
21
+ const NOTHING_LAID = { start: [], end: [], names: new Map(), order: [], signature: "" };
22
+ const slotOf = (id, meta) => ({
23
+ key: id,
24
+ fill: false,
25
+ ...(meta.shed && { shed: true }),
26
+ ...((meta.tabs ?? 0) > 0 && { tabs: meta.tabs }),
27
+ ...((meta.filters ?? 0) > 0 && { filters: meta.filters }),
28
+ ...(meta.fold && { fold: true }),
29
+ ...(meta.role === "separator" && { separator: true }),
30
+ ...(meta.role === "search" && { search: true }),
31
+ });
32
+ function laidOut(entries, before) {
33
+ const drawn = [...entries]
34
+ .map(([id, entry]) => ({ id, element: entry.element() }))
35
+ .filter((at) => !!at.element?.isConnected)
36
+ .sort((a, b) => (a.element.compareDocumentPosition(b.element) & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1))
37
+ .map((at) => at.id);
38
+ const order = [...drawn];
39
+ for (const [i, id] of before.entries()) {
40
+ if (order.includes(id) || !entries.has(id))
41
+ continue;
42
+ const after = before.slice(0, i).reverse().find((prior) => order.includes(prior));
43
+ order.splice(after === undefined ? 0 : order.indexOf(after) + 1, 0, id);
44
+ }
45
+ for (const id of entries.keys())
46
+ if (!order.includes(id))
47
+ order.push(id);
48
+ const gap = order.findIndex((id) => entries.get(id).gap);
49
+ const slots = (ids) => ids.flatMap((id) => {
50
+ const meta = entries.get(id).meta;
51
+ return meta ? [slotOf(id, meta)] : [];
52
+ });
53
+ const start = slots(gap < 0 ? order : order.slice(0, gap));
54
+ const end = gap < 0 ? [] : slots(order.slice(gap + 1));
55
+ const names = new Map(order.flatMap((id) => {
56
+ const meta = entries.get(id).meta;
57
+ return meta ? [[id, meta.key]] : [];
58
+ }));
59
+ return { start, end, names, order, signature: JSON.stringify([start, end, order, [...names]]) };
60
+ }
61
+ function laidOf(seed) {
62
+ const ids = (slots) => slots.map((slot) => slot.key);
63
+ const order = [...ids(seed.start), SEED_GAP, ...ids(seed.end)];
64
+ const names = new Map([...ids(seed.start), ...ids(seed.end)].map((id) => [id, id]));
65
+ return { start: seed.start, end: seed.end, names, order, signature: JSON.stringify([seed.start, seed.end, order, [...names]]) };
66
+ }
67
+ const seededKey = (id) => `.$${id.replace(/[=:]/g, (c) => (c === "=" ? "=0" : "=2"))}`;
68
+ const childKey = (child, i) => (isValidElement(child) && child.key !== null ? String(child.key) : `vk-child-${i}`);
69
+ export function ListLine({ kind = "row", more: reshape, overflow, className, children }) {
70
+ const form = useLineForm();
71
+ const seed = useContext(LineSeed);
72
+ const lineKind = seed?.kind ?? (kind === "bar" ? "bar" : "main");
73
+ const name = useLineName(lineKind);
74
+ const [element, setElement] = useState(null);
75
+ const [entries] = useState(() => new Map());
76
+ const [menus] = useState(() => new Map());
77
+ const [registered, setLaid] = useState(NOTHING_LAID);
78
+ const seeded = useMemo(() => (seed ? laidOf(seed) : null), [seed]);
79
+ const laid = seeded ?? registered;
80
+ const [, setVersion] = useState(0);
81
+ const lastLaid = useRef(NOTHING_LAID);
82
+ const recheck = useRef(() => { });
83
+ const register = useCallback((id, entry) => {
84
+ entries.set(id, entry);
85
+ setVersion((v) => v + 1);
86
+ return () => {
87
+ entries.delete(id);
88
+ menus.delete(id);
89
+ setVersion((v) => v + 1);
90
+ };
91
+ }, [entries, menus]);
92
+ const relayout = useCallback(() => {
93
+ if (seed)
94
+ return;
95
+ const next = laidOut(entries, lastLaid.current.order);
96
+ if (next.signature === lastLaid.current.signature)
97
+ return;
98
+ lastLaid.current = next;
99
+ setLaid(next);
100
+ }, [entries, seed]);
101
+ useLayoutEffect(() => relayout());
102
+ const touch = useCallback(({ grew, renamed }) => {
103
+ if (renamed)
104
+ setVersion((v) => v + 1);
105
+ relayout();
106
+ if (grew)
107
+ recheck.current();
108
+ }, [relayout]);
109
+ const line = { kind: lineKind, start: laid.start, end: laid.end, size: seed?.size ?? (kind === "bar" ? "sm" : "md") };
110
+ const view = useFoldLine(element, line, form);
111
+ useLayoutEffect(() => {
112
+ recheck.current = view.recheck;
113
+ });
114
+ const all = [...laid.start, ...laid.end];
115
+ const kids = Children.toArray(children);
116
+ const keys = kids.map(childKey);
117
+ const afterChild = (() => {
118
+ const at = view.state.moreAfter;
119
+ if (!at)
120
+ return null;
121
+ if (seed && !entries.has(at) && keys.includes(seededKey(at)))
122
+ return seededKey(at);
123
+ const child = entries.get(at)?.child ?? null;
124
+ if (child !== null && keys.includes(child)) {
125
+ const last = [...laid.order].reverse().find((id) => entries.get(id)?.child === child);
126
+ return last === at ? child : null;
127
+ }
128
+ for (const id of laid.order.slice(0, Math.max(0, laid.order.indexOf(at))).reverse()) {
129
+ const earlier = entries.get(id)?.child;
130
+ if (earlier && keys.includes(earlier))
131
+ return earlier;
132
+ }
133
+ return null;
134
+ })();
135
+ const value = {
136
+ register,
137
+ touch,
138
+ menus,
139
+ view,
140
+ slotOf: (id) => all.find((slot) => slot.key === id),
141
+ rows: () => {
142
+ const seen = new Map();
143
+ return all.flatMap((slot) => {
144
+ const menu = view.state.folded.has(slot.key) ? menus.get(slot.key) : undefined;
145
+ if (!menu)
146
+ return [];
147
+ const name = laid.names.get(slot.key) ?? slot.key;
148
+ const nth = (seen.get(name) ?? 0) + 1;
149
+ seen.set(name, nth);
150
+ return [{ ...menu, key: nth > 1 ? `${name}-${nth}` : name, onSelect: () => menus.get(slot.key)?.onSelect() }];
151
+ });
152
+ },
153
+ more: reshape,
154
+ overflow,
155
+ drawsMore: afterChild === null,
156
+ seeded: seed !== null,
157
+ };
158
+ const mark = foldLineMark(lineKind, form, name);
159
+ const hides = !seed && !kids.some((kid) => typeof kid === "string" || typeof kid === "number");
160
+ return (_jsx(ToolbarRadioProvider, { children: _jsx(LineContext.Provider, { value: value, children: _jsx("div", { ref: setElement, ...mark, className: cx(mark.className, hides && EMPTY_LINE, className), children: kids.flatMap((kid, i) => [
161
+ _jsx(LineChild.Provider, { value: keys[i], children: _jsx(LineSeed.Provider, { value: null, children: kid }) }, keys[i]),
162
+ ...(keys[i] === afterChild
163
+ ? [_jsx(FoldOverflow, { view: view, rows: value.rows, reshape: reshape, overflow: overflow }, "vk-overflow")]
164
+ : []),
165
+ ]) }) }) }));
166
+ }
167
+ const EMPTY_LINE = "[&:not(:has(>:not([data-toolbar-spacer],[hidden],[data-toolbar-item]:empty)))]:hidden";
168
+ export function LineItem({ item, children }) {
169
+ const around = useContext(LineContext);
170
+ const placed = useContext(LinePlace);
171
+ const line = around && around.seeded && !placed ? null : around;
172
+ const child = useContext(LineChild);
173
+ const [own] = useState(nextId);
174
+ const id = placed?.id ?? own;
175
+ const element = useRef(null);
176
+ const register = line?.register;
177
+ const { tabs, filters, fold, role } = item;
178
+ const key = placed?.id ?? item.key;
179
+ const shed = placed?.shed ?? item.shed;
180
+ const drew = useRef(null);
181
+ useLayoutEffect(() => {
182
+ if (!line)
183
+ return;
184
+ const before = line.menus.get(id);
185
+ line.menus.set(id, item.menu);
186
+ const { state } = line.view;
187
+ const at = [state.iconAlone.has(id), state.tabsFolded.get(id) ?? 0, state.filtersFolded.get(id) ?? 0, state.folded.has(id)].join();
188
+ const el = element.current;
189
+ const width = el && !el.hidden ? el.getBoundingClientRect().width : -1;
190
+ const own = drew.current?.line === line;
191
+ const grew = drew.current !== null && drew.current.at === at && (width < 0 ? own : drew.current.width !== width);
192
+ drew.current = { at, width, line };
193
+ line.touch({ grew, renamed: before !== undefined && before?.label !== item.menu?.label });
194
+ });
195
+ useLayoutEffect(() => register?.(id, {
196
+ element: () => element.current,
197
+ gap: false,
198
+ meta: { key, ...(shed && { shed }), ...(tabs && { tabs }), ...(filters && { filters }), ...(fold && { fold }), ...(role && { role }) },
199
+ child,
200
+ }), [register, id, key, shed, tabs, filters, fold, role, child]);
201
+ if (!line)
202
+ return children;
203
+ return (_jsx(FoldItem, { view: line.view, slot: line.slotOf(id) ?? { key: id, fill: false }, name: key, place: { key, ...placed?.place }, rows: line.rows, reshape: line.more, overflow: line.overflow, more: line.drawsMore, itemRef: element, children: _jsx(LinePlace.Provider, { value: null, children: children }) }));
204
+ }
205
+ export function ListGap(_props) {
206
+ const line = useContext(LineContext);
207
+ const placed = useContext(LinePlace);
208
+ const child = useContext(LineChild);
209
+ const [own] = useState(nextId);
210
+ const id = placed?.id ?? own;
211
+ const element = useRef(null);
212
+ const register = line?.register;
213
+ useLayoutEffect(() => register?.(id, { element: () => element.current, gap: true, meta: null, child }), [register, id, child]);
214
+ if (line?.view.searchTakesLine)
215
+ return null;
216
+ return _jsx("span", { ref: element, "data-toolbar-spacer": true, "aria-hidden": true, className: "min-w-0 flex-1" });
217
+ }
218
+ export function useInLine() {
219
+ const line = useContext(LineContext);
220
+ const placed = useContext(LinePlace);
221
+ return line !== null && !(line.seeded && !placed);
222
+ }
223
+ export function useLineMore() {
224
+ return useContext(LineContext)?.view.more ?? null;
225
+ }
226
+ export function LineSep() {
227
+ return (_jsx(LineItem, { item: SEP_ITEM, children: _jsx(ToolbarSeparator, {}) }));
228
+ }
229
+ const SEP_ITEM = { key: "sep", role: "separator" };
@@ -42,6 +42,12 @@ type ListPropsCommon<Row extends ListRow> = {
42
42
  /** The toolbar's form on a computer, as `ListRoot` takes them. */
43
43
  sortFilter?: "right" | "bar";
44
44
  bar?: "added" | "always";
45
+ /** What the person may set in their own Customize, kept in their layer: `bar`, when the filter bar stands; `words`,
46
+ * the toolbar buttons' words. Off by default. */
47
+ personSettings?: {
48
+ bar?: boolean;
49
+ words?: boolean;
50
+ };
45
51
  /** Every menu as data: `column`, `row` and `group` reach the grid, `view`, `add` and `more` the toolbar. */
46
52
  menus?: ListMenus<Row>;
47
53
  /** Where each of the toolbar's parts stands (`ReadyToolbar`'s `toolbarParts`). */
@@ -70,5 +76,5 @@ type ListPropsCommon<Row extends ListRow> = {
70
76
  bulk?: ListBulkBarProps;
71
77
  className?: string;
72
78
  };
73
- export declare function List<Row extends ListRow>({ id, fields, rows, source, pageSize, save, columns, views, defaults, sortFilter, bar, menus, toolbarParts, customizeIn, link, can, onOpenRow, rowHref, rowWritable, onAdd, addItems, quickFilters, toolbar, grid, bulk, className, }: ListProps<Row>): ReactNode;
79
+ export declare function List<Row extends ListRow>({ id, fields, rows, source, pageSize, save, columns, views, defaults, sortFilter, bar, personSettings, menus, toolbarParts, customizeIn, link, can, onOpenRow, rowHref, rowWritable, onAdd, addItems, quickFilters, toolbar, grid, bulk, className, }: ListProps<Row>): ReactNode;
74
80
  export {};
@@ -9,11 +9,11 @@ import { ListToolbar } from "./toolbar.js";
9
9
  function handed(from) {
10
10
  return Object.fromEntries(Object.entries(from).filter(([, value]) => value !== undefined));
11
11
  }
12
- export function List({ id, fields, rows, source, pageSize, save, columns, views, defaults, sortFilter, bar, menus, toolbarParts, customizeIn, link = true, can, onOpenRow, rowHref, rowWritable, onAdd, addItems, quickFilters, toolbar, grid, bulk, className, }) {
12
+ export function List({ id, fields, rows, source, pageSize, save, columns, views, defaults, sortFilter, bar, personSettings, menus, toolbarParts, customizeIn, link = true, can, onOpenRow, rowHref, rowWritable, onAdd, addItems, quickFilters, toolbar, grid, bulk, className, }) {
13
13
  const toolbarMenus = { ...toolbar?.menus, ...handed({ view: menus?.view, add: menus?.add, more: menus?.more, customize: menus?.customize, sortEditor: menus?.sortEditor, filterEditor: menus?.filterEditor, groupEditor: menus?.groupEditor }) };
14
14
  const gridMenus = { ...grid?.menus, ...handed({ column: menus?.column, row: menus?.row, group: menus?.group, addColumn: menus?.addColumn }) };
15
15
  const [box, setBox] = useState(null);
16
16
  const inPane = (customizeIn ?? toolbar?.customizeIn) === "pane";
17
17
  const gridOf = (_jsx(ListGrid, { ...grid, ...handed({ onOpenRow, rowHref, rowWritable }), menus: gridMenus, children: grid?.children ?? _jsx(ListBulkBar, { ...bulk }) }));
18
- return (_jsx(ListRoot, { id: id, fields: fields, ...(source ? { source, pageSize } : { rows }), quickFilters: quickFilters, save: save, columns: columns, views: views, defaults: defaults, sortFilter: sortFilter, bar: bar, can: can, link: link, children: _jsx(ScreenForms, { children: _jsxs("div", { "data-slot": "vk-list", className: className, children: [_jsx(ListToolbar, { ...toolbar, ...handed({ toolbarParts, onAdd, addItems, quickFilters, customizeIn }), ...(inPane && { paneBox: box }), menus: toolbarMenus }), inPane ? (_jsx("div", { ref: setBox, "data-slot": "vk-list-box", className: "relative isolate flex min-h-0 flex-1 flex-col", children: gridOf })) : (gridOf)] }) }) }));
18
+ return (_jsx(ListRoot, { id: id, fields: fields, ...(source ? { source, pageSize } : { rows }), quickFilters: quickFilters, save: save, columns: columns, views: views, defaults: defaults, sortFilter: sortFilter, bar: bar, personSettings: personSettings, can: can, link: link, children: _jsx(ScreenForms, { children: _jsxs("div", { "data-slot": "vk-list", className: className, children: [_jsx(ListToolbar, { ...toolbar, ...handed({ toolbarParts, onAdd, addItems, quickFilters, customizeIn }), ...(inPane && { paneBox: box }), menus: toolbarMenus }), inPane ? (_jsx("div", { ref: setBox, "data-slot": "vk-list-box", className: "relative isolate flex min-h-0 flex-1 flex-col", children: gridOf })) : (gridOf)] }) }) }));
19
19
  }
@@ -0,0 +1,6 @@
1
+ import { type ReactNode } from "react";
2
+ export type ListPaneBoxProps = {
3
+ className?: string;
4
+ children?: ReactNode;
5
+ };
6
+ export declare function ListPaneBox({ className, children }: ListPaneBoxProps): ReactNode;
@@ -0,0 +1,15 @@
1
+ "use client";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { useCallback, useContext } from "react";
4
+ import { cx } from "../internal/cx.js";
5
+ import { ListPaneBoxContext } from "./root-base.js";
6
+ export function ListPaneBox({ className, children }) {
7
+ const held = useContext(ListPaneBoxContext);
8
+ if (!held)
9
+ throw new Error("ListPaneBox needs a ListRoot around it");
10
+ return _jsx(PaneBoxOf, { setBox: held.setBox, className: className, children: children });
11
+ }
12
+ function PaneBoxOf({ setBox, className, children }) {
13
+ const ref = useCallback((element) => setBox(element), [setBox]);
14
+ return (_jsx("div", { ref: ref, "data-slot": "vk-list-box", className: cx("relative isolate flex min-h-0 flex-1 flex-col", className), children: children }));
15
+ }
@@ -0,0 +1,8 @@
1
+ import { type ReactNode } from "react";
2
+ import type { ListCustomizeProps } from "../buttons/customize.js";
3
+ export type ListCustomizePanelProps = Pick<ListCustomizeProps, "viewName" | "onRenameView" | "onCopyLink" | "onExport" | "exportCount" | "fieldEditor"> & {
4
+ /** When it stands. Default `always`. */
5
+ shows?: "always" | "button";
6
+ className?: string;
7
+ };
8
+ export declare function ListCustomizePanel({ shows, className, viewName, onRenameView, onCopyLink, onExport, exportCount, fieldEditor, }: ListCustomizePanelProps): ReactNode;
@@ -0,0 +1,23 @@
1
+ "use client";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { useState } from "react";
4
+ import { getViewOptionAvailability } from "../../panels/availability.js";
5
+ import { countActiveViewOptions } from "../../panels/model.js";
6
+ import { OptionsBody } from "../../panels/react/toolbar/ToolbarOptions.js";
7
+ import { useViews } from "../../provider/context.js";
8
+ import { useList } from "../root-base.js";
9
+ import { useToolbarModel } from "../toolbar-model.js";
10
+ import { usePartPhone } from "../buttons/shared.js";
11
+ import { PanelFrame, usePanelPlace } from "./shared.js";
12
+ export function ListCustomizePanel({ shows = "always", className, viewName, onRenameView, onCopyLink, onExport, exportCount, fieldEditor, }) {
13
+ const { messages } = useViews();
14
+ const phone = usePartPhone();
15
+ const fielded = useList((s) => s.columns !== null);
16
+ const { inputs, view, layered, clearable, resetAll, resets } = useToolbarModel({ phone, fromRoot: true });
17
+ const [page, setPage] = useState(null);
18
+ const drawn = fielded && getViewOptionAvailability(inputs).desktop;
19
+ const place = usePanelPlace("customize", shows, true, drawn);
20
+ if (!drawn)
21
+ return null;
22
+ return (_jsx(PanelFrame, { place: place, label: messages({ key: "views.panels.toolbar-options" }), head: false, panel: "customize", className: className, children: _jsx(OptionsBody, { ...inputs, page: page, onPageChange: setPage, count: view ? 0 : countActiveViewOptions(inputs), clear: resetAll, close: place.hide, closeButton: place.stands === "shown", fill: true, view: view, viewFoot: view ? undefined : "kit", footClear: clearable ? resetAll : undefined, resets: resets, layered: layered, fieldEditor: fieldEditor, viewName: viewName, onRenameView: onRenameView, onCopyLink: onCopyLink, onExport: onExport, exportCount: exportCount }) }));
23
+ }
@@ -0,0 +1,12 @@
1
+ import { type ReactNode } from "react";
2
+ import type { ListPanelShows } from "./shared.js";
3
+ export type ListFilterBarProps = {
4
+ /** When it stands. Default `filled`. */
5
+ shows?: ListPanelShows;
6
+ /** The sort on the bar: `no` (the default), the sort pill while it differs; `yes`, each rule standing, edited in place.
7
+ * Without several sorts, as `no`. */
8
+ sorts?: "no" | "yes";
9
+ /** On its region; in a `ListLine` its pieces stand as the line's items, with no region of their own, so it means nothing. */
10
+ className?: string;
11
+ };
12
+ export declare function ListFilterBar({ shows: own, sorts, className }: ListFilterBarProps): ReactNode;
@@ -0,0 +1,73 @@
1
+ "use client";
2
+ import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
3
+ import { Fragment, useContext, useLayoutEffect } from "react";
4
+ import { cx } from "../../internal/cx.js";
5
+ import { ToolbarBarSorts } from "../../panels/react/toolbar/ToolbarBarSorts.js";
6
+ import { useViews } from "../../provider/context.js";
7
+ import { FILTER_BAR_BUTTON_KEY, FILTER_BAR_KEY, filterBarParts } from "../bar-parts.js";
8
+ import { FILTER_BAR_ALWAYS_KEY } from "../bar-keys.js";
9
+ import { personBar } from "../layer.js";
10
+ import { LineItem, useInLine } from "../line.js";
11
+ import { ReadyPiece, useReadyParts } from "../ready.js";
12
+ import { useList, useListPanel, useListStore } from "../root-base.js";
13
+ import { useToolbarModel } from "../toolbar-model.js";
14
+ import { usePartKey, usePartPhone } from "../buttons/shared.js";
15
+ export function ListFilterBar({ shows: own = "filled", sorts = "no", className }) {
16
+ const { messages } = useViews();
17
+ const phone = usePartPhone();
18
+ const store = useListStore();
19
+ const person = useList((s) => personBar(s, phone));
20
+ const shows = own !== "button" && person ? (person === "always" ? "always" : "filled") : own;
21
+ const ready = useReadyParts();
22
+ const piece = useContext(ReadyPiece);
23
+ const rooted = useList((s) => s.columns !== null);
24
+ const fielded = ready ? true : rooted;
25
+ const barOpen = useList((s) => s.panels.barOpen);
26
+ const model = useToolbarModel({ phone, fromRoot: true });
27
+ const sortState = useListPanel(usePartKey("barSort"));
28
+ const filterState = useListPanel(usePartKey("barFilters"));
29
+ const drawn = ready ? !phone : fielded && !phone && !!model.panels.filterTree;
30
+ const inLine = useInLine();
31
+ useLayoutEffect(() => {
32
+ if (!drawn || ready)
33
+ return;
34
+ const unbar = store.get().place("bar");
35
+ const unplace = store.get().place(FILTER_BAR_KEY);
36
+ const unbutton = own === "button" ? store.get().place(FILTER_BAR_BUTTON_KEY) : undefined;
37
+ const unalways = own === "always" ? store.get().place(FILTER_BAR_ALWAYS_KEY) : undefined;
38
+ return () => {
39
+ unbar();
40
+ unplace();
41
+ unbutton?.();
42
+ unalways?.();
43
+ };
44
+ }, [store, drawn, own, ready]);
45
+ if (!drawn)
46
+ return null;
47
+ const always = ready ? ready.barAlways : shows !== "filled";
48
+ const { parts, holds } = filterBarParts({
49
+ panels: model.panels,
50
+ differs: model.differs,
51
+ held: model.held,
52
+ setHeld: model.setHeld,
53
+ savedFilter: model.savedFilter,
54
+ always,
55
+ sorts,
56
+ sortState,
57
+ filterState,
58
+ barSorts: (rules, state) => _jsx(ToolbarBarSorts, { sorts: rules, open: state.open, onOpenChange: state.onOpenChange }),
59
+ ...(ready && { hosts: { ...(ready.hosts.sort && { sort: ready.hosts.sort }), ...(ready.hosts.filter && { filter: ready.hosts.filter }) } }),
60
+ });
61
+ if (ready && piece) {
62
+ const part = parts.find((at) => at.key === piece);
63
+ if (!part)
64
+ return null;
65
+ return _jsx(LineItem, { item: { key: part.key, ...(part.role && { role: part.role }), ...(part.filters && { filters: part.filters }) }, children: part.node });
66
+ }
67
+ const stands = ready !== null || shows === "always" || (shows === "filled" ? holds : barOpen);
68
+ if (!stands)
69
+ return null;
70
+ if (inLine)
71
+ return (_jsx(_Fragment, { children: parts.map((part) => (_jsx(LineItem, { item: { key: part.key, ...(part.role && { role: part.role }), ...(part.filters && { filters: part.filters }) }, children: part.node }, part.key))) }));
72
+ return (_jsx("div", { role: "region", "aria-label": messages({ key: "views.panels.sort-filter" }), "data-slot": "vk-list-filter-bar", "data-shows": shows, className: cx("flex flex-wrap items-center gap-1", className), children: parts.map((part) => (_jsx(Fragment, { children: part.node }, part.key))) }));
73
+ }
@@ -0,0 +1,8 @@
1
+ import type { ReactNode } from "react";
2
+ import { type ListPanelShows } from "./shared.js";
3
+ export type ListFilterPanelProps = {
4
+ /** When it stands. Default `always`. */
5
+ shows?: ListPanelShows;
6
+ className?: string;
7
+ };
8
+ export declare function ListFilterPanel({ shows, className }: ListFilterPanelProps): ReactNode;