@wordpress/dataviews 11.0.0 → 11.1.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 (303) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/README.md +140 -93
  3. package/build/components/dataviews-filters/filter.js +25 -267
  4. package/build/components/dataviews-filters/filter.js.map +2 -2
  5. package/build/components/dataviews-filters/input-widget.js +1 -4
  6. package/build/components/dataviews-filters/input-widget.js.map +2 -2
  7. package/build/components/dataviews-filters/use-filters.js +3 -3
  8. package/build/components/dataviews-filters/use-filters.js.map +2 -2
  9. package/build/constants.js +5 -142
  10. package/build/constants.js.map +2 -2
  11. package/build/dataform-controls/number.js +2 -1
  12. package/build/dataform-controls/number.js.map +2 -2
  13. package/build/dataform-controls/textarea.js +3 -1
  14. package/build/dataform-controls/textarea.js.map +2 -2
  15. package/build/dataform-controls/utils/get-custom-validity.js +8 -0
  16. package/build/dataform-controls/utils/get-custom-validity.js.map +2 -2
  17. package/build/dataform-controls/utils/validated-input.js +4 -2
  18. package/build/dataform-controls/utils/validated-input.js.map +2 -2
  19. package/build/dataform-controls/utils/validated-number.js +4 -2
  20. package/build/dataform-controls/utils/validated-number.js.map +2 -2
  21. package/build/dataform-layouts/panel/modal.js +14 -5
  22. package/build/dataform-layouts/panel/modal.js.map +2 -2
  23. package/build/dataviews-layouts/grid/composite-grid.js +39 -37
  24. package/build/dataviews-layouts/grid/composite-grid.js.map +3 -3
  25. package/build/dataviews-layouts/table/index.js +8 -3
  26. package/build/dataviews-layouts/table/index.js.map +2 -2
  27. package/build/field-types/array.js +27 -14
  28. package/build/field-types/array.js.map +3 -3
  29. package/build/field-types/boolean.js +13 -10
  30. package/build/field-types/boolean.js.map +3 -3
  31. package/build/field-types/color.js +14 -11
  32. package/build/field-types/color.js.map +3 -3
  33. package/build/field-types/date.js +11 -8
  34. package/build/field-types/date.js.map +3 -3
  35. package/build/field-types/datetime.js +7 -5
  36. package/build/field-types/datetime.js.map +3 -3
  37. package/build/field-types/email.js +20 -11
  38. package/build/field-types/email.js.map +3 -3
  39. package/build/field-types/index.js +12 -14
  40. package/build/field-types/index.js.map +3 -3
  41. package/build/field-types/integer.js +63 -14
  42. package/build/field-types/integer.js.map +3 -3
  43. package/build/field-types/media.js +5 -5
  44. package/build/field-types/media.js.map +2 -2
  45. package/build/field-types/no-type.js +9 -6
  46. package/build/field-types/no-type.js.map +3 -3
  47. package/build/field-types/number.js +51 -15
  48. package/build/field-types/number.js.map +3 -3
  49. package/build/field-types/password.js +13 -5
  50. package/build/field-types/password.js.map +3 -3
  51. package/build/field-types/telephone.js +13 -5
  52. package/build/field-types/telephone.js.map +3 -3
  53. package/build/field-types/text.js +13 -5
  54. package/build/field-types/text.js.map +3 -3
  55. package/build/field-types/url.js +13 -5
  56. package/build/field-types/url.js.map +3 -3
  57. package/build/field-types/utils/get-is-valid.js +89 -0
  58. package/build/field-types/utils/get-is-valid.js.map +7 -0
  59. package/build/field-types/utils/is-valid-elements.js +35 -0
  60. package/build/field-types/utils/is-valid-elements.js.map +7 -0
  61. package/build/field-types/utils/is-valid-max-length.js +36 -0
  62. package/build/field-types/utils/is-valid-max-length.js.map +7 -0
  63. package/build/field-types/utils/is-valid-max.js +36 -0
  64. package/build/field-types/utils/is-valid-max.js.map +7 -0
  65. package/build/field-types/utils/is-valid-min-length.js +36 -0
  66. package/build/field-types/utils/is-valid-min-length.js.map +7 -0
  67. package/build/field-types/utils/is-valid-min.js +36 -0
  68. package/build/field-types/utils/is-valid-min.js.map +7 -0
  69. package/build/field-types/utils/is-valid-pattern.js +41 -0
  70. package/build/field-types/utils/is-valid-pattern.js.map +7 -0
  71. package/build/field-types/utils/is-valid-required-for-array.js +32 -0
  72. package/build/field-types/utils/is-valid-required-for-array.js.map +7 -0
  73. package/build/field-types/utils/is-valid-required-for-bool.js +30 -0
  74. package/build/field-types/utils/is-valid-required-for-bool.js.map +7 -0
  75. package/build/field-types/utils/is-valid-required.js +30 -0
  76. package/build/field-types/utils/is-valid-required.js.map +7 -0
  77. package/build/hooks/use-form-validity.js +52 -102
  78. package/build/hooks/use-form-validity.js.map +2 -2
  79. package/build/types/field-api.js.map +1 -1
  80. package/build/types/private.js.map +1 -1
  81. package/build/utils/filter-sort-and-paginate.js +5 -0
  82. package/build/utils/filter-sort-and-paginate.js.map +3 -3
  83. package/build/utils/operators.js +399 -0
  84. package/build/utils/operators.js.map +7 -0
  85. package/build-module/components/dataviews-filters/filter.js +26 -292
  86. package/build-module/components/dataviews-filters/filter.js.map +2 -2
  87. package/build-module/components/dataviews-filters/input-widget.js +1 -4
  88. package/build-module/components/dataviews-filters/input-widget.js.map +2 -2
  89. package/build-module/components/dataviews-filters/use-filters.js +6 -3
  90. package/build-module/components/dataviews-filters/use-filters.js.map +2 -2
  91. package/build-module/constants.js +5 -139
  92. package/build-module/constants.js.map +2 -2
  93. package/build-module/dataform-controls/number.js +2 -1
  94. package/build-module/dataform-controls/number.js.map +2 -2
  95. package/build-module/dataform-controls/textarea.js +3 -1
  96. package/build-module/dataform-controls/textarea.js.map +2 -2
  97. package/build-module/dataform-controls/utils/get-custom-validity.js +8 -0
  98. package/build-module/dataform-controls/utils/get-custom-validity.js.map +2 -2
  99. package/build-module/dataform-controls/utils/validated-input.js +4 -2
  100. package/build-module/dataform-controls/utils/validated-input.js.map +2 -2
  101. package/build-module/dataform-controls/utils/validated-number.js +4 -2
  102. package/build-module/dataform-controls/utils/validated-number.js.map +2 -2
  103. package/build-module/dataform-layouts/panel/modal.js +14 -5
  104. package/build-module/dataform-layouts/panel/modal.js.map +2 -2
  105. package/build-module/dataviews-layouts/grid/composite-grid.js +40 -38
  106. package/build-module/dataviews-layouts/grid/composite-grid.js.map +3 -3
  107. package/build-module/dataviews-layouts/table/index.js +8 -3
  108. package/build-module/dataviews-layouts/table/index.js.map +2 -2
  109. package/build-module/field-types/array.js +17 -14
  110. package/build-module/field-types/array.js.map +2 -2
  111. package/build-module/field-types/boolean.js +13 -10
  112. package/build-module/field-types/boolean.js.map +2 -2
  113. package/build-module/field-types/color.js +14 -11
  114. package/build-module/field-types/color.js.map +2 -2
  115. package/build-module/field-types/date.js +11 -8
  116. package/build-module/field-types/date.js.map +2 -2
  117. package/build-module/field-types/datetime.js +7 -5
  118. package/build-module/field-types/datetime.js.map +2 -2
  119. package/build-module/field-types/email.js +20 -11
  120. package/build-module/field-types/email.js.map +2 -2
  121. package/build-module/field-types/index.js +12 -14
  122. package/build-module/field-types/index.js.map +2 -2
  123. package/build-module/field-types/integer.js +58 -13
  124. package/build-module/field-types/integer.js.map +2 -2
  125. package/build-module/field-types/media.js +5 -5
  126. package/build-module/field-types/media.js.map +2 -2
  127. package/build-module/field-types/no-type.js +10 -7
  128. package/build-module/field-types/no-type.js.map +2 -2
  129. package/build-module/field-types/number.js +47 -15
  130. package/build-module/field-types/number.js.map +2 -2
  131. package/build-module/field-types/password.js +13 -5
  132. package/build-module/field-types/password.js.map +2 -2
  133. package/build-module/field-types/telephone.js +13 -5
  134. package/build-module/field-types/telephone.js.map +2 -2
  135. package/build-module/field-types/text.js +13 -5
  136. package/build-module/field-types/text.js.map +2 -2
  137. package/build-module/field-types/url.js +13 -5
  138. package/build-module/field-types/url.js.map +2 -2
  139. package/build-module/field-types/utils/get-is-valid.js +68 -0
  140. package/build-module/field-types/utils/get-is-valid.js.map +7 -0
  141. package/build-module/field-types/utils/is-valid-elements.js +14 -0
  142. package/build-module/field-types/utils/is-valid-elements.js.map +7 -0
  143. package/build-module/field-types/utils/is-valid-max-length.js +15 -0
  144. package/build-module/field-types/utils/is-valid-max-length.js.map +7 -0
  145. package/build-module/field-types/utils/is-valid-max.js +15 -0
  146. package/build-module/field-types/utils/is-valid-max.js.map +7 -0
  147. package/build-module/field-types/utils/is-valid-min-length.js +15 -0
  148. package/build-module/field-types/utils/is-valid-min-length.js.map +7 -0
  149. package/build-module/field-types/utils/is-valid-min.js +15 -0
  150. package/build-module/field-types/utils/is-valid-min.js.map +7 -0
  151. package/build-module/field-types/utils/is-valid-pattern.js +20 -0
  152. package/build-module/field-types/utils/is-valid-pattern.js.map +7 -0
  153. package/build-module/field-types/utils/is-valid-required-for-array.js +11 -0
  154. package/build-module/field-types/utils/is-valid-required-for-array.js.map +7 -0
  155. package/build-module/field-types/utils/is-valid-required-for-bool.js +9 -0
  156. package/build-module/field-types/utils/is-valid-required-for-bool.js.map +7 -0
  157. package/build-module/field-types/utils/is-valid-required.js +9 -0
  158. package/build-module/field-types/utils/is-valid-required.js.map +7 -0
  159. package/build-module/hooks/use-form-validity.js +52 -102
  160. package/build-module/hooks/use-form-validity.js.map +2 -2
  161. package/build-module/utils/filter-sort-and-paginate.js +5 -0
  162. package/build-module/utils/filter-sort-and-paginate.js.map +2 -2
  163. package/build-module/utils/operators.js +394 -0
  164. package/build-module/utils/operators.js.map +7 -0
  165. package/build-style/style-rtl.css +13 -80
  166. package/build-style/style.css +13 -80
  167. package/build-types/components/dataviews-filters/filter.d.ts.map +1 -1
  168. package/build-types/components/dataviews-filters/input-widget.d.ts.map +1 -1
  169. package/build-types/components/dataviews-filters/use-filters.d.ts.map +1 -1
  170. package/build-types/constants.d.ts +6 -12
  171. package/build-types/constants.d.ts.map +1 -1
  172. package/build-types/dataform-controls/number.d.ts.map +1 -1
  173. package/build-types/dataform-controls/textarea.d.ts.map +1 -1
  174. package/build-types/dataform-controls/utils/get-custom-validity.d.ts +2 -2
  175. package/build-types/dataform-controls/utils/get-custom-validity.d.ts.map +1 -1
  176. package/build-types/dataform-controls/utils/validated-input.d.ts.map +1 -1
  177. package/build-types/dataform-controls/utils/validated-number.d.ts.map +1 -1
  178. package/build-types/dataform-layouts/panel/modal.d.ts.map +1 -1
  179. package/build-types/dataviews-layouts/grid/composite-grid.d.ts.map +1 -1
  180. package/build-types/dataviews-layouts/table/index.d.ts.map +1 -1
  181. package/build-types/field-types/array.d.ts +9 -2
  182. package/build-types/field-types/array.d.ts.map +1 -1
  183. package/build-types/field-types/boolean.d.ts +9 -2
  184. package/build-types/field-types/boolean.d.ts.map +1 -1
  185. package/build-types/field-types/color.d.ts +9 -2
  186. package/build-types/field-types/color.d.ts.map +1 -1
  187. package/build-types/field-types/date.d.ts +6 -4
  188. package/build-types/field-types/date.d.ts.map +1 -1
  189. package/build-types/field-types/datetime.d.ts +6 -4
  190. package/build-types/field-types/datetime.d.ts.map +1 -1
  191. package/build-types/field-types/email.d.ts +15 -2
  192. package/build-types/field-types/email.d.ts.map +1 -1
  193. package/build-types/field-types/index.d.ts.map +1 -1
  194. package/build-types/field-types/integer.d.ts +17 -4
  195. package/build-types/field-types/integer.d.ts.map +1 -1
  196. package/build-types/field-types/media.d.ts +1 -4
  197. package/build-types/field-types/media.d.ts.map +1 -1
  198. package/build-types/field-types/no-type.d.ts +6 -4
  199. package/build-types/field-types/no-type.d.ts.map +1 -1
  200. package/build-types/field-types/number.d.ts +17 -4
  201. package/build-types/field-types/number.d.ts.map +1 -1
  202. package/build-types/field-types/password.d.ts +12 -4
  203. package/build-types/field-types/password.d.ts.map +1 -1
  204. package/build-types/field-types/telephone.d.ts +12 -4
  205. package/build-types/field-types/telephone.d.ts.map +1 -1
  206. package/build-types/field-types/text.d.ts +12 -4
  207. package/build-types/field-types/text.d.ts.map +1 -1
  208. package/build-types/field-types/url.d.ts +12 -4
  209. package/build-types/field-types/url.d.ts.map +1 -1
  210. package/build-types/field-types/utils/get-is-valid.d.ts +7 -0
  211. package/build-types/field-types/utils/get-is-valid.d.ts.map +1 -0
  212. package/build-types/field-types/utils/is-valid-elements.d.ts +6 -0
  213. package/build-types/field-types/utils/is-valid-elements.d.ts.map +1 -0
  214. package/build-types/field-types/utils/is-valid-max-length.d.ts +6 -0
  215. package/build-types/field-types/utils/is-valid-max-length.d.ts.map +1 -0
  216. package/build-types/field-types/utils/is-valid-max.d.ts +6 -0
  217. package/build-types/field-types/utils/is-valid-max.d.ts.map +1 -0
  218. package/build-types/field-types/utils/is-valid-min-length.d.ts +6 -0
  219. package/build-types/field-types/utils/is-valid-min-length.d.ts.map +1 -0
  220. package/build-types/field-types/utils/is-valid-min.d.ts +6 -0
  221. package/build-types/field-types/utils/is-valid-min.d.ts.map +1 -0
  222. package/build-types/field-types/utils/is-valid-pattern.d.ts +6 -0
  223. package/build-types/field-types/utils/is-valid-pattern.d.ts.map +1 -0
  224. package/build-types/field-types/utils/is-valid-required-for-array.d.ts +6 -0
  225. package/build-types/field-types/utils/is-valid-required-for-array.d.ts.map +1 -0
  226. package/build-types/field-types/utils/is-valid-required-for-bool.d.ts +6 -0
  227. package/build-types/field-types/utils/is-valid-required-for-bool.d.ts.map +1 -0
  228. package/build-types/field-types/utils/is-valid-required.d.ts +6 -0
  229. package/build-types/field-types/utils/is-valid-required.d.ts.map +1 -0
  230. package/build-types/hooks/use-form-validity.d.ts.map +1 -1
  231. package/build-types/stories/dataform.story.d.ts +9 -1
  232. package/build-types/stories/dataform.story.d.ts.map +1 -1
  233. package/build-types/stories/dataviews-picker.story.d.ts.map +1 -1
  234. package/build-types/stories/dataviews.story.d.ts +27 -2
  235. package/build-types/stories/dataviews.story.d.ts.map +1 -1
  236. package/build-types/stories/field-types.story.d.ts +39 -2
  237. package/build-types/stories/field-types.story.d.ts.map +1 -1
  238. package/build-types/types/field-api.d.ts +72 -4
  239. package/build-types/types/field-api.d.ts.map +1 -1
  240. package/build-types/types/private.d.ts +13 -3
  241. package/build-types/types/private.d.ts.map +1 -1
  242. package/build-types/utils/filter-sort-and-paginate.d.ts.map +1 -1
  243. package/build-types/utils/operators.d.ts +16 -0
  244. package/build-types/utils/operators.d.ts.map +1 -0
  245. package/build-wp/index.js +1548 -1452
  246. package/package.json +17 -16
  247. package/src/components/dataviews/style.scss +3 -28
  248. package/src/components/dataviews-filters/filter.tsx +34 -321
  249. package/src/components/dataviews-filters/input-widget.tsx +7 -5
  250. package/src/components/dataviews-filters/use-filters.ts +6 -3
  251. package/src/components/dataviews-footer/style.scss +1 -7
  252. package/src/constants.ts +6 -140
  253. package/src/dataform-controls/number.tsx +3 -3
  254. package/src/dataform-controls/textarea.tsx +7 -1
  255. package/src/dataform-controls/utils/get-custom-validity.ts +10 -2
  256. package/src/dataform-controls/utils/validated-input.tsx +8 -2
  257. package/src/dataform-controls/utils/validated-number.tsx +3 -1
  258. package/src/dataform-layouts/panel/modal.tsx +14 -5
  259. package/src/dataviews-layouts/activity/style.scss +1 -1
  260. package/src/dataviews-layouts/grid/composite-grid.tsx +64 -57
  261. package/src/dataviews-layouts/grid/style.scss +3 -12
  262. package/src/dataviews-layouts/table/index.tsx +9 -3
  263. package/src/dataviews-layouts/table/style.scss +4 -15
  264. package/src/dataviews-layouts/utils/grid-items.scss +1 -9
  265. package/src/field-types/array.tsx +26 -19
  266. package/src/field-types/boolean.tsx +22 -15
  267. package/src/field-types/color.tsx +22 -15
  268. package/src/field-types/date.tsx +14 -11
  269. package/src/field-types/datetime.tsx +6 -4
  270. package/src/field-types/email.tsx +24 -15
  271. package/src/field-types/index.tsx +12 -14
  272. package/src/field-types/integer.tsx +83 -17
  273. package/src/field-types/media.tsx +4 -4
  274. package/src/field-types/no-type.tsx +9 -6
  275. package/src/field-types/number.tsx +82 -16
  276. package/src/field-types/password.tsx +12 -4
  277. package/src/field-types/telephone.tsx +12 -4
  278. package/src/field-types/text.tsx +12 -4
  279. package/src/field-types/url.tsx +12 -4
  280. package/src/field-types/utils/get-is-valid.ts +103 -0
  281. package/src/field-types/utils/is-valid-elements.ts +20 -0
  282. package/src/field-types/utils/is-valid-max-length.ts +23 -0
  283. package/src/field-types/utils/is-valid-max.ts +23 -0
  284. package/src/field-types/utils/is-valid-min-length.ts +23 -0
  285. package/src/field-types/utils/is-valid-min.ts +23 -0
  286. package/src/field-types/utils/is-valid-pattern.ts +29 -0
  287. package/src/field-types/utils/is-valid-required-for-array.ts +18 -0
  288. package/src/field-types/utils/is-valid-required-for-bool.ts +13 -0
  289. package/src/field-types/utils/is-valid-required.ts +13 -0
  290. package/src/hooks/use-form-validity.ts +78 -156
  291. package/src/stories/dataform.story.tsx +126 -30
  292. package/src/stories/dataviews-picker.story.tsx +27 -17
  293. package/src/stories/dataviews.story.tsx +79 -30
  294. package/src/stories/field-types.story.tsx +86 -4
  295. package/src/test/filter-sort-and-paginate.js +2 -1
  296. package/src/test/normalize-fields.ts +87 -11
  297. package/src/test/use-form-validity.ts +796 -31
  298. package/src/types/field-api.ts +90 -4
  299. package/src/types/private.ts +26 -8
  300. package/src/utils/filter-sort-and-paginate.ts +5 -0
  301. package/src/utils/operators.tsx +448 -0
  302. package/tsconfig.json +1 -0
  303. package/tsconfig.tsbuildinfo +1 -1
package/CHANGELOG.md CHANGED
@@ -2,6 +2,25 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 11.1.0 (2025-12-23)
6
+
7
+ ### Code Quality
8
+
9
+ - DataViews: Remove extra wrapper for GridItem. [#73665](https://github.com/WordPress/gutenberg/pull/73665)
10
+
11
+ ### Bug Fixes
12
+
13
+ - Fix sticky footer in DataViews grid view. [#73661](https://github.com/WordPress/gutenberg/pull/73661)
14
+ - DataViews: Apply primary style to first column if there is no title field. [#73729](https://github.com/WordPress/gutenberg/pull/73729)
15
+
16
+ ### Enhancements
17
+
18
+ - Better labels for operators and deprecate the `isNotAll` operator. [#73671](https://github.com/WordPress/gutenberg/pull/73671)
19
+ - Field API: move validation to the field type. [#73642](https://github.com/WordPress/gutenberg/pull/73642)
20
+ - DataForm: add support for `min`/`max` and `minLength`/`maxLength` validation for relevant controls. [#73465](https://github.com/WordPress/gutenberg/pull/73465)
21
+ - Field API: display formats for `number` and `integer` types. [#73644](https://github.com/WordPress/gutenberg/pull/73644)
22
+ - DataViews: Update padding to 24px for consistency. [#73334](https://github.com/WordPress/gutenberg/pull/73334)
23
+
5
24
  ## 11.0.0 (2025-11-26)
6
25
 
7
26
  ### Enhancements
@@ -20,6 +39,7 @@
20
39
  - Documentation: surface better the `type` property in the documentation. [#73349](https://github.com/WordPress/gutenberg/pull/73349)
21
40
  - Documentation: improve DataView's `layout` prop. [#73470](https://github.com/WordPress/gutenberg/pull/73470)
22
41
  - Documentation: document `readOnly`, `description`, and `placeholder` properties. [#73515](https://github.com/WordPress/gutenberg/pull/73515)
42
+ - Documentation: add missing props in DataViews. [#73611](https://github.com/WordPress/gutenberg/pull/73611)
23
43
  - DataForm Panel Layout: Focus the first input element when the panel opens. [#72322](https://github.com/WordPress/gutenberg/pull/72322)
24
44
  - DataForm: Pattern validation is now supported on all fields that browsers support it in. [#73156](https://github.com/WordPress/gutenberg/pull/73156)
25
45
  - Documentation: improve operators docs. [#73523](https://github.com/WordPress/gutenberg/pull/73523)
package/README.md CHANGED
@@ -225,34 +225,33 @@ Properties:
225
225
 
226
226
  | Props / Layout | `table` | `pickerTable` | `grid` | `pickerGrid` | `list` | `activity` |
227
227
  | -------------- | ------- | ------------- | ------ | ------------ | ------ | ---------- |
228
- | `density` | ✓ | ✓ | | | | ✓ |
229
- | `enableMoving` | ✓ | ✓ | | | | |
230
- | `styles` | ✓ | ✓ | | | | |
228
+ | `density` | ✓ | ✓ | | | | ✓ |
229
+ | `enableMoving` | ✓ | ✓ | | | | |
230
+ | `styles` | ✓ | ✓ | | | | |
231
231
  | `badgeFields` | | | ✓ | ✓ | | |
232
232
  | `previewSize` | | | ✓ | ✓ | | |
233
233
 
234
234
  `table` and `pickerTable` layouts:
235
235
 
236
- - `density`: one of `comfortable`, `balanced`, or `compact`. Configures the size and spacing of the layout.
237
- - `enableMoving`: whether the table columns should display moving controls.
238
- - `styles`: additional `width`, `maxWidth`, `minWidth`, `align` styles for each field column.
236
+ - `density`: one of `comfortable`, `balanced`, or `compact`. Configures the size and spacing of the layout.
237
+ - `enableMoving`: whether the table columns should display moving controls.
238
+ - `styles`: additional `width`, `maxWidth`, `minWidth`, `align` styles for each field column.
239
239
 
240
240
  **For column alignment (`align` property), follow these guidelines:**
241
241
  Right-align whenever the cell value is fundamentally quantitative—numbers, decimals, currency, percentages—so that digits and decimal points line up, aiding comparison and calculation. Otherwise, default to left-alignment for all other types (text, codes, labels, dates).
242
242
 
243
243
  `grid` and `pickerGrid` layout:
244
244
 
245
- - `badgeFields`: a list of field's `id` to render without label and styled as badges.
246
- - `previewSize`: a `number` representing the size of the preview.
245
+ - `badgeFields`: a list of field's `id` to render without label and styled as badges.
246
+ - `previewSize`: a `number` representing the size of the preview.
247
247
 
248
248
  `list` layout:
249
249
 
250
- - None
250
+ - None
251
251
 
252
252
  `activity` layout:
253
253
 
254
- - `density`: one of `comfortable`, `balanced`, or `compact`. Configures the size and spacing of the layout.
255
-
254
+ - `density`: one of `comfortable`, `balanced`, or `compact`. Configures the size and spacing of the layout.
256
255
 
257
256
  #### `onChangeView`: `function`
258
257
 
@@ -374,6 +373,7 @@ const actions = [
374
373
 
375
374
  - `totalItems`: the total number of items in the datasets.
376
375
  - `totalPages`: the total number of pages, taking into account the total items in the dataset and the number of items per page provided by the user.
376
+ - `infiniteScrollHandler`: a function that handles infinite scrolling. This function should be called when the user scrolls to the bottom of the page. See [example in storybook](https://wordpress.github.io/gutenberg/?path=/story/dataviews-dataviews--infinite-scroll).
377
377
 
378
378
  #### `search`: `boolean`
379
379
 
@@ -404,7 +404,7 @@ const defaultLayouts = {
404
404
  };
405
405
  ```
406
406
 
407
- The `defaultLayouts` property should be an object that includes properties named `table`, `grid`, and/or `list`. These properties are applied to the view object each time the user switches to the corresponding layout.
407
+ The `defaultLayouts` property should be an object that includes properties named `table`, `grid`, `list`, and `activity`. These properties are applied to the view object each time the user switches to the corresponding layout.
408
408
 
409
409
  #### `selection`: `string[]`
410
410
 
@@ -426,6 +426,12 @@ Note: `DataViews` still requires at least one bulk action to make items selectab
426
426
 
427
427
  A function that determines if a media field or a primary field is clickable. It receives an item as an argument and returns a boolean value indicating whether the item can be clicked.
428
428
 
429
+ Note that layouts may still decide not to render clickable primary and media fields. For example, the `list` layout has a different interaction model and doesn't enable this feature.
430
+
431
+ #### `onClickItem`: `function`
432
+
433
+ A function that is called when an item is clicked. It receives the item as a parameter.
434
+
429
435
  #### `renderItemLink`: `React.ComponentType`
430
436
 
431
437
  A render function used to render clickable items.
@@ -853,29 +859,29 @@ For example:
853
859
 
854
860
  ```json
855
861
  {
856
- "title": {
857
- "required": {
858
- "type": "invalid"
859
- }
860
- },
861
- "author": {
862
- "elements": {
863
- "type": "invalid",
864
- "message": "Value must be one of the elements."
865
- }
866
- },
867
- "publisher": {
868
- "custom": {
869
- "type": "validating",
870
- "message": "Validating..."
871
- }
872
- },
873
- "isbn": {
874
- "custom": {
875
- "type": "valid",
876
- "message": "Valid."
877
- }
878
- }
862
+ "title": {
863
+ "required": {
864
+ "type": "invalid"
865
+ }
866
+ },
867
+ "author": {
868
+ "elements": {
869
+ "type": "invalid",
870
+ "message": "Value must be one of the elements."
871
+ }
872
+ },
873
+ "publisher": {
874
+ "custom": {
875
+ "type": "validating",
876
+ "message": "Validating..."
877
+ }
878
+ },
879
+ "isbn": {
880
+ "custom": {
881
+ "type": "valid",
882
+ "message": "Valid."
883
+ }
884
+ }
879
885
  }
880
886
  ```
881
887
 
@@ -885,11 +891,11 @@ The `message` is the text to be displayed in the UI controls. The message for th
885
891
 
886
892
  The `type` can be:
887
893
 
888
- - `validating`: when the value is being validated (e.g., custom async rule)
889
- - `invalid`: when the value is invalid according to the rule
890
- - `valid`: when the value _became_ valid after having been invalid (e.g., custom async rule)
894
+ - `validating`: when the value is being validated (e.g., custom async rule)
895
+ - `invalid`: when the value is invalid according to the rule
896
+ - `valid`: when the value _became_ valid after having been invalid (e.g., custom async rule)
891
897
 
892
- Note the `valid` status. This is useful for displaying a "Valid." message when the field transitions from invalid to valid. The `useFormValidity` hook implements this only for the custom async validation.
898
+ Note the `valid` status. This is useful for displaying a "Valid." message when the field transitions from invalid to valid. The `useFormValidity` hook implements this only for the custom async validation.
893
899
 
894
900
  ## Utilities
895
901
 
@@ -964,7 +970,7 @@ The user facing description of the action.
964
970
 
965
971
  ```js
966
972
  {
967
- label: Trash
973
+ label: 'Trash'
968
974
  }
969
975
  ```
970
976
 
@@ -1395,7 +1401,7 @@ Field authors can override the default Edit control by providing a string that m
1395
1401
 
1396
1402
  Additionally, some of the bundled Edit controls are configurable via a config object:
1397
1403
 
1398
- - `textarea` configuration:
1404
+ - `textarea` configuration:
1399
1405
 
1400
1406
  ```js
1401
1407
  {
@@ -1409,7 +1415,7 @@ Additionally, some of the bundled Edit controls are configurable via a config ob
1409
1415
  }
1410
1416
  ```
1411
1417
 
1412
- - `text` configuration:
1418
+ - `text` configuration:
1413
1419
 
1414
1420
  ```js
1415
1421
  {
@@ -1489,9 +1495,9 @@ When the field declares a type, it gets a default sort function:
1489
1495
 
1490
1496
  The default sorting can be overriden by providing a custom sort function. It takes the following arguments:
1491
1497
 
1492
- - `a`: the first item to compare
1493
- - `b`: the second item to compare
1494
- - `direction`: either `asc` (ascending) or `desc` (descending)
1498
+ - `a`: the first item to compare
1499
+ - `b`: the second item to compare
1500
+ - `direction`: either `asc` (ascending) or `desc` (descending)
1495
1501
 
1496
1502
  It should return a number where:
1497
1503
 
@@ -1705,7 +1711,7 @@ Note this function may be called many times in the lifetime of the DataViews/Dat
1705
1711
 
1706
1712
  ### `filterBy`
1707
1713
 
1708
- Configuration of the filters. Set to `false` to opt the field out of filtering entirely.
1714
+ Configuration of the filters. Set to `false` to opt the field out of filtering entirely.
1709
1715
 
1710
1716
  - Type: `object` | `boolean`.
1711
1717
  - Optional.
@@ -1797,63 +1803,64 @@ Or multi-selection operators:
1797
1803
  { value: 'd', label: 'Product D' },
1798
1804
  ],
1799
1805
  filterBy: {
1800
- operators: [ `isAny`, `isNone`, `isAll`, `isNotAll` ];
1806
+ operators: [ `isAny`, `isNone`, `isAll` ];
1801
1807
  }
1802
1808
  }
1803
1809
  ```
1804
1810
 
1805
1811
  The next table lists all available operators:
1806
1812
 
1807
- | Operator | Description | Example |
1808
- | -------------------- | ---------------------------------------------------------------------------------------------------- | -------------------------------------------------- |
1809
- | `after` | `AFTER`. The item's field is after a given date. | Date is after: 2024-01-01 |
1810
- | `afterInc` | `AFTER (Inc)`. The item's field is after a given date, including the date. | Date is on or after: 2024-01-01 |
1811
- | `before` | `BEFORE`. The item's field is before a given date. | Date is before: 2024-01-01 |
1812
- | `beforeInc` | `BEFORE (Inc)`. The item's field is before a given date, including the date. | Date is on or before: 2024-01-01 |
1813
- | `between` | `BETWEEN`. The item's field is between two values. | Count between (inc): 10 and 180 |
1814
- | `contains` | `CONTAINS`. The item's field contains the given substring. | Title contains: Mars |
1815
- | `greaterThan` | `GREATER THAN`. The item's field is numerically greater than a single value. | Age is greater than: 65 |
1816
- | `greaterThanOrEqual` | `GREATER THAN OR EQUAL TO`. The item's field is numerically greater than or equal to a single value. | Age is greater than or equal to: 65 |
1817
- | `inThePast` | `IN THE PAST`. The item's field is within the last N units (days, weeks, months, or years) from now. | Orders in the past: 7 days |
1818
- | `isAll` | `AND`. The item's field has all of the values in the list. | Category is all: Book, Review, Science Fiction |
1819
- | `isAny` | `OR`. The item's field is present in a list of values. | Author is any: Admin, Editor |
1820
- | `isNone` | `NOT OR`. The item's field is not present in a list of values. | Author is none: Admin, Editor |
1821
- | `isNot` | `NOT EQUAL TO`. The item's field is not equal to a single value. | Author is not Admin |
1822
- | `isNotAll` | `NOT AND`. The item's field doesn't have all of the values in the list. | Category is not all: Book, Review, Science Fiction |
1823
- | `is` | `EQUAL TO`. The item's field is equal to a single value. | Author is: Admin |
1824
- | `lessThan` | `LESS THAN`. The item's field is numerically less than a single value. | Age is less than: 18 |
1825
- | `lessThanOrEqual` | `LESS THAN OR EQUAL TO`. The item's field is numerically less than or equal to a single value. | Age is less than or equal to: 18 |
1826
- | `notContains` | `NOT CONTAINS`. The item's field does not contain the given substring. | Description doesn't contain: photo |
1827
- | `notOn` | `NOT ON`. The item's field is not on a given date (date inequality using proper date parsing). | Date is not: 2024-01-01 |
1828
- | `on` | `ON`. The item's field is on a given date (date equality using proper date parsing). | Date is: 2024-01-01 |
1829
- | `over` | `OVER`. The item's field is older than N units (days, weeks, months, or years) from now. | Orders over: 7 days ago |
1830
- | `startsWith` | `STARTS WITH`. The item's field starts with the given substring. | Title starts with: Mar |
1831
-
1832
- Some operators are single-selection: `is`, `isNot`, `on`, `notOn`, `lessThan`, `greaterThan`, `lessThanOrEqual`, `greaterThanOrEqual`, `before`, `after`, `beforeInc`, `afterInc`, `contains`, `notContains`, and `startsWith`. Others are multi-selection: `isAny`, `isNone`, `isAll`, and `isNotAll`. A filter cannot mix single-selection & multi-selection operators; if a single-selection operator is present in the list of valid operators, the multi-selection ones will be discarded, and the filter won't allow selecting more than one item.
1813
+ | Operator | Description | Example |
1814
+ | -------------------- | ------------------------------------------------------------------------------- | ---------------------------------------------------- |
1815
+ | `after` | The result is after a given date. | Date is after: 2024-01-01 |
1816
+ | `afterInc` | The result is after a given date, including the date. | Date is on or after: 2024-01-01 |
1817
+ | `before` | The result is before a given date. | Date is before: 2024-01-01 |
1818
+ | `beforeInc` | The result is before a given date, including the date. | Date is on or before: 2024-01-01 |
1819
+ | `between` | The result is between two values. | Count between (inc): 10 and 180 |
1820
+ | `contains` | The result contains the given substring. | Title contains: Mars |
1821
+ | `greaterThan` | The result is numerically greater than a single value. | Age is greater than: 65 |
1822
+ | `greaterThanOrEqual` | The result is numerically greater than or equal to a single value. | Age is greater than or equal to: 65 |
1823
+ | `inThePast` | The result is within the last N units (days, weeks, months, or years) from now. | Orders in the past: 7 days |
1824
+ | `isAll` | The result includes all values in the list. | Category includes all: Book, Review, Science Fiction |
1825
+ | `isAny` | The result includes some values in the list. | Author includes: Admin, Editor |
1826
+ | `isNone` | The result does not include some values in the list. | Author excludes: Admin, Editor |
1827
+ | `is` | The result is equal to a single value. | Author is: Admin |
1828
+ | `isNot` | The result is not equal to a single value. | Author is not: Admin |
1829
+ | `lessThan` | The result is numerically less than a single value. | Age is less than: 18 |
1830
+ | `lessThanOrEqual` | The result is numerically less than or equal to a single value. | Age is less than or equal to: 18 |
1831
+ | `notContains` | The result does not contain the given substring. | Description doesn't contain: photo |
1832
+ | `notOn` | The result is not on a given date (date inequality using proper date parsing). | Date is not: 2024-01-01 |
1833
+ | `on` | The result is on a given date (date equality using proper date parsing). | Date is: 2024-01-01 |
1834
+ | `over` | The result is older than N units (days, weeks, months, or years) from now. | Orders over: 7 days ago |
1835
+ | `startsWith` | The result starts with the given substring. | Title starts with: Mar |
1836
+
1837
+ Some operators are single-selection: `is`, `isNot`, `on`, `notOn`, `lessThan`, `greaterThan`, `lessThanOrEqual`, `greaterThanOrEqual`, `before`, `after`, `beforeInc`, `afterInc`, `contains`, `notContains`, and `startsWith`. Others are multi-selection: `isAny`, `isNone`, `isAll`. A filter cannot mix single-selection & multi-selection operators; if a single-selection operator is present in the list of valid operators, the multi-selection ones will be discarded, and the filter won't allow selecting more than one item.
1833
1838
 
1834
1839
  Valid operators per field type:
1835
1840
 
1836
- - array: `isAny`, `isNone`, `isAll`, `isNotAll`.
1837
- - boolean: `is`, `isNot`.
1838
- - color: `is`, `isNot`, `isAny`, `isNone`.
1839
- - date: `on`, `notOn`, `before`, `beforeInc`, `after`, `afterInc`, `inThePast`, `over`, `between`.
1840
- - datetime: `on`, `notOn`, `before`, `beforeInc`, `after`, `afterInc`, `inThePast`, `over`.
1841
- - email: `is`, `isNot`, `contains`, `notContains`, `startsWith`, `isAny`, `isNone`, `isAll`, `isNotAll`.
1842
- - integer: `is`, `isNot`, `lessThan`, `greaterThan`, `lessThanOrEqual`, `greaterThanOrEqual`, `between`, `isAny`, `isNone`, `isAll`, `isNotAll`.
1843
- - media: none.
1844
- - number: `is`, `isNot`, `lessThan`, `greaterThan`, `lessThanOrEqual`, `greaterThanOrEqual`, `between`, `isAny`, `isNone`, `isAll`, `isNotAll`.
1845
- - password: none.
1846
- - email: `is`, `isNot`, `contains`, `notContains`, `startsWith`, `isAny`, `isNone`, `isAll`, `isNotAll`.
1847
- - text: `is`, `isNot`, `contains`, `notContains`, `startsWith`, `isAny`, `isNone`, `isAll`, `isNotAll`.
1848
- - url: `is`, `isNot`, `contains`, `notContains`, `startsWith`, `isAny`, `isNone`, `isAll`, `isNotAll`.
1849
- - fields with no type: any operator.
1841
+ - array: `isAny`, `isNone`, `isAll`.
1842
+ - boolean: `is`, `isNot`.
1843
+ - color: `is`, `isNot`, `isAny`, `isNone`.
1844
+ - date: `on`, `notOn`, `before`, `beforeInc`, `after`, `afterInc`, `inThePast`, `over`, `between`.
1845
+ - datetime: `on`, `notOn`, `before`, `beforeInc`, `after`, `afterInc`, `inThePast`, `over`.
1846
+ - email: `is`, `isNot`, `contains`, `notContains`, `startsWith`, `isAny`, `isNone`, `isAll`.
1847
+ - integer: `is`, `isNot`, `lessThan`, `greaterThan`, `lessThanOrEqual`, `greaterThanOrEqual`, `between`, `isAny`, `isNone`, `isAll`.
1848
+ - media: none.
1849
+ - number: `is`, `isNot`, `lessThan`, `greaterThan`, `lessThanOrEqual`, `greaterThanOrEqual`, `between`, `isAny`, `isNone`, `isAll`.
1850
+ - password: none.
1851
+ - email: `is`, `isNot`, `contains`, `notContains`, `startsWith`, `isAny`, `isNone`, `isAll`.
1852
+ - text: `is`, `isNot`, `contains`, `notContains`, `startsWith`, `isAny`, `isNone`, `isAll`.
1853
+ - url: `is`, `isNot`, `contains`, `notContains`, `startsWith`, `isAny`, `isNone`, `isAll`.
1854
+ - fields with no type: any operator.
1850
1855
 
1851
1856
  ### `format`
1852
1857
 
1853
- Display format configuration for fields. Currently supported for date fields. This configuration affects how the field is displayed in the `render` method, the `Edit` control, and filter controls.
1858
+ Display format configuration for fields. Supported for date, number, and integer fields. This configuration affects how the field is displayed in the `render` method, the `Edit` control, and filter controls.
1854
1859
 
1855
1860
  - Type: `object`.
1856
1861
  - Optional.
1862
+
1863
+ For `date` fields:
1857
1864
  - Properties:
1858
1865
  - `date`: The format string using PHP date format (e.g., 'F j, Y' for 'March 10, 2023'). Optional, defaults to WordPress "Date Format" setting.
1859
1866
  - `weekStartsOn`: Specifies the first day of the week for calendar controls. One of 0, 1, 2, 3, 4, 5, 6. Optional, defaults to WordPress "Week Starts On" setting, whose value is 0 (Sunday).
@@ -1872,6 +1879,46 @@ Example:
1872
1879
  }
1873
1880
  ```
1874
1881
 
1882
+ For `number` fields:
1883
+
1884
+ - Properties:
1885
+ - `separatorThousand`: The character used as thousand separator (e.g., ',' for '1,234'). Optional, defaults to ','.
1886
+ - `separatorDecimal`: The character used as decimal separator (e.g., '.' for '1.23'). Optional, defaults to '.'.
1887
+ - `decimals`: Number of decimal places to display (0-100). Optional, defaults to 2.
1888
+
1889
+ Example:
1890
+
1891
+ ```js
1892
+ {
1893
+ id: 'price',
1894
+ type: 'number',
1895
+ label: 'Price',
1896
+ format: {
1897
+ separatorThousand: ',',
1898
+ separatorDecimal: '.',
1899
+ decimals: 2,
1900
+ },
1901
+ }
1902
+ ```
1903
+
1904
+ For `integer` fields:
1905
+
1906
+ - Properties:
1907
+ - `separatorThousand`: The character used as thousand separator (e.g., ',' for '1,234'). Optional, defaults to ','.
1908
+
1909
+ Example:
1910
+
1911
+ ```js
1912
+ {
1913
+ id: 'quantity',
1914
+ type: 'integer',
1915
+ label: 'Quantity',
1916
+ format: {
1917
+ separatorThousand: ',',
1918
+ },
1919
+ }
1920
+ ```
1921
+
1875
1922
  ## Form Field API
1876
1923
 
1877
1924
  ### `id`
@@ -1912,11 +1959,11 @@ For example:
1912
1959
 
1913
1960
  #### Panel
1914
1961
 
1915
- - `type`: `panel`. Required.
1916
- - `labelPosition`: one of `side`, `top`, or `none`. Optional. `top` by default.
1917
- - `summary`: Summary field configuration. Optional. Specifies which field(s) to display in the panel header. Can be:
1918
- - A string (single field ID)
1919
- - An array of strings (multiple field IDs)
1962
+ - `type`: `panel`. Required.
1963
+ - `labelPosition`: one of `side`, `top`, or `none`. Optional. `top` by default.
1964
+ - `summary`: Summary field configuration. Optional. Specifies which field(s) to display in the panel header. Can be:
1965
+ - A string (single field ID)
1966
+ - An array of strings (multiple field IDs)
1920
1967
 
1921
1968
  When no summary fields are explicitly configured, the panel automatically determines which fields to display using this priority:
1922
1969