@wordpress/dataviews 4.22.0 → 5.0.1-next.719a03cbe.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 (335) hide show
  1. package/CHANGELOG.md +39 -0
  2. package/README.md +146 -32
  3. package/build/components/dataviews/index.js +71 -37
  4. package/build/components/dataviews/index.js.map +1 -1
  5. package/build/components/dataviews-context/index.js +15 -1
  6. package/build/components/dataviews-context/index.js.map +1 -1
  7. package/build/components/dataviews-filters/{filter-summary.js → filter.js} +108 -17
  8. package/build/components/dataviews-filters/filter.js.map +1 -0
  9. package/build/components/dataviews-filters/index.js +21 -20
  10. package/build/components/dataviews-filters/index.js.map +1 -1
  11. package/build/components/dataviews-filters/input-widget.js +76 -0
  12. package/build/components/dataviews-filters/input-widget.js.map +1 -0
  13. package/build/components/dataviews-filters/search-widget.js +33 -39
  14. package/build/components/dataviews-filters/search-widget.js.map +1 -1
  15. package/build/components/dataviews-filters/utils.js +25 -0
  16. package/build/components/dataviews-filters/utils.js.map +1 -0
  17. package/build/components/dataviews-item-actions/index.js +1 -1
  18. package/build/components/dataviews-item-actions/index.js.map +1 -1
  19. package/build/components/dataviews-layout/index.js +7 -2
  20. package/build/components/dataviews-layout/index.js.map +1 -1
  21. package/build/components/dataviews-pagination/index.js +4 -3
  22. package/build/components/dataviews-pagination/index.js.map +1 -1
  23. package/build/components/dataviews-selection-checkbox/index.js.map +1 -1
  24. package/build/components/dataviews-view-config/index.js +10 -19
  25. package/build/components/dataviews-view-config/index.js.map +1 -1
  26. package/build/constants.js +83 -2
  27. package/build/constants.js.map +1 -1
  28. package/build/dataform-controls/boolean.js +42 -0
  29. package/build/dataform-controls/boolean.js.map +1 -0
  30. package/build/dataform-controls/checkbox.js +44 -0
  31. package/build/dataform-controls/checkbox.js.map +1 -0
  32. package/build/dataform-controls/datetime.js +96 -2
  33. package/build/dataform-controls/datetime.js.map +1 -1
  34. package/build/dataform-controls/email.js +48 -0
  35. package/build/dataform-controls/email.js.map +1 -0
  36. package/build/dataform-controls/index.js +9 -1
  37. package/build/dataform-controls/index.js.map +1 -1
  38. package/build/dataform-controls/integer.js +49 -1
  39. package/build/dataform-controls/integer.js.map +1 -1
  40. package/build/dataform-controls/select.js +1 -0
  41. package/build/dataform-controls/select.js.map +1 -1
  42. package/build/dataform-controls/text.js +3 -1
  43. package/build/dataform-controls/text.js.map +1 -1
  44. package/build/dataform-controls/toggle-group.js +52 -0
  45. package/build/dataform-controls/toggle-group.js.map +1 -0
  46. package/build/dataforms-layouts/data-form-layout.js +1 -1
  47. package/build/dataforms-layouts/data-form-layout.js.map +1 -1
  48. package/build/dataforms-layouts/panel/index.js +14 -5
  49. package/build/dataforms-layouts/panel/index.js.map +1 -1
  50. package/build/dataforms-layouts/regular/index.js +23 -4
  51. package/build/dataforms-layouts/regular/index.js.map +1 -1
  52. package/build/dataviews-layouts/grid/index.js +31 -25
  53. package/build/dataviews-layouts/grid/index.js.map +1 -1
  54. package/build/dataviews-layouts/list/index.js +11 -6
  55. package/build/dataviews-layouts/list/index.js.map +1 -1
  56. package/build/dataviews-layouts/table/column-header-menu.js +9 -7
  57. package/build/dataviews-layouts/table/column-header-menu.js.map +1 -1
  58. package/build/dataviews-layouts/table/column-primary.js +18 -13
  59. package/build/dataviews-layouts/table/column-primary.js.map +1 -1
  60. package/build/dataviews-layouts/table/index.js +46 -14
  61. package/build/dataviews-layouts/table/index.js.map +1 -1
  62. package/build/dataviews-layouts/table/use-is-horizontal-scroll-end.js +65 -0
  63. package/build/dataviews-layouts/table/use-is-horizontal-scroll-end.js.map +1 -0
  64. package/build/dataviews-layouts/utils/item-click-wrapper.js +77 -0
  65. package/build/dataviews-layouts/utils/item-click-wrapper.js.map +1 -0
  66. package/build/field-types/array.js +62 -0
  67. package/build/field-types/array.js.map +1 -0
  68. package/build/field-types/boolean.js +71 -0
  69. package/build/field-types/boolean.js.map +1 -0
  70. package/build/field-types/datetime.js +19 -1
  71. package/build/field-types/datetime.js.map +1 -1
  72. package/build/field-types/email.js +60 -0
  73. package/build/field-types/email.js.map +1 -0
  74. package/build/field-types/index.js +38 -1
  75. package/build/field-types/index.js.map +1 -1
  76. package/build/field-types/integer.js +23 -1
  77. package/build/field-types/integer.js.map +1 -1
  78. package/build/field-types/media.js +31 -0
  79. package/build/field-types/media.js.map +1 -0
  80. package/build/field-types/text.js +23 -1
  81. package/build/field-types/text.js.map +1 -1
  82. package/build/filter-and-sort-data-view.js +152 -1
  83. package/build/filter-and-sort-data-view.js.map +1 -1
  84. package/build/normalize-fields.js +72 -11
  85. package/build/normalize-fields.js.map +1 -1
  86. package/build/types.js.map +1 -1
  87. package/build/utils.js +11 -19
  88. package/build/utils.js.map +1 -1
  89. package/build-module/components/dataviews/index.js +74 -40
  90. package/build-module/components/dataviews/index.js.map +1 -1
  91. package/build-module/components/dataviews-context/index.js +16 -2
  92. package/build-module/components/dataviews-context/index.js.map +1 -1
  93. package/build-module/components/dataviews-filters/filter.js +309 -0
  94. package/build-module/components/dataviews-filters/filter.js.map +1 -0
  95. package/build-module/components/dataviews-filters/index.js +22 -21
  96. package/build-module/components/dataviews-filters/index.js.map +1 -1
  97. package/build-module/components/dataviews-filters/input-widget.js +69 -0
  98. package/build-module/components/dataviews-filters/input-widget.js.map +1 -0
  99. package/build-module/components/dataviews-filters/search-widget.js +31 -37
  100. package/build-module/components/dataviews-filters/search-widget.js.map +1 -1
  101. package/build-module/components/dataviews-filters/utils.js +18 -0
  102. package/build-module/components/dataviews-filters/utils.js.map +1 -0
  103. package/build-module/components/dataviews-item-actions/index.js +1 -1
  104. package/build-module/components/dataviews-item-actions/index.js.map +1 -1
  105. package/build-module/components/dataviews-layout/index.js +7 -2
  106. package/build-module/components/dataviews-layout/index.js.map +1 -1
  107. package/build-module/components/dataviews-pagination/index.js +4 -4
  108. package/build-module/components/dataviews-pagination/index.js.map +1 -1
  109. package/build-module/components/dataviews-selection-checkbox/index.js.map +1 -1
  110. package/build-module/components/dataviews-view-config/index.js +9 -20
  111. package/build-module/components/dataviews-view-config/index.js.map +1 -1
  112. package/build-module/constants.js +82 -1
  113. package/build-module/constants.js.map +1 -1
  114. package/build-module/dataform-controls/boolean.js +35 -0
  115. package/build-module/dataform-controls/boolean.js.map +1 -0
  116. package/build-module/dataform-controls/checkbox.js +37 -0
  117. package/build-module/dataform-controls/checkbox.js.map +1 -0
  118. package/build-module/dataform-controls/datetime.js +98 -3
  119. package/build-module/dataform-controls/datetime.js.map +1 -1
  120. package/build-module/dataform-controls/email.js +41 -0
  121. package/build-module/dataform-controls/email.js.map +1 -0
  122. package/build-module/dataform-controls/index.js +9 -1
  123. package/build-module/dataform-controls/index.js.map +1 -1
  124. package/build-module/dataform-controls/integer.js +51 -3
  125. package/build-module/dataform-controls/integer.js.map +1 -1
  126. package/build-module/dataform-controls/select.js +1 -0
  127. package/build-module/dataform-controls/select.js.map +1 -1
  128. package/build-module/dataform-controls/text.js +3 -1
  129. package/build-module/dataform-controls/text.js.map +1 -1
  130. package/build-module/dataform-controls/toggle-group.js +45 -0
  131. package/build-module/dataform-controls/toggle-group.js.map +1 -0
  132. package/build-module/dataforms-layouts/data-form-layout.js +1 -1
  133. package/build-module/dataforms-layouts/data-form-layout.js.map +1 -1
  134. package/build-module/dataforms-layouts/panel/index.js +14 -5
  135. package/build-module/dataforms-layouts/panel/index.js.map +1 -1
  136. package/build-module/dataforms-layouts/regular/index.js +23 -4
  137. package/build-module/dataforms-layouts/regular/index.js.map +1 -1
  138. package/build-module/dataviews-layouts/grid/index.js +31 -26
  139. package/build-module/dataviews-layouts/grid/index.js.map +1 -1
  140. package/build-module/dataviews-layouts/list/index.js +11 -6
  141. package/build-module/dataviews-layouts/list/index.js.map +1 -1
  142. package/build-module/dataviews-layouts/table/column-header-menu.js +9 -7
  143. package/build-module/dataviews-layouts/table/column-header-menu.js.map +1 -1
  144. package/build-module/dataviews-layouts/table/column-primary.js +18 -12
  145. package/build-module/dataviews-layouts/table/column-primary.js.map +1 -1
  146. package/build-module/dataviews-layouts/table/index.js +47 -16
  147. package/build-module/dataviews-layouts/table/index.js.map +1 -1
  148. package/build-module/dataviews-layouts/table/use-is-horizontal-scroll-end.js +58 -0
  149. package/build-module/dataviews-layouts/table/use-is-horizontal-scroll-end.js.map +1 -0
  150. package/build-module/dataviews-layouts/utils/item-click-wrapper.js +71 -0
  151. package/build-module/dataviews-layouts/utils/item-click-wrapper.js.map +1 -0
  152. package/build-module/field-types/array.js +57 -0
  153. package/build-module/field-types/array.js.map +1 -0
  154. package/build-module/field-types/boolean.js +65 -0
  155. package/build-module/field-types/boolean.js.map +1 -0
  156. package/build-module/field-types/datetime.js +19 -1
  157. package/build-module/field-types/datetime.js.map +1 -1
  158. package/build-module/field-types/email.js +54 -0
  159. package/build-module/field-types/email.js.map +1 -0
  160. package/build-module/field-types/index.js +38 -1
  161. package/build-module/field-types/index.js.map +1 -1
  162. package/build-module/field-types/integer.js +23 -1
  163. package/build-module/field-types/integer.js.map +1 -1
  164. package/build-module/field-types/media.js +25 -0
  165. package/build-module/field-types/media.js.map +1 -0
  166. package/build-module/field-types/text.js +23 -1
  167. package/build-module/field-types/text.js.map +1 -1
  168. package/build-module/filter-and-sort-data-view.js +153 -2
  169. package/build-module/filter-and-sort-data-view.js.map +1 -1
  170. package/build-module/normalize-fields.js +72 -11
  171. package/build-module/normalize-fields.js.map +1 -1
  172. package/build-module/types.js.map +1 -1
  173. package/build-module/utils.js +10 -17
  174. package/build-module/utils.js.map +1 -1
  175. package/build-style/style-rtl.css +307 -13
  176. package/build-style/style.css +307 -13
  177. package/build-types/components/dataform/stories/index.story.d.ts.map +1 -1
  178. package/build-types/components/dataviews/index.d.ts +24 -3
  179. package/build-types/components/dataviews/index.d.ts.map +1 -1
  180. package/build-types/components/dataviews/stories/fixtures.d.ts +9 -1
  181. package/build-types/components/dataviews/stories/fixtures.d.ts.map +1 -1
  182. package/build-types/components/dataviews/stories/index.story.d.ts +22 -4
  183. package/build-types/components/dataviews/stories/index.story.d.ts.map +1 -1
  184. package/build-types/components/dataviews-context/index.d.ts +14 -1
  185. package/build-types/components/dataviews-context/index.d.ts.map +1 -1
  186. package/build-types/components/dataviews-filters/filter.d.ts +15 -0
  187. package/build-types/components/dataviews-filters/filter.d.ts.map +1 -0
  188. package/build-types/components/dataviews-filters/index.d.ts +3 -8
  189. package/build-types/components/dataviews-filters/index.d.ts.map +1 -1
  190. package/build-types/components/dataviews-filters/input-widget.d.ts +13 -0
  191. package/build-types/components/dataviews-filters/input-widget.d.ts.map +1 -0
  192. package/build-types/components/dataviews-filters/search-widget.d.ts +4 -5
  193. package/build-types/components/dataviews-filters/search-widget.d.ts.map +1 -1
  194. package/build-types/components/dataviews-filters/utils.d.ts +6 -0
  195. package/build-types/components/dataviews-filters/utils.d.ts.map +1 -0
  196. package/build-types/components/dataviews-layout/index.d.ts +5 -1
  197. package/build-types/components/dataviews-layout/index.d.ts.map +1 -1
  198. package/build-types/components/dataviews-pagination/index.d.ts +1 -1
  199. package/build-types/components/dataviews-pagination/index.d.ts.map +1 -1
  200. package/build-types/components/dataviews-selection-checkbox/index.d.ts +2 -2
  201. package/build-types/components/dataviews-selection-checkbox/index.d.ts.map +1 -1
  202. package/build-types/components/dataviews-view-config/index.d.ts +3 -4
  203. package/build-types/components/dataviews-view-config/index.d.ts.map +1 -1
  204. package/build-types/components/stories/index.story.d.ts +59 -0
  205. package/build-types/components/stories/index.story.d.ts.map +1 -0
  206. package/build-types/constants.d.ts +20 -3
  207. package/build-types/constants.d.ts.map +1 -1
  208. package/build-types/dataform-controls/boolean.d.ts +6 -0
  209. package/build-types/dataform-controls/boolean.d.ts.map +1 -0
  210. package/build-types/dataform-controls/checkbox.d.ts +6 -0
  211. package/build-types/dataform-controls/checkbox.d.ts.map +1 -0
  212. package/build-types/dataform-controls/datetime.d.ts +1 -1
  213. package/build-types/dataform-controls/datetime.d.ts.map +1 -1
  214. package/build-types/dataform-controls/email.d.ts +6 -0
  215. package/build-types/dataform-controls/email.d.ts.map +1 -0
  216. package/build-types/dataform-controls/index.d.ts +1 -1
  217. package/build-types/dataform-controls/index.d.ts.map +1 -1
  218. package/build-types/dataform-controls/integer.d.ts +1 -4
  219. package/build-types/dataform-controls/integer.d.ts.map +1 -1
  220. package/build-types/dataform-controls/select.d.ts.map +1 -1
  221. package/build-types/dataform-controls/text.d.ts.map +1 -1
  222. package/build-types/dataform-controls/toggle-group.d.ts +6 -0
  223. package/build-types/dataform-controls/toggle-group.d.ts.map +1 -0
  224. package/build-types/dataforms-layouts/panel/index.d.ts.map +1 -1
  225. package/build-types/dataforms-layouts/regular/index.d.ts.map +1 -1
  226. package/build-types/dataviews-layouts/grid/index.d.ts +2 -1
  227. package/build-types/dataviews-layouts/grid/index.d.ts.map +1 -1
  228. package/build-types/dataviews-layouts/index.d.ts +3 -3
  229. package/build-types/dataviews-layouts/list/index.d.ts.map +1 -1
  230. package/build-types/dataviews-layouts/table/column-header-menu.d.ts.map +1 -1
  231. package/build-types/dataviews-layouts/table/column-primary.d.ts +8 -1
  232. package/build-types/dataviews-layouts/table/column-primary.d.ts.map +1 -1
  233. package/build-types/dataviews-layouts/table/index.d.ts +1 -1
  234. package/build-types/dataviews-layouts/table/index.d.ts.map +1 -1
  235. package/build-types/dataviews-layouts/table/use-is-horizontal-scroll-end.d.ts +19 -0
  236. package/build-types/dataviews-layouts/table/use-is-horizontal-scroll-end.d.ts.map +1 -0
  237. package/build-types/dataviews-layouts/utils/item-click-wrapper.d.ts +15 -0
  238. package/build-types/dataviews-layouts/utils/item-click-wrapper.d.ts.map +1 -0
  239. package/build-types/field-types/array.d.ts +7 -0
  240. package/build-types/field-types/array.d.ts.map +1 -0
  241. package/build-types/field-types/boolean.d.ts +19 -0
  242. package/build-types/field-types/boolean.d.ts.map +1 -0
  243. package/build-types/field-types/datetime.d.ts +7 -1
  244. package/build-types/field-types/datetime.d.ts.map +1 -1
  245. package/build-types/field-types/email.d.ts +19 -0
  246. package/build-types/field-types/email.d.ts.map +1 -0
  247. package/build-types/field-types/index.d.ts +2 -10
  248. package/build-types/field-types/index.d.ts.map +1 -1
  249. package/build-types/field-types/integer.d.ts +7 -1
  250. package/build-types/field-types/integer.d.ts.map +1 -1
  251. package/build-types/field-types/media.d.ts +16 -0
  252. package/build-types/field-types/media.d.ts.map +1 -0
  253. package/build-types/field-types/text.d.ts +7 -1
  254. package/build-types/field-types/text.d.ts.map +1 -1
  255. package/build-types/filter-and-sort-data-view.d.ts.map +1 -1
  256. package/build-types/normalize-fields.d.ts.map +1 -1
  257. package/build-types/types.d.ts +70 -8
  258. package/build-types/types.d.ts.map +1 -1
  259. package/build-types/utils.d.ts +5 -2
  260. package/build-types/utils.d.ts.map +1 -1
  261. package/build-wp/index.js +2545 -994
  262. package/package.json +18 -12
  263. package/src/components/dataform/stories/index.story.tsx +41 -20
  264. package/src/components/dataviews/index.tsx +108 -43
  265. package/src/components/dataviews/stories/fixtures.tsx +58 -13
  266. package/src/components/dataviews/stories/index.story.tsx +228 -7
  267. package/src/components/dataviews/stories/style.css +24 -3
  268. package/src/components/dataviews/style.scss +27 -0
  269. package/src/components/dataviews-context/index.ts +30 -2
  270. package/src/components/dataviews-filters/filter.tsx +603 -0
  271. package/src/components/dataviews-filters/index.tsx +23 -29
  272. package/src/components/dataviews-filters/input-widget.tsx +91 -0
  273. package/src/components/dataviews-filters/search-widget.tsx +51 -48
  274. package/src/components/dataviews-filters/style.scss +117 -14
  275. package/src/components/dataviews-filters/utils.ts +25 -0
  276. package/src/components/dataviews-item-actions/index.tsx +1 -1
  277. package/src/components/dataviews-layout/index.tsx +8 -1
  278. package/src/components/dataviews-pagination/index.tsx +4 -4
  279. package/src/components/dataviews-selection-checkbox/index.tsx +2 -2
  280. package/src/components/dataviews-view-config/index.tsx +10 -18
  281. package/src/components/stories/index.story.tsx +351 -0
  282. package/src/constants.ts +116 -1
  283. package/src/dataform-controls/boolean.tsx +30 -0
  284. package/src/dataform-controls/checkbox.tsx +31 -0
  285. package/src/dataform-controls/datetime.tsx +106 -2
  286. package/src/dataform-controls/email.tsx +42 -0
  287. package/src/dataform-controls/index.tsx +8 -0
  288. package/src/dataform-controls/integer.tsx +75 -1
  289. package/src/dataform-controls/select.tsx +1 -0
  290. package/src/dataform-controls/style.scss +5 -0
  291. package/src/dataform-controls/text.tsx +2 -1
  292. package/src/dataform-controls/toggle-group.tsx +59 -0
  293. package/src/dataforms-layouts/data-form-layout.tsx +1 -1
  294. package/src/dataforms-layouts/panel/index.tsx +19 -7
  295. package/src/dataforms-layouts/panel/style.scss +8 -1
  296. package/src/dataforms-layouts/regular/index.tsx +50 -17
  297. package/src/dataforms-layouts/regular/style.scss +4 -1
  298. package/src/dataviews-layouts/grid/index.tsx +47 -26
  299. package/src/dataviews-layouts/list/index.tsx +12 -5
  300. package/src/dataviews-layouts/table/column-header-menu.tsx +10 -8
  301. package/src/dataviews-layouts/table/column-primary.tsx +26 -13
  302. package/src/dataviews-layouts/table/index.tsx +74 -10
  303. package/src/dataviews-layouts/table/style.scss +37 -1
  304. package/src/dataviews-layouts/table/use-is-horizontal-scroll-end.ts +82 -0
  305. package/src/dataviews-layouts/utils/item-click-wrapper.tsx +93 -0
  306. package/src/field-types/array.tsx +75 -0
  307. package/src/field-types/boolean.tsx +66 -0
  308. package/src/field-types/datetime.tsx +46 -2
  309. package/src/field-types/email.tsx +79 -0
  310. package/src/field-types/index.tsx +45 -3
  311. package/src/field-types/integer.tsx +53 -2
  312. package/src/field-types/media.tsx +28 -0
  313. package/src/field-types/text.tsx +41 -2
  314. package/src/filter-and-sort-data-view.ts +243 -1
  315. package/src/normalize-fields.ts +116 -13
  316. package/src/test/dataviews.tsx +20 -2
  317. package/src/test/filter-and-sort-data-view.js +507 -0
  318. package/src/test/normalize-fields.ts +155 -0
  319. package/src/types.ts +106 -9
  320. package/src/utils.ts +10 -33
  321. package/tsconfig.json +2 -0
  322. package/tsconfig.tsbuildinfo +1 -1
  323. package/build/components/dataviews-filters/filter-summary.js.map +0 -1
  324. package/build/dataviews-layouts/utils/get-clickable-item-props.js +0 -36
  325. package/build/dataviews-layouts/utils/get-clickable-item-props.js.map +0 -1
  326. package/build-module/components/dataviews-filters/filter-summary.js +0 -218
  327. package/build-module/components/dataviews-filters/filter-summary.js.map +0 -1
  328. package/build-module/dataviews-layouts/utils/get-clickable-item-props.js +0 -30
  329. package/build-module/dataviews-layouts/utils/get-clickable-item-props.js.map +0 -1
  330. package/build-types/components/dataviews-filters/filter-summary.d.ts +0 -14
  331. package/build-types/components/dataviews-filters/filter-summary.d.ts.map +0 -1
  332. package/build-types/dataviews-layouts/utils/get-clickable-item-props.d.ts +0 -19
  333. package/build-types/dataviews-layouts/utils/get-clickable-item-props.d.ts.map +0 -1
  334. package/src/components/dataviews-filters/filter-summary.tsx +0 -338
  335. package/src/dataviews-layouts/utils/get-clickable-item-props.ts +0 -39
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["@wordpress/dataviews/src/types.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ReactElement, ComponentType } from 'react';\n\n/**\n * Internal dependencies\n */\nimport type { SetSelection } from './private-types';\n\n/**\n * WordPress dependencies\n */\nimport type { useFocusOnMount } from '@wordpress/compose';\n\nexport type SortDirection = 'asc' | 'desc';\n\n/**\n * Generic option type.\n */\nexport interface Option< Value extends any = any > {\n\tvalue: Value;\n\tlabel: string;\n\tdescription?: string;\n}\n\ninterface FilterByConfig {\n\t/**\n\t * The list of operators supported by the field.\n\t */\n\toperators?: Operator[];\n\n\t/**\n\t * Whether it is a primary filter.\n\t *\n\t * A primary filter is always visible and is not listed in the \"Add filter\" component,\n\t * except for the list layout where it behaves like a secondary filter.\n\t */\n\tisPrimary?: boolean;\n}\n\nexport type Operator =\n\t| 'is'\n\t| 'isNot'\n\t| 'isAny'\n\t| 'isNone'\n\t| 'isAll'\n\t| 'isNotAll';\n\nexport type FieldType = 'text' | 'integer' | 'datetime' | 'media';\n\nexport type ValidationContext = {\n\telements?: Option[];\n};\n\n/**\n * An abstract interface for Field based on the field type.\n */\nexport type FieldTypeDefinition< Item > = {\n\t/**\n\t * Callback used to sort the field.\n\t */\n\tsort: ( a: Item, b: Item, direction: SortDirection ) => number;\n\n\t/**\n\t * Callback used to validate the field.\n\t */\n\tisValid: ( item: Item, context?: ValidationContext ) => boolean;\n\n\t/**\n\t * Callback used to render an edit control for the field or control name.\n\t */\n\tEdit: ComponentType< DataFormControlProps< Item > > | string;\n};\n\n/**\n * A dataview field for a specific property of a data type.\n */\nexport type Field< Item > = {\n\t/**\n\t * Type of the fields.\n\t */\n\ttype?: FieldType;\n\n\t/**\n\t * The unique identifier of the field.\n\t */\n\tid: string;\n\n\t/**\n\t * The label of the field. Defaults to the id.\n\t */\n\tlabel?: string;\n\n\t/**\n\t * The header of the field. Defaults to the label.\n\t * It allows the usage of a React Element to render the field labels.\n\t */\n\theader?: string | ReactElement;\n\n\t/**\n\t * A description of the field.\n\t */\n\tdescription?: string;\n\n\t/**\n\t * Placeholder for the field.\n\t */\n\tplaceholder?: string;\n\n\t/**\n\t * Callback used to render the field. Defaults to `field.getValue`.\n\t */\n\trender?: ComponentType< DataViewRenderFieldProps< Item > >;\n\n\t/**\n\t * Callback used to render an edit control for the field.\n\t */\n\tEdit?: ComponentType< DataFormControlProps< Item > > | string;\n\n\t/**\n\t * Callback used to sort the field.\n\t */\n\tsort?: ( a: Item, b: Item, direction: SortDirection ) => number;\n\n\t/**\n\t * Callback used to validate the field.\n\t */\n\tisValid?: ( item: Item, context?: ValidationContext ) => boolean;\n\n\t/**\n\t * Callback used to decide if a field should be displayed.\n\t */\n\tisVisible?: ( item: Item ) => boolean;\n\n\t/**\n\t * Whether the field is sortable.\n\t */\n\tenableSorting?: boolean;\n\n\t/**\n\t * Whether the field is searchable.\n\t */\n\tenableGlobalSearch?: boolean;\n\n\t/**\n\t * Whether the field is filterable.\n\t */\n\tenableHiding?: boolean;\n\n\t/**\n\t * The list of options to pick from when using the field as a filter.\n\t */\n\telements?: Option[];\n\n\t/**\n\t * Filter config for the field.\n\t */\n\tfilterBy?: FilterByConfig | undefined;\n\n\t/**\n\t * Callback used to retrieve the value of the field from the item.\n\t * Defaults to `item[ field.id ]`.\n\t */\n\tgetValue?: ( args: { item: Item } ) => any;\n};\n\nexport type NormalizedField< Item > = Field< Item > & {\n\tlabel: string;\n\theader: string | ReactElement;\n\tgetValue: ( args: { item: Item } ) => any;\n\trender: ComponentType< DataViewRenderFieldProps< Item > >;\n\tEdit: ComponentType< DataFormControlProps< Item > >;\n\tsort: ( a: Item, b: Item, direction: SortDirection ) => number;\n\tisValid: ( item: Item, context?: ValidationContext ) => boolean;\n\tenableHiding: boolean;\n\tenableSorting: boolean;\n};\n\n/**\n * A collection of dataview fields for a data type.\n */\nexport type Fields< Item > = Field< Item >[];\n\nexport type Data< Item > = Item[];\n\nexport type DataFormControlProps< Item > = {\n\tdata: Item;\n\tfield: NormalizedField< Item >;\n\tonChange: ( value: Record< string, any > ) => void;\n\thideLabelFromVision?: boolean;\n};\n\nexport type DataViewRenderFieldProps< Item > = {\n\titem: Item;\n};\n\n/**\n * The filters applied to the dataset.\n */\nexport interface Filter {\n\t/**\n\t * The field to filter by.\n\t */\n\tfield: string;\n\n\t/**\n\t * The operator to use.\n\t */\n\toperator: Operator;\n\n\t/**\n\t * The value to filter by.\n\t */\n\tvalue: any;\n}\n\nexport interface NormalizedFilter {\n\t/**\n\t * The field to filter by.\n\t */\n\tfield: string;\n\n\t/**\n\t * The field name.\n\t */\n\tname: string;\n\n\t/**\n\t * The list of options to pick from when using the field as a filter.\n\t */\n\telements: Option[];\n\n\t/**\n\t * Is a single selection filter.\n\t */\n\tsingleSelection: boolean;\n\n\t/**\n\t * The list of operators supported by the field.\n\t */\n\toperators: Operator[];\n\n\t/**\n\t * Whether the filter is visible.\n\t */\n\tisVisible: boolean;\n\n\t/**\n\t * Whether it is a primary filter.\n\t */\n\tisPrimary: boolean;\n}\n\ninterface ViewBase {\n\t/**\n\t * The layout of the view.\n\t */\n\ttype: string;\n\n\t/**\n\t * The global search term.\n\t */\n\tsearch?: string;\n\n\t/**\n\t * The filters to apply.\n\t */\n\tfilters?: Filter[];\n\n\t/**\n\t * The sorting configuration.\n\t */\n\tsort?: {\n\t\t/**\n\t\t * The field to sort by.\n\t\t */\n\t\tfield: string;\n\n\t\t/**\n\t\t * The direction to sort by.\n\t\t */\n\t\tdirection: SortDirection;\n\t};\n\n\t/**\n\t * The active page\n\t */\n\tpage?: number;\n\n\t/**\n\t * The number of items per page\n\t */\n\tperPage?: number;\n\n\t/**\n\t * The fields to render\n\t */\n\tfields?: string[];\n\n\t/**\n\t * Title field\n\t */\n\ttitleField?: string;\n\n\t/**\n\t * Media field\n\t */\n\tmediaField?: string;\n\n\t/**\n\t * Description field\n\t */\n\tdescriptionField?: string;\n\n\t/**\n\t * Whether to show the title\n\t */\n\tshowTitle?: boolean;\n\n\t/**\n\t * Whether to show the media\n\t */\n\tshowMedia?: boolean;\n\n\t/**\n\t * Whether to show the description\n\t */\n\tshowDescription?: boolean;\n\n\t/**\n\t * Whether to show the hierarchical levels.\n\t */\n\tshowLevels?: boolean;\n}\n\nexport interface ColumnStyle {\n\t/**\n\t * The width of the field column.\n\t */\n\twidth?: string | number;\n\n\t/**\n\t * The minimum width of the field column.\n\t */\n\tmaxWidth?: string | number;\n\n\t/**\n\t * The maximum width of the field column.\n\t */\n\tminWidth?: string | number;\n}\n\nexport type Density = 'compact' | 'balanced' | 'comfortable';\n\nexport interface ViewTable extends ViewBase {\n\ttype: 'table';\n\n\tlayout?: {\n\t\t/**\n\t\t * The styles for the columns.\n\t\t */\n\t\tstyles?: Record< string, ColumnStyle >;\n\n\t\t/**\n\t\t * The density of the view.\n\t\t */\n\t\tdensity?: Density;\n\t};\n}\n\nexport interface ViewList extends ViewBase {\n\ttype: 'list';\n}\n\nexport interface ViewGrid extends ViewBase {\n\ttype: 'grid';\n\n\tlayout?: {\n\t\t/**\n\t\t * The fields to use as badge fields.\n\t\t */\n\t\tbadgeFields?: string[];\n\n\t\t/**\n\t\t * The preview size of the grid.\n\t\t */\n\t\tpreviewSize?: number;\n\t};\n}\n\nexport type View = ViewList | ViewGrid | ViewTable;\n\ninterface ActionBase< Item > {\n\t/**\n\t * The unique identifier of the action.\n\t */\n\tid: string;\n\n\t/**\n\t * The label of the action.\n\t * In case we want to adjust the label based on the selected items,\n\t * a function can be provided.\n\t */\n\tlabel: string | ( ( items: Item[] ) => string );\n\n\t/**\n\t * The icon of the action. (Either a string or an SVG element)\n\t * This should be IconType from the components package\n\t * but that import is breaking typescript build for the moment.\n\t */\n\ticon?: any;\n\n\t/**\n\t * Whether the action is disabled.\n\t */\n\tdisabled?: boolean;\n\n\t/**\n\t * Whether the action is destructive.\n\t */\n\tisDestructive?: boolean;\n\n\t/**\n\t * Whether the action is a primary action.\n\t */\n\tisPrimary?: boolean;\n\n\t/**\n\t * Whether the item passed as an argument supports the current action.\n\t */\n\tisEligible?: ( item: Item ) => boolean;\n\n\t/**\n\t * Whether the action can be used as a bulk action.\n\t */\n\tsupportsBulk?: boolean;\n\n\t/**\n\t * The context in which the action is visible.\n\t * This is only a \"meta\" information for now.\n\t */\n\tcontext?: 'list' | 'single';\n}\n\nexport interface RenderModalProps< Item > {\n\titems: Item[];\n\tcloseModal?: () => void;\n\tonActionPerformed?: ( items: Item[] ) => void;\n}\n\nexport interface ActionModal< Item > extends ActionBase< Item > {\n\t/**\n\t * Modal to render when the action is triggered.\n\t */\n\tRenderModal: ( {\n\t\titems,\n\t\tcloseModal,\n\t\tonActionPerformed,\n\t}: RenderModalProps< Item > ) => ReactElement;\n\n\t/**\n\t * Whether to hide the modal header.\n\t */\n\thideModalHeader?: boolean;\n\n\t/**\n\t * The header of the modal.\n\t */\n\tmodalHeader?: string;\n\n\t/**\n\t * The size of the modal.\n\t *\n\t * @default 'medium'\n\t */\n\tmodalSize?: 'small' | 'medium' | 'large' | 'fill';\n\n\t/**\n\t * The focus on mount property of the modal.\n\t */\n\tmodalFocusOnMount?:\n\t\t| Parameters< typeof useFocusOnMount >[ 0 ]\n\t\t| 'firstContentElement';\n}\n\nexport interface ActionButton< Item > extends ActionBase< Item > {\n\t/**\n\t * The callback to execute when the action is triggered.\n\t */\n\tcallback: (\n\t\titems: Item[],\n\t\tcontext: {\n\t\t\tregistry: any;\n\t\t\tonActionPerformed?: ( items: Item[] ) => void;\n\t\t}\n\t) => void;\n}\n\nexport type Action< Item > = ActionModal< Item > | ActionButton< Item >;\n\nexport interface ViewBaseProps< Item > {\n\tactions: Action< Item >[];\n\tdata: Item[];\n\tfields: NormalizedField< Item >[];\n\tgetItemId: ( item: Item ) => string;\n\tgetItemLevel?: ( item: Item ) => number;\n\tisLoading?: boolean;\n\tonChangeView: ( view: View ) => void;\n\tonChangeSelection: SetSelection;\n\tselection: string[];\n\tsetOpenedFilter: ( fieldId: string ) => void;\n\tonClickItem?: ( item: Item ) => void;\n\tisItemClickable: ( item: Item ) => boolean;\n\tview: View;\n}\n\nexport interface ViewTableProps< Item > extends ViewBaseProps< Item > {\n\tview: ViewTable;\n}\n\nexport interface ViewListProps< Item > extends ViewBaseProps< Item > {\n\tview: ViewList;\n}\n\nexport interface ViewGridProps< Item > extends ViewBaseProps< Item > {\n\tview: ViewGrid;\n}\n\nexport type ViewProps< Item > =\n\t| ViewTableProps< Item >\n\t| ViewGridProps< Item >\n\t| ViewListProps< Item >;\n\nexport interface SupportedLayouts {\n\tlist?: Omit< ViewList, 'type' >;\n\tgrid?: Omit< ViewGrid, 'type' >;\n\ttable?: Omit< ViewTable, 'type' >;\n}\n\nexport type SimpleFormField = {\n\tid: string;\n\tlayout?: 'regular' | 'panel';\n\tlabelPosition?: 'side' | 'top' | 'none';\n};\n\nexport type CombinedFormField = {\n\tid: string;\n\tlabel?: string;\n\tlayout?: 'regular' | 'panel';\n\tlabelPosition?: 'side' | 'top' | 'none';\n\tchildren: Array< FormField | string >;\n};\n\nexport type FormField = SimpleFormField | CombinedFormField;\n\n/**\n * The form configuration.\n */\nexport type Form = {\n\ttype?: 'regular' | 'panel';\n\tfields?: Array< FormField | string >;\n\tlabelPosition?: 'side' | 'top' | 'none';\n};\n\nexport interface DataFormProps< Item > {\n\tdata: Item;\n\tfields: Field< Item >[];\n\tform: Form;\n\tonChange: ( value: Record< string, any > ) => void;\n}\n\nexport interface FieldLayoutProps< Item > {\n\tdata: Item;\n\tfield: FormField;\n\tonChange: ( value: any ) => void;\n\thideLabelFromVision?: boolean;\n}\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["@wordpress/dataviews/src/types.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ReactElement, ComponentType, ComponentProps } from 'react';\n\n/**\n * Internal dependencies\n */\nimport type { SetSelection } from './private-types';\n\n/**\n * WordPress dependencies\n */\nimport type { useFocusOnMount } from '@wordpress/compose';\n\nexport type SortDirection = 'asc' | 'desc';\n\n/**\n * Generic option type.\n */\nexport interface Option< Value extends any = any > {\n\tvalue: Value;\n\tlabel: string;\n\tdescription?: string;\n}\n\nexport interface FilterByConfig {\n\t/**\n\t * The list of operators supported by the field.\n\t */\n\toperators?: Operator[];\n\n\t/**\n\t * Whether it is a primary filter.\n\t *\n\t * A primary filter is always visible and is not listed in the \"Add filter\" component,\n\t * except for the list layout where it behaves like a secondary filter.\n\t */\n\tisPrimary?: boolean;\n}\n\nexport interface NormalizedFilterByConfig {\n\t/**\n\t * The list of operators supported by the field.\n\t */\n\toperators: Operator[];\n\n\t/**\n\t * Whether it is a primary filter.\n\t *\n\t * A primary filter is always visible and is not listed in the \"Add filter\" component,\n\t * except for the list layout where it behaves like a secondary filter.\n\t */\n\tisPrimary?: boolean;\n}\n\ninterface FilterConfigForType {\n\t/**\n\t * What operators are used by default.\n\t */\n\tdefaultOperators: Operator[];\n\n\t/**\n\t * What operators are supported by the field.\n\t */\n\tvalidOperators: Operator[];\n}\n\nexport type Operator =\n\t| 'is'\n\t| 'isNot'\n\t| 'isAny'\n\t| 'isNone'\n\t| 'isAll'\n\t| 'isNotAll'\n\t| 'lessThan'\n\t| 'greaterThan'\n\t| 'lessThanOrEqual'\n\t| 'greaterThanOrEqual'\n\t| 'before'\n\t| 'after'\n\t| 'beforeInc'\n\t| 'afterInc'\n\t| 'contains'\n\t| 'notContains'\n\t| 'startsWith'\n\t| 'between'\n\t| 'on'\n\t| 'notOn'\n\t| 'inThePast'\n\t| 'over';\n\nexport type FieldType =\n\t| 'text'\n\t| 'integer'\n\t| 'datetime'\n\t| 'media'\n\t| 'boolean'\n\t| 'email'\n\t| 'array';\n\nexport type ValidationContext = {\n\telements?: Option[];\n};\n\n/**\n * An abstract interface for Field based on the field type.\n */\nexport type FieldTypeDefinition< Item > = {\n\t/**\n\t * Callback used to sort the field.\n\t */\n\tsort: ( a: Item, b: Item, direction: SortDirection ) => number;\n\n\t/**\n\t * Callback used to validate the field.\n\t */\n\tisValid: ( item: Item, context?: ValidationContext ) => boolean;\n\n\t/**\n\t * Callback used to render an edit control for the field or control name.\n\t */\n\tEdit: ComponentType< DataFormControlProps< Item > > | string | null;\n\n\t/**\n\t * Callback used to render the field.\n\t */\n\trender: ComponentType< DataViewRenderFieldProps< Item > >;\n\n\t/**\n\t * The filter config for the field.\n\t */\n\tfilterBy: FilterConfigForType | false;\n\n\t/**\n\t * Whether the field is readOnly.\n\t * If `true`, the value will be rendered using the `render` callback.\n\t */\n\treadOnly?: boolean;\n\n\t/**\n\t * Whether the field is sortable.\n\t */\n\tenableSorting: boolean;\n};\n\n/**\n * A dataview field for a specific property of a data type.\n */\nexport type Field< Item > = {\n\t/**\n\t * Type of the fields.\n\t */\n\ttype?: FieldType;\n\n\t/**\n\t * The unique identifier of the field.\n\t */\n\tid: string;\n\n\t/**\n\t * The label of the field. Defaults to the id.\n\t */\n\tlabel?: string;\n\n\t/**\n\t * The header of the field. Defaults to the label.\n\t * It allows the usage of a React Element to render the field labels.\n\t */\n\theader?: string | ReactElement;\n\n\t/**\n\t * A description of the field.\n\t */\n\tdescription?: string;\n\n\t/**\n\t * Placeholder for the field.\n\t */\n\tplaceholder?: string;\n\n\t/**\n\t * Callback used to render the field. Defaults to `field.getValue`.\n\t */\n\trender?: ComponentType< DataViewRenderFieldProps< Item > >;\n\n\t/**\n\t * Callback used to render an edit control for the field.\n\t */\n\tEdit?: ComponentType< DataFormControlProps< Item > > | string;\n\n\t/**\n\t * Callback used to sort the field.\n\t */\n\tsort?: ( a: Item, b: Item, direction: SortDirection ) => number;\n\n\t/**\n\t * Callback used to validate the field.\n\t */\n\tisValid?: ( item: Item, context?: ValidationContext ) => boolean;\n\n\t/**\n\t * Callback used to decide if a field should be displayed.\n\t */\n\tisVisible?: ( item: Item ) => boolean;\n\n\t/**\n\t * Whether the field is sortable.\n\t */\n\tenableSorting?: boolean;\n\n\t/**\n\t * Whether the field is searchable.\n\t */\n\tenableGlobalSearch?: boolean;\n\n\t/**\n\t * Whether the field is filterable.\n\t */\n\tenableHiding?: boolean;\n\n\t/**\n\t * The list of options to pick from when using the field as a filter.\n\t */\n\telements?: Option[];\n\n\t/**\n\t * Filter config for the field.\n\t */\n\tfilterBy?: FilterByConfig | false;\n\n\t/**\n\t * Whether the field is readOnly.\n\t * If `true`, the value will be rendered using the `render` callback.\n\t */\n\treadOnly?: boolean;\n\n\t/**\n\t * Callback used to retrieve the value of the field from the item.\n\t * Defaults to `item[ field.id ]`.\n\t */\n\tgetValue?: ( args: { item: Item } ) => any;\n};\n\nexport type NormalizedField< Item > = Omit< Field< Item >, 'Edit' > & {\n\tlabel: string;\n\theader: string | ReactElement;\n\tgetValue: ( args: { item: Item } ) => any;\n\trender: ComponentType< DataViewRenderFieldProps< Item > >;\n\tEdit: ComponentType< DataFormControlProps< Item > > | null;\n\tsort: ( a: Item, b: Item, direction: SortDirection ) => number;\n\tisValid: ( item: Item, context?: ValidationContext ) => boolean;\n\tenableHiding: boolean;\n\tenableSorting: boolean;\n\tfilterBy: NormalizedFilterByConfig | false;\n\treadOnly: boolean;\n};\n\n/**\n * A collection of dataview fields for a data type.\n */\nexport type Fields< Item > = Field< Item >[];\n\nexport type Data< Item > = Item[];\n\nexport type DataFormControlProps< Item > = {\n\tdata: Item;\n\tfield: NormalizedField< Item >;\n\tonChange: ( value: Record< string, any > ) => void;\n\thideLabelFromVision?: boolean;\n\t/**\n\t * The currently selected filter operator for this field.\n\t *\n\t * Used by DataViews filters to determine which control to render based on the operator type.\n\t */\n\toperator?: Operator;\n};\n\nexport type DataViewRenderFieldProps< Item > = {\n\titem: Item;\n\tfield: NormalizedField< Item >;\n};\n\n/**\n * The filters applied to the dataset.\n */\nexport interface Filter {\n\t/**\n\t * The field to filter by.\n\t */\n\tfield: string;\n\n\t/**\n\t * The operator to use.\n\t */\n\toperator: Operator;\n\n\t/**\n\t * The value to filter by.\n\t */\n\tvalue: any;\n}\n\nexport interface NormalizedFilter {\n\t/**\n\t * The field to filter by.\n\t */\n\tfield: string;\n\n\t/**\n\t * The field name.\n\t */\n\tname: string;\n\n\t/**\n\t * The list of options to pick from when using the field as a filter.\n\t */\n\telements: Option[];\n\n\t/**\n\t * Is a single selection filter.\n\t */\n\tsingleSelection: boolean;\n\n\t/**\n\t * The list of operators supported by the field.\n\t */\n\toperators: Operator[];\n\n\t/**\n\t * Whether the filter is visible.\n\t */\n\tisVisible: boolean;\n\n\t/**\n\t * Whether it is a primary filter.\n\t */\n\tisPrimary: boolean;\n}\n\ninterface ViewBase {\n\t/**\n\t * The layout of the view.\n\t */\n\ttype: string;\n\n\t/**\n\t * The global search term.\n\t */\n\tsearch?: string;\n\n\t/**\n\t * The filters to apply.\n\t */\n\tfilters?: Filter[];\n\n\t/**\n\t * The sorting configuration.\n\t */\n\tsort?: {\n\t\t/**\n\t\t * The field to sort by.\n\t\t */\n\t\tfield: string;\n\n\t\t/**\n\t\t * The direction to sort by.\n\t\t */\n\t\tdirection: SortDirection;\n\t};\n\n\t/**\n\t * The active page\n\t */\n\tpage?: number;\n\n\t/**\n\t * The number of items per page\n\t */\n\tperPage?: number;\n\n\t/**\n\t * The fields to render\n\t */\n\tfields?: string[];\n\n\t/**\n\t * Title field\n\t */\n\ttitleField?: string;\n\n\t/**\n\t * Media field\n\t */\n\tmediaField?: string;\n\n\t/**\n\t * Description field\n\t */\n\tdescriptionField?: string;\n\n\t/**\n\t * Whether to show the title\n\t */\n\tshowTitle?: boolean;\n\n\t/**\n\t * Whether to show the media\n\t */\n\tshowMedia?: boolean;\n\n\t/**\n\t * Whether to show the description\n\t */\n\tshowDescription?: boolean;\n\n\t/**\n\t * Whether to show the hierarchical levels.\n\t */\n\tshowLevels?: boolean;\n}\n\nexport interface ColumnStyle {\n\t/**\n\t * The width of the field column.\n\t */\n\twidth?: string | number;\n\n\t/**\n\t * The minimum width of the field column.\n\t */\n\tmaxWidth?: string | number;\n\n\t/**\n\t * The maximum width of the field column.\n\t */\n\tminWidth?: string | number;\n\n\t/**\n\t * The alignment of the field column, defaults to left.\n\t */\n\talign?: 'start' | 'center' | 'end';\n}\n\nexport type Density = 'compact' | 'balanced' | 'comfortable';\n\nexport interface ViewTable extends ViewBase {\n\ttype: 'table';\n\n\tlayout?: {\n\t\t/**\n\t\t * The styles for the columns.\n\t\t */\n\t\tstyles?: Record< string, ColumnStyle >;\n\n\t\t/**\n\t\t * The density of the view.\n\t\t */\n\t\tdensity?: Density;\n\t};\n}\n\nexport interface ViewList extends ViewBase {\n\ttype: 'list';\n}\n\nexport interface ViewGrid extends ViewBase {\n\ttype: 'grid';\n\n\tlayout?: {\n\t\t/**\n\t\t * The fields to use as badge fields.\n\t\t */\n\t\tbadgeFields?: string[];\n\n\t\t/**\n\t\t * The preview size of the grid.\n\t\t */\n\t\tpreviewSize?: number;\n\t};\n}\n\nexport type View = ViewList | ViewGrid | ViewTable;\n\ninterface ActionBase< Item > {\n\t/**\n\t * The unique identifier of the action.\n\t */\n\tid: string;\n\n\t/**\n\t * The label of the action.\n\t * In case we want to adjust the label based on the selected items,\n\t * a function can be provided.\n\t */\n\tlabel: string | ( ( items: Item[] ) => string );\n\n\t/**\n\t * The icon of the action. (Either a string or an SVG element)\n\t * This should be IconType from the components package\n\t * but that import is breaking typescript build for the moment.\n\t */\n\ticon?: any;\n\n\t/**\n\t * Whether the action is disabled.\n\t */\n\tdisabled?: boolean;\n\n\t/**\n\t * Whether the action is destructive.\n\t */\n\tisDestructive?: boolean;\n\n\t/**\n\t * Whether the action is a primary action.\n\t */\n\tisPrimary?: boolean;\n\n\t/**\n\t * Whether the item passed as an argument supports the current action.\n\t */\n\tisEligible?: ( item: Item ) => boolean;\n\n\t/**\n\t * Whether the action can be used as a bulk action.\n\t */\n\tsupportsBulk?: boolean;\n\n\t/**\n\t * The context in which the action is visible.\n\t * This is only a \"meta\" information for now.\n\t */\n\tcontext?: 'list' | 'single';\n}\n\nexport interface RenderModalProps< Item > {\n\titems: Item[];\n\tcloseModal?: () => void;\n\tonActionPerformed?: ( items: Item[] ) => void;\n}\n\nexport interface ActionModal< Item > extends ActionBase< Item > {\n\t/**\n\t * Modal to render when the action is triggered.\n\t */\n\tRenderModal: ( {\n\t\titems,\n\t\tcloseModal,\n\t\tonActionPerformed,\n\t}: RenderModalProps< Item > ) => ReactElement;\n\n\t/**\n\t * Whether to hide the modal header.\n\t */\n\thideModalHeader?: boolean;\n\n\t/**\n\t * The header of the modal.\n\t */\n\tmodalHeader?: string;\n\n\t/**\n\t * The size of the modal.\n\t *\n\t * @default 'medium'\n\t */\n\tmodalSize?: 'small' | 'medium' | 'large' | 'fill';\n\n\t/**\n\t * The focus on mount property of the modal.\n\t */\n\tmodalFocusOnMount?:\n\t\t| Parameters< typeof useFocusOnMount >[ 0 ]\n\t\t| 'firstContentElement';\n}\n\nexport interface ActionButton< Item > extends ActionBase< Item > {\n\t/**\n\t * The callback to execute when the action is triggered.\n\t */\n\tcallback: (\n\t\titems: Item[],\n\t\tcontext: {\n\t\t\tregistry: any;\n\t\t\tonActionPerformed?: ( items: Item[] ) => void;\n\t\t}\n\t) => void;\n}\n\nexport type Action< Item > = ActionModal< Item > | ActionButton< Item >;\n\nexport interface ViewBaseProps< Item > {\n\tclassName?: string;\n\tactions: Action< Item >[];\n\tdata: Item[];\n\tfields: NormalizedField< Item >[];\n\tgetItemId: ( item: Item ) => string;\n\tgetItemLevel?: ( item: Item ) => number;\n\tisLoading?: boolean;\n\tonChangeView: ( view: View ) => void;\n\tonChangeSelection: SetSelection;\n\tselection: string[];\n\tsetOpenedFilter: ( fieldId: string ) => void;\n\tonClickItem?: ( item: Item ) => void;\n\trenderItemLink?: (\n\t\tprops: {\n\t\t\titem: Item;\n\t\t} & ComponentProps< 'a' >\n\t) => ReactElement;\n\tisItemClickable: ( item: Item ) => boolean;\n\tview: View;\n}\n\nexport interface ViewTableProps< Item > extends ViewBaseProps< Item > {\n\tview: ViewTable;\n}\n\nexport interface ViewListProps< Item > extends ViewBaseProps< Item > {\n\tview: ViewList;\n}\n\nexport interface ViewGridProps< Item > extends ViewBaseProps< Item > {\n\tview: ViewGrid;\n}\n\nexport type ViewProps< Item > =\n\t| ViewTableProps< Item >\n\t| ViewGridProps< Item >\n\t| ViewListProps< Item >;\n\nexport interface SupportedLayouts {\n\tlist?: Omit< ViewList, 'type' >;\n\tgrid?: Omit< ViewGrid, 'type' >;\n\ttable?: Omit< ViewTable, 'type' >;\n}\n\nexport type SimpleFormField = {\n\tid: string;\n\tlayout?: 'regular' | 'panel';\n\tlabelPosition?: 'side' | 'top' | 'none';\n};\n\nexport type CombinedFormField = {\n\tid: string;\n\tlabel?: string;\n\tlayout?: 'regular' | 'panel';\n\tlabelPosition?: 'side' | 'top' | 'none';\n\tchildren: Array< FormField | string >;\n};\n\nexport type FormField = SimpleFormField | CombinedFormField;\n\n/**\n * The form configuration.\n */\nexport type Form = {\n\ttype?: 'regular' | 'panel';\n\tfields?: Array< FormField | string >;\n\tlabelPosition?: 'side' | 'top' | 'none';\n};\n\nexport interface DataFormProps< Item > {\n\tdata: Item;\n\tfields: Field< Item >[];\n\tform: Form;\n\tonChange: ( value: Record< string, any > ) => void;\n}\n\nexport interface FieldLayoutProps< Item > {\n\tdata: Item;\n\tfield: FormField;\n\tonChange: ( value: any ) => void;\n\thideLabelFromVision?: boolean;\n}\n"],"mappings":"","ignoreList":[]}
@@ -1,23 +1,16 @@
1
1
  /**
2
2
  * Internal dependencies
3
3
  */
4
- import { ALL_OPERATORS, OPERATOR_IS, OPERATOR_IS_NOT, OPERATOR_IS_ANY, OPERATOR_IS_NONE } from './constants';
5
- export function sanitizeOperators(field) {
6
- let operators = field.filterBy?.operators;
7
4
 
8
- // Assign default values.
9
- if (!operators || !Array.isArray(operators)) {
10
- operators = [OPERATOR_IS_ANY, OPERATOR_IS_NONE];
11
- }
12
-
13
- // Make sure only valid operators are used.
14
- operators = operators.filter(operator => ALL_OPERATORS.includes(operator));
15
-
16
- // Do not allow mixing single & multiselection operators.
17
- // Remove multiselection operators if any of the single selection ones is present.
18
- if (operators.includes(OPERATOR_IS) || operators.includes(OPERATOR_IS_NOT)) {
19
- operators = operators.filter(operator => [OPERATOR_IS, OPERATOR_IS_NOT].includes(operator));
20
- }
21
- return operators;
5
+ export function renderFromElements({
6
+ item,
7
+ field
8
+ }) {
9
+ const value = field.getValue({
10
+ item
11
+ });
12
+ return field?.elements?.find(element => element.value === value)?.label || field.getValue({
13
+ item
14
+ });
22
15
  }
23
16
  //# sourceMappingURL=utils.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["ALL_OPERATORS","OPERATOR_IS","OPERATOR_IS_NOT","OPERATOR_IS_ANY","OPERATOR_IS_NONE","sanitizeOperators","field","operators","filterBy","Array","isArray","filter","operator","includes"],"sources":["@wordpress/dataviews/src/utils.ts"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport {\n\tALL_OPERATORS,\n\tOPERATOR_IS,\n\tOPERATOR_IS_NOT,\n\tOPERATOR_IS_ANY,\n\tOPERATOR_IS_NONE,\n} from './constants';\nimport type { NormalizedField } from './types';\n\nexport function sanitizeOperators< Item >( field: NormalizedField< Item > ) {\n\tlet operators = field.filterBy?.operators;\n\n\t// Assign default values.\n\tif ( ! operators || ! Array.isArray( operators ) ) {\n\t\toperators = [ OPERATOR_IS_ANY, OPERATOR_IS_NONE ];\n\t}\n\n\t// Make sure only valid operators are used.\n\toperators = operators.filter( ( operator ) =>\n\t\tALL_OPERATORS.includes( operator )\n\t);\n\n\t// Do not allow mixing single & multiselection operators.\n\t// Remove multiselection operators if any of the single selection ones is present.\n\tif (\n\t\toperators.includes( OPERATOR_IS ) ||\n\t\toperators.includes( OPERATOR_IS_NOT )\n\t) {\n\t\toperators = operators.filter( ( operator ) =>\n\t\t\t[ OPERATOR_IS, OPERATOR_IS_NOT ].includes( operator )\n\t\t);\n\t}\n\n\treturn operators;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SACCA,aAAa,EACbC,WAAW,EACXC,eAAe,EACfC,eAAe,EACfC,gBAAgB,QACV,aAAa;AAGpB,OAAO,SAASC,iBAAiBA,CAAUC,KAA8B,EAAG;EAC3E,IAAIC,SAAS,GAAGD,KAAK,CAACE,QAAQ,EAAED,SAAS;;EAEzC;EACA,IAAK,CAAEA,SAAS,IAAI,CAAEE,KAAK,CAACC,OAAO,CAAEH,SAAU,CAAC,EAAG;IAClDA,SAAS,GAAG,CAAEJ,eAAe,EAAEC,gBAAgB,CAAE;EAClD;;EAEA;EACAG,SAAS,GAAGA,SAAS,CAACI,MAAM,CAAIC,QAAQ,IACvCZ,aAAa,CAACa,QAAQ,CAAED,QAAS,CAClC,CAAC;;EAED;EACA;EACA,IACCL,SAAS,CAACM,QAAQ,CAAEZ,WAAY,CAAC,IACjCM,SAAS,CAACM,QAAQ,CAAEX,eAAgB,CAAC,EACpC;IACDK,SAAS,GAAGA,SAAS,CAACI,MAAM,CAAIC,QAAQ,IACvC,CAAEX,WAAW,EAAEC,eAAe,CAAE,CAACW,QAAQ,CAAED,QAAS,CACrD,CAAC;EACF;EAEA,OAAOL,SAAS;AACjB","ignoreList":[]}
1
+ {"version":3,"names":["renderFromElements","item","field","value","getValue","elements","find","element","label"],"sources":["@wordpress/dataviews/src/utils.ts"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport type { DataViewRenderFieldProps } from './types';\n\nexport function renderFromElements< Item >( {\n\titem,\n\tfield,\n}: DataViewRenderFieldProps< Item > ) {\n\tconst value = field.getValue( { item } );\n\treturn (\n\t\tfield?.elements?.find( ( element ) => element.value === value )\n\t\t\t?.label || field.getValue( { item } )\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;;AAGA,OAAO,SAASA,kBAAkBA,CAAU;EAC3CC,IAAI;EACJC;AACiC,CAAC,EAAG;EACrC,MAAMC,KAAK,GAAGD,KAAK,CAACE,QAAQ,CAAE;IAAEH;EAAK,CAAE,CAAC;EACxC,OACCC,KAAK,EAAEG,QAAQ,EAAEC,IAAI,CAAIC,OAAO,IAAMA,OAAO,CAACJ,KAAK,KAAKA,KAAM,CAAC,EAC5DK,KAAK,IAAIN,KAAK,CAACE,QAAQ,CAAE;IAAEH;EAAK,CAAE,CAAC;AAExC","ignoreList":[]}
@@ -343,6 +343,30 @@
343
343
  border-radius: 2px;
344
344
  }
345
345
 
346
+ /**
347
+ * Applying a consistent 24px padding when DataViews are placed within cards.
348
+ */
349
+ .components-card__body:has(> .dataviews-wrapper) {
350
+ padding: 8px 0 0;
351
+ overflow: hidden;
352
+ }
353
+ .components-card__body:has(> .dataviews-wrapper) .dataviews__view-actions,
354
+ .components-card__body:has(> .dataviews-wrapper) .dataviews-filters__container,
355
+ .components-card__body:has(> .dataviews-wrapper) .dataviews-footer,
356
+ .components-card__body:has(> .dataviews-wrapper) .dataviews-view-grid,
357
+ .components-card__body:has(> .dataviews-wrapper) .dataviews-loading,
358
+ .components-card__body:has(> .dataviews-wrapper) .dataviews-no-results {
359
+ padding-inline: 24px;
360
+ }
361
+ .components-card__body:has(> .dataviews-wrapper) .dataviews-view-table tr td:first-child,
362
+ .components-card__body:has(> .dataviews-wrapper) .dataviews-view-table tr th:first-child {
363
+ padding-inline-start: 24px;
364
+ }
365
+ .components-card__body:has(> .dataviews-wrapper) .dataviews-view-table tr td:last-child,
366
+ .components-card__body:has(> .dataviews-wrapper) .dataviews-view-table tr th:last-child {
367
+ padding-inline-end: 24px;
368
+ }
369
+
346
370
  .dataviews-bulk-actions-footer__item-count {
347
371
  color: #1e1e1e;
348
372
  font-weight: 500;
@@ -383,17 +407,26 @@
383
407
  }
384
408
 
385
409
  .dataviews-filters__summary-operators-container {
386
- padding: 8px 8px 0;
410
+ padding: 8px 16px;
387
411
  }
388
- .dataviews-filters__summary-operators-container:has(+ .dataviews-filters__search-widget-listbox) {
412
+ .dataviews-filters__summary-operators-container:has(+ .dataviews-filters__search-widget-listbox), .dataviews-filters__summary-operators-container:has(+ .dataviews-filters__user-input-widget) {
389
413
  border-bottom: 1px solid #e0e0e0;
390
- padding-bottom: 8px;
391
414
  }
392
415
  .dataviews-filters__summary-operators-container:empty {
393
416
  display: none;
394
417
  }
395
418
  .dataviews-filters__summary-operators-container .dataviews-filters__summary-operators-filter-name {
396
419
  color: #757575;
420
+ white-space: nowrap;
421
+ overflow: hidden;
422
+ text-overflow: ellipsis;
423
+ flex-shrink: 0; /* Prevents this element from shrinking */
424
+ max-width: calc(100% - 55px);
425
+ }
426
+ .dataviews-filters__summary-operators-container .dataviews-filters__summary-operators-filter-select {
427
+ width: 100%;
428
+ white-space: nowrap;
429
+ overflow: hidden;
397
430
  }
398
431
 
399
432
  .dataviews-filters__summary-chip-container {
@@ -491,9 +524,13 @@
491
524
  gap: 8px;
492
525
  border-radius: 2px;
493
526
  box-sizing: border-box;
494
- padding: 8px 12px;
527
+ padding: 4px 12px;
495
528
  cursor: default;
496
- margin-block-end: 2px;
529
+ min-height: 32px;
530
+ font-family: -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
531
+ font-weight: 400;
532
+ font-size: 13px;
533
+ line-height: 20px;
497
534
  }
498
535
  .dataviews-filters__search-widget-listitem:last-child {
499
536
  margin-block-end: 0;
@@ -502,16 +539,23 @@
502
539
  background-color: var(--wp-admin-theme-color);
503
540
  color: #fff;
504
541
  }
505
- .dataviews-filters__search-widget-listitem:hover .dataviews-filters__search-widget-listitem-check, .dataviews-filters__search-widget-listitem[data-active-item] .dataviews-filters__search-widget-listitem-check, .dataviews-filters__search-widget-listitem:focus .dataviews-filters__search-widget-listitem-check {
506
- fill: #fff;
507
- }
508
542
  .dataviews-filters__search-widget-listitem:hover .dataviews-filters__search-widget-listitem-description, .dataviews-filters__search-widget-listitem[data-active-item] .dataviews-filters__search-widget-listitem-description, .dataviews-filters__search-widget-listitem:focus .dataviews-filters__search-widget-listitem-description {
509
543
  color: #fff;
510
544
  }
511
- .dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-check {
512
- width: 24px;
513
- height: 24px;
514
- flex-shrink: 0;
545
+ .dataviews-filters__search-widget-listitem:hover .dataviews-filters__search-widget-listitem-single-selection, .dataviews-filters__search-widget-listitem[data-active-item] .dataviews-filters__search-widget-listitem-single-selection, .dataviews-filters__search-widget-listitem:focus .dataviews-filters__search-widget-listitem-single-selection {
546
+ border-color: var(--wp-admin-theme-color-darker-20, #183ad6);
547
+ background: #fff;
548
+ }
549
+ .dataviews-filters__search-widget-listitem:hover .dataviews-filters__search-widget-listitem-single-selection.is-selected, .dataviews-filters__search-widget-listitem[data-active-item] .dataviews-filters__search-widget-listitem-single-selection.is-selected, .dataviews-filters__search-widget-listitem:focus .dataviews-filters__search-widget-listitem-single-selection.is-selected {
550
+ border-color: var(--wp-admin-theme-color-darker-20, #183ad6);
551
+ background: var(--wp-admin-theme-color-darker-20, #183ad6);
552
+ }
553
+ .dataviews-filters__search-widget-listitem:hover .dataviews-filters__search-widget-listitem-multi-selection, .dataviews-filters__search-widget-listitem[data-active-item] .dataviews-filters__search-widget-listitem-multi-selection, .dataviews-filters__search-widget-listitem:focus .dataviews-filters__search-widget-listitem-multi-selection {
554
+ border-color: var(--wp-admin-theme-color-darker-20, #183ad6);
555
+ }
556
+ .dataviews-filters__search-widget-listitem:hover .dataviews-filters__search-widget-listitem-multi-selection.is-selected, .dataviews-filters__search-widget-listitem[data-active-item] .dataviews-filters__search-widget-listitem-multi-selection.is-selected, .dataviews-filters__search-widget-listitem:focus .dataviews-filters__search-widget-listitem-multi-selection.is-selected {
557
+ border-color: var(--wp-admin-theme-color-darker-20, #183ad6);
558
+ background: var(--wp-admin-theme-color-darker-20, #183ad6);
515
559
  }
516
560
  .dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-description {
517
561
  display: block;
@@ -521,6 +565,208 @@
521
565
  line-height: 16px;
522
566
  color: #757575;
523
567
  }
568
+ .dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-single-selection {
569
+ border: 1px solid #1e1e1e;
570
+ margin-left: 12px;
571
+ transition: none;
572
+ border-radius: 50%;
573
+ width: 24px;
574
+ height: 24px;
575
+ min-width: 24px;
576
+ max-width: 24px;
577
+ position: relative;
578
+ margin: 0;
579
+ padding: 0;
580
+ }
581
+ @media not (prefers-reduced-motion) {
582
+ .dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-single-selection {
583
+ transition: box-shadow 0.1s linear;
584
+ }
585
+ }
586
+ @media (min-width: 600px) {
587
+ .dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-single-selection {
588
+ height: 16px;
589
+ width: 16px;
590
+ min-width: 16px;
591
+ max-width: 16px;
592
+ }
593
+ }
594
+ .dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-single-selection:checked::before {
595
+ box-sizing: inherit;
596
+ width: 12px;
597
+ height: 12px;
598
+ position: absolute;
599
+ top: 50%;
600
+ right: 50%;
601
+ transform: translate(50%, -50%);
602
+ margin: 0;
603
+ background-color: #fff;
604
+ border: 4px solid #fff;
605
+ }
606
+ @media (min-width: 600px) {
607
+ .dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-single-selection:checked::before {
608
+ width: 8px;
609
+ height: 8px;
610
+ }
611
+ }
612
+ .dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-single-selection:focus {
613
+ box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--wp-admin-theme-color);
614
+ outline: 2px solid transparent;
615
+ }
616
+ .dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-single-selection:checked {
617
+ background: var(--wp-admin-theme-color);
618
+ border: none;
619
+ }
620
+ .dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-single-selection.is-selected {
621
+ background: var(--wp-admin-theme-color, #3858e9);
622
+ border-color: var(--wp-admin-theme-color, #3858e9);
623
+ }
624
+ .dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-single-selection.is-selected::before {
625
+ content: "";
626
+ border-radius: 50%;
627
+ box-sizing: inherit;
628
+ width: 12px;
629
+ height: 12px;
630
+ position: absolute;
631
+ top: 50%;
632
+ right: 50%;
633
+ transform: translate(50%, -50%);
634
+ margin: 0;
635
+ background-color: #fff;
636
+ border: 4px solid #fff;
637
+ }
638
+ @media (min-width: 600px) {
639
+ .dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-single-selection.is-selected::before {
640
+ width: 8px;
641
+ height: 8px;
642
+ }
643
+ }
644
+ .dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection {
645
+ --checkbox-size: 24px;
646
+ border: 1px solid #1e1e1e;
647
+ margin-left: 12px;
648
+ transition: none;
649
+ border-radius: 2px;
650
+ font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
651
+ padding: 6px 8px;
652
+ /* Fonts smaller than 16px causes mobile safari to zoom. */
653
+ font-size: 16px;
654
+ /* Override core line-height. To be reviewed. */
655
+ line-height: normal;
656
+ box-shadow: 0 0 0 transparent;
657
+ border-radius: 2px;
658
+ border: 1px solid #949494;
659
+ position: relative;
660
+ background: #fff;
661
+ color: #1e1e1e;
662
+ margin: 0;
663
+ padding: 0;
664
+ width: var(--checkbox-size);
665
+ height: var(--checkbox-size);
666
+ }
667
+ @media not (prefers-reduced-motion) {
668
+ .dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection {
669
+ transition: box-shadow 0.1s linear;
670
+ }
671
+ }
672
+ @media (min-width: 600px) {
673
+ .dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection {
674
+ font-size: 13px;
675
+ /* Override core line-height. To be reviewed. */
676
+ line-height: normal;
677
+ }
678
+ }
679
+ .dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection:focus {
680
+ border-color: var(--wp-admin-theme-color);
681
+ box-shadow: 0 0 0 0.5px var(--wp-admin-theme-color);
682
+ outline: 2px solid transparent;
683
+ }
684
+ .dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection::-webkit-input-placeholder {
685
+ color: rgba(30, 30, 30, 0.62);
686
+ }
687
+ .dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection::-moz-placeholder {
688
+ color: rgba(30, 30, 30, 0.62);
689
+ }
690
+ .dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection:-ms-input-placeholder {
691
+ color: rgba(30, 30, 30, 0.62);
692
+ }
693
+ .dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection:focus {
694
+ box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--wp-admin-theme-color);
695
+ outline: 2px solid transparent;
696
+ }
697
+ .dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection:checked {
698
+ background: var(--wp-admin-theme-color);
699
+ border-color: var(--wp-admin-theme-color);
700
+ }
701
+ .dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection:checked::-ms-check {
702
+ opacity: 0;
703
+ }
704
+ .dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection:checked::before, .dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection[aria-checked=mixed]::before {
705
+ margin: -3px -5px;
706
+ color: #fff;
707
+ }
708
+ @media (min-width: 782px) {
709
+ .dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection:checked::before, .dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection[aria-checked=mixed]::before {
710
+ margin: -4px -5px 0 0;
711
+ }
712
+ }
713
+ .dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection[aria-checked=mixed] {
714
+ background: var(--wp-admin-theme-color);
715
+ border-color: var(--wp-admin-theme-color);
716
+ }
717
+ .dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection[aria-checked=mixed]::before {
718
+ content: "\f460";
719
+ float: right;
720
+ display: inline-block;
721
+ vertical-align: middle;
722
+ width: 16px;
723
+ /* stylelint-disable-next-line font-family-no-missing-generic-family-keyword -- dashicons don't need a generic family keyword. */
724
+ font: normal 30px/1 dashicons;
725
+ speak: none;
726
+ -webkit-font-smoothing: antialiased;
727
+ -moz-osx-font-smoothing: grayscale;
728
+ }
729
+ @media (min-width: 782px) {
730
+ .dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection[aria-checked=mixed]::before {
731
+ float: none;
732
+ font-size: 21px;
733
+ }
734
+ }
735
+ .dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection[aria-disabled=true], .dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection:disabled {
736
+ background: #f0f0f0;
737
+ border-color: #ddd;
738
+ cursor: default;
739
+ opacity: 1;
740
+ }
741
+ @media (min-width: 600px) {
742
+ .dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection {
743
+ --checkbox-size: 16px;
744
+ }
745
+ }
746
+ @media not (prefers-reduced-motion) {
747
+ .dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection {
748
+ transition: 0.1s border-color ease-in-out;
749
+ }
750
+ }
751
+ .dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection.is-selected {
752
+ background: var(--wp-admin-theme-color, #3858e9);
753
+ border-color: var(--wp-admin-theme-color, #3858e9);
754
+ }
755
+ .dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection.is-selected svg {
756
+ --checkmark-size: var(--checkbox-size);
757
+ fill: #fff;
758
+ position: absolute;
759
+ right: 50%;
760
+ top: 50%;
761
+ transform: translate(50%, -50%);
762
+ width: var(--checkmark-size);
763
+ height: var(--checkmark-size);
764
+ }
765
+ @media (min-width: 600px) {
766
+ .dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection.is-selected svg {
767
+ --checkmark-size: calc(var(--checkbox-size) + 4px);
768
+ }
769
+ }
524
770
 
525
771
  .dataviews-filters__search-widget-filter-combobox__wrapper {
526
772
  position: relative;
@@ -626,6 +872,13 @@
626
872
  width: fit-content;
627
873
  }
628
874
 
875
+ .dataviews-filters__user-input-widget {
876
+ padding: 16px;
877
+ }
878
+ .dataviews-filters__user-input-widget .components-input-control__prefix {
879
+ padding-right: 8px;
880
+ }
881
+
629
882
  .dataviews-footer {
630
883
  position: sticky;
631
884
  bottom: 0;
@@ -1131,6 +1384,23 @@ div.dataviews-view-list {
1131
1384
  .dataviews-view-table th.dataviews-view-table__actions-column {
1132
1385
  text-align: left;
1133
1386
  }
1387
+ .dataviews-view-table td.dataviews-view-table__actions-column--sticky,
1388
+ .dataviews-view-table th.dataviews-view-table__actions-column--sticky {
1389
+ position: sticky;
1390
+ left: 0;
1391
+ background-color: #fff;
1392
+ }
1393
+ .dataviews-view-table td.dataviews-view-table__actions-column--stuck::after,
1394
+ .dataviews-view-table th.dataviews-view-table__actions-column--stuck::after {
1395
+ display: block;
1396
+ content: "";
1397
+ position: absolute;
1398
+ top: 0;
1399
+ bottom: 0;
1400
+ right: 0;
1401
+ width: 1px;
1402
+ background-color: #f0f0f0;
1403
+ }
1134
1404
  .dataviews-view-table td.dataviews-view-table__checkbox-column,
1135
1405
  .dataviews-view-table th.dataviews-view-table__checkbox-column {
1136
1406
  padding-left: 0;
@@ -1157,7 +1427,7 @@ div.dataviews-view-list {
1157
1427
  .dataviews-view-table tr:last-child {
1158
1428
  border-bottom: 0;
1159
1429
  }
1160
- .dataviews-view-table tr.is-hovered {
1430
+ .dataviews-view-table tr.is-hovered, .dataviews-view-table tr.is-hovered .dataviews-view-table__actions-column--sticky {
1161
1431
  background-color: #f8f8f8;
1162
1432
  }
1163
1433
  .dataviews-view-table tr .components-checkbox-control__input.components-checkbox-control__input {
@@ -1191,6 +1461,12 @@ div.dataviews-view-list {
1191
1461
  .dataviews-view-table tr.is-selected:hover {
1192
1462
  background-color: rgba(var(--wp-admin-theme-color--rgb), 0.08);
1193
1463
  }
1464
+ .dataviews-view-table tr.is-selected .dataviews-view-table__actions-column--sticky {
1465
+ background-color: color-mix(in srgb, rgb(var(--wp-admin-theme-color--rgb)) 4%, #fff);
1466
+ }
1467
+ .dataviews-view-table tr.is-selected:hover .dataviews-view-table__actions-column--sticky {
1468
+ background-color: color-mix(in srgb, rgb(var(--wp-admin-theme-color--rgb)) 8%, #fff);
1469
+ }
1194
1470
  .dataviews-view-table thead {
1195
1471
  position: sticky;
1196
1472
  inset-block-start: 0;
@@ -1219,6 +1495,12 @@ div.dataviews-view-list {
1219
1495
  display: flex;
1220
1496
  align-items: center;
1221
1497
  }
1498
+ .dataviews-view-table tbody .dataviews-view-table__cell-content-wrapper.dataviews-view-table__cell-align-end {
1499
+ justify-content: flex-end;
1500
+ }
1501
+ .dataviews-view-table tbody .dataviews-view-table__cell-content-wrapper.dataviews-view-table__cell-align-center {
1502
+ justify-content: center;
1503
+ }
1222
1504
  .dataviews-view-table tbody .components-v-stack > .dataviews-view-table__cell-content-wrapper:not(:first-child) {
1223
1505
  min-height: 0;
1224
1506
  }
@@ -1291,6 +1573,11 @@ div.dataviews-view-list {
1291
1573
  padding: 0;
1292
1574
  }
1293
1575
 
1576
+ .dataviews-controls__datetime-number,
1577
+ .dataviews-controls__datetime-unit {
1578
+ flex: 1 1 50%;
1579
+ }
1580
+
1294
1581
  .dataforms-layouts-panel__field {
1295
1582
  width: 100%;
1296
1583
  min-height: 32px;
@@ -1306,6 +1593,8 @@ div.dataviews-view-list {
1306
1593
  align-items: center;
1307
1594
  line-height: 20px;
1308
1595
  hyphens: auto;
1596
+ }
1597
+ .dataforms-layouts-panel__field-label--label-position-side {
1309
1598
  align-self: center;
1310
1599
  }
1311
1600
 
@@ -1323,6 +1612,9 @@ div.dataviews-view-list {
1323
1612
  text-wrap: pretty;
1324
1613
  min-height: 32px;
1325
1614
  }
1615
+ .dataforms-layouts-panel__field-control.components-button.is-link[aria-disabled=true] {
1616
+ text-decoration: none;
1617
+ }
1326
1618
  .dataforms-layouts-panel__field-control .components-dropdown {
1327
1619
  max-width: 100%;
1328
1620
  }
@@ -1361,6 +1653,8 @@ div.dataviews-view-list {
1361
1653
  align-items: center;
1362
1654
  line-height: 20px;
1363
1655
  hyphens: auto;
1656
+ }
1657
+ .dataforms-layouts-regular__field-label--label-position-side {
1364
1658
  align-self: center;
1365
1659
  }
1366
1660