@panneau/lists 5.0.0-alpha.2 → 5.0.0-alpha.21

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 (165) hide show
  1. package/README.md +17 -15
  2. package/dist/ItemDetails.css +50 -0
  3. package/dist/ItemDetails.d.ts +27 -0
  4. package/dist/ItemDetails.d.ts.map +1 -0
  5. package/dist/ItemDetails.js +134 -0
  6. package/dist/ItemDetails.js.map +1 -0
  7. package/dist/ItemDetails.module.js +20 -0
  8. package/dist/ItemDetails.module.js.map +1 -0
  9. package/dist/List.d.ts +3 -3
  10. package/dist/List.d.ts.map +1 -1
  11. package/dist/List.js +31 -10
  12. package/dist/List.js.map +1 -1
  13. package/dist/ListSkeleton.d.ts +19 -0
  14. package/dist/ListSkeleton.d.ts.map +1 -0
  15. package/dist/ListSkeleton.js +115 -0
  16. package/dist/ListSkeleton.js.map +1 -0
  17. package/dist/ListView.d.ts +73 -8
  18. package/dist/ListView.d.ts.map +1 -1
  19. package/dist/ListView.js +616 -218
  20. package/dist/ListView.js.map +1 -1
  21. package/dist/actions/ActionButton.d.ts +8 -2
  22. package/dist/actions/ActionButton.d.ts.map +1 -1
  23. package/dist/actions/ActionButton.js +98 -26
  24. package/dist/actions/ActionButton.js.map +1 -1
  25. package/dist/actions/Actions.css +16 -38
  26. package/dist/actions/Actions.module.js +6 -6
  27. package/dist/actions/Actions.module.js.map +1 -1
  28. package/dist/actions/ConfirmDialog.d.ts +20 -4
  29. package/dist/actions/ConfirmDialog.d.ts.map +1 -1
  30. package/dist/actions/ConfirmDialog.js +110 -92
  31. package/dist/actions/ConfirmDialog.js.map +1 -1
  32. package/dist/actions/RowActions.d.ts +25 -9
  33. package/dist/actions/RowActions.d.ts.map +1 -1
  34. package/dist/actions/RowActions.js +151 -80
  35. package/dist/actions/RowActions.js.map +1 -1
  36. package/dist/actions/actions.d.ts +5 -4
  37. package/dist/actions/actions.d.ts.map +1 -1
  38. package/dist/actions/actions.js +7 -14
  39. package/dist/actions/actions.js.map +1 -1
  40. package/dist/actions/fit.d.ts +25 -0
  41. package/dist/actions/fit.d.ts.map +1 -0
  42. package/dist/actions/fit.js +197 -0
  43. package/dist/actions/fit.js.map +1 -0
  44. package/dist/actions/icons.d.ts +5 -0
  45. package/dist/actions/icons.d.ts.map +1 -1
  46. package/dist/actions/icons.js +15 -1
  47. package/dist/actions/icons.js.map +1 -1
  48. package/dist/columns.d.ts +10 -0
  49. package/dist/columns.d.ts.map +1 -0
  50. package/dist/columns.js +25 -0
  51. package/dist/columns.js.map +1 -0
  52. package/dist/cx.js.map +1 -1
  53. package/dist/displays/Displays.css +48 -0
  54. package/dist/displays/Displays.module.js +18 -2
  55. package/dist/displays/Displays.module.js.map +1 -1
  56. package/dist/displays/displays.d.ts +62 -6
  57. package/dist/displays/displays.d.ts.map +1 -1
  58. package/dist/displays/displays.js +1151 -89
  59. package/dist/displays/displays.js.map +1 -1
  60. package/dist/filters/Filters.css +25 -11
  61. package/dist/filters/Filters.d.ts +1 -1
  62. package/dist/filters/Filters.js.map +1 -1
  63. package/dist/filters/Filters.module.js +5 -1
  64. package/dist/filters/Filters.module.js.map +1 -1
  65. package/dist/filters/controls.d.ts +1 -1
  66. package/dist/filters/controls.d.ts.map +1 -1
  67. package/dist/filters/controls.js +57 -35
  68. package/dist/filters/controls.js.map +1 -1
  69. package/dist/filters/format.d.ts +1 -1
  70. package/dist/filters/format.js.map +1 -1
  71. package/dist/images.d.ts +7 -0
  72. package/dist/images.d.ts.map +1 -0
  73. package/dist/images.js +39 -0
  74. package/dist/images.js.map +1 -0
  75. package/dist/index.d.ts +22 -18
  76. package/dist/index.d.ts.map +1 -1
  77. package/dist/index.js +7 -3
  78. package/dist/inline/Inline.css +58 -0
  79. package/dist/inline/Inline.module.js +20 -0
  80. package/dist/inline/Inline.module.js.map +1 -0
  81. package/dist/inline/InlineCell.d.ts +29 -0
  82. package/dist/inline/InlineCell.d.ts.map +1 -0
  83. package/dist/inline/InlineCell.js +490 -0
  84. package/dist/inline/InlineCell.js.map +1 -0
  85. package/dist/inline/editable.d.ts +12 -0
  86. package/dist/inline/editable.d.ts.map +1 -0
  87. package/dist/inline/editable.js +29 -0
  88. package/dist/inline/editable.js.map +1 -0
  89. package/dist/layouts/CalendarLayout.css +153 -0
  90. package/dist/layouts/CalendarLayout.d.ts +9 -0
  91. package/dist/layouts/CalendarLayout.d.ts.map +1 -0
  92. package/dist/layouts/CalendarLayout.js +303 -0
  93. package/dist/layouts/CalendarLayout.js.map +1 -0
  94. package/dist/layouts/CalendarLayout.module.js +28 -0
  95. package/dist/layouts/CalendarLayout.module.js.map +1 -0
  96. package/dist/layouts/CardsLayout.css +5 -0
  97. package/dist/layouts/CardsLayout.d.ts +2 -2
  98. package/dist/layouts/CardsLayout.d.ts.map +1 -1
  99. package/dist/layouts/CardsLayout.js +92 -91
  100. package/dist/layouts/CardsLayout.js.map +1 -1
  101. package/dist/layouts/CardsLayout.module.js.map +1 -1
  102. package/dist/layouts/GalleryLayout.css +87 -0
  103. package/dist/layouts/GalleryLayout.d.ts +8 -0
  104. package/dist/layouts/GalleryLayout.d.ts.map +1 -0
  105. package/dist/layouts/GalleryLayout.js +152 -0
  106. package/dist/layouts/GalleryLayout.js.map +1 -0
  107. package/dist/layouts/GalleryLayout.module.js +26 -0
  108. package/dist/layouts/GalleryLayout.module.js.map +1 -0
  109. package/dist/layouts/ItemTitle.d.ts +3 -1
  110. package/dist/layouts/ItemTitle.d.ts.map +1 -1
  111. package/dist/layouts/ItemTitle.js +12 -8
  112. package/dist/layouts/ItemTitle.js.map +1 -1
  113. package/dist/layouts/TableLayout.css +56 -0
  114. package/dist/layouts/TableLayout.d.ts +5 -4
  115. package/dist/layouts/TableLayout.d.ts.map +1 -1
  116. package/dist/layouts/TableLayout.js +171 -101
  117. package/dist/layouts/TableLayout.js.map +1 -1
  118. package/dist/layouts/TableLayout.module.js +8 -4
  119. package/dist/layouts/TableLayout.module.js.map +1 -1
  120. package/dist/layouts/builtIn.d.ts +2 -2
  121. package/dist/layouts/builtIn.d.ts.map +1 -1
  122. package/dist/layouts/builtIn.js +6 -2
  123. package/dist/layouts/builtIn.js.map +1 -1
  124. package/dist/layouts/calendarDays.d.ts +14 -0
  125. package/dist/layouts/calendarDays.d.ts.map +1 -0
  126. package/dist/layouts/calendarDays.js +44 -0
  127. package/dist/layouts/calendarDays.js.map +1 -0
  128. package/dist/plugin.d.ts +1 -1
  129. package/dist/plugin.js.map +1 -1
  130. package/dist/query.d.ts +4 -3
  131. package/dist/query.d.ts.map +1 -1
  132. package/dist/query.js +15 -4
  133. package/dist/query.js.map +1 -1
  134. package/dist/selection.d.ts +1 -1
  135. package/dist/selection.js.map +1 -1
  136. package/dist/toolbar/ColumnMenu.d.ts +17 -0
  137. package/dist/toolbar/ColumnMenu.d.ts.map +1 -0
  138. package/dist/toolbar/ColumnMenu.js +193 -0
  139. package/dist/toolbar/ColumnMenu.js.map +1 -0
  140. package/dist/toolbar/LayoutSwitch.d.ts.map +1 -1
  141. package/dist/toolbar/LayoutSwitch.js +73 -55
  142. package/dist/toolbar/LayoutSwitch.js.map +1 -1
  143. package/dist/toolbar/Pagination.d.ts +33 -0
  144. package/dist/toolbar/Pagination.d.ts.map +1 -1
  145. package/dist/toolbar/Pagination.js +282 -42
  146. package/dist/toolbar/Pagination.js.map +1 -1
  147. package/dist/toolbar/SearchField.js.map +1 -1
  148. package/dist/toolbar/SortSelect.d.ts +1 -1
  149. package/dist/toolbar/SortSelect.js.map +1 -1
  150. package/dist/toolbar/Toolbar.css +36 -0
  151. package/dist/toolbar/Toolbar.module.js +12 -2
  152. package/dist/toolbar/Toolbar.module.js.map +1 -1
  153. package/dist/types.d.ts +69 -1
  154. package/dist/types.d.ts.map +1 -1
  155. package/dist/useDraft.js.map +1 -1
  156. package/dist/useListState.js.map +1 -1
  157. package/dist/useRenderValue.d.ts +10 -0
  158. package/dist/useRenderValue.d.ts.map +1 -0
  159. package/dist/useRenderValue.js +84 -0
  160. package/dist/useRenderValue.js.map +1 -0
  161. package/dist/values.d.ts +4 -1
  162. package/dist/values.d.ts.map +1 -1
  163. package/dist/values.js +6 -2
  164. package/dist/values.js.map +1 -1
  165. package/package.json +9 -9
@@ -1 +1 @@
1
- {"version":3,"file":"format.js","names":[],"sources":["../../src/filters/format.ts"],"sourcesContent":["import type { IntlShape } from 'react-intl';\n\nimport type { Field, Filter, Option } from '@panneau/protocol';\nimport { isFilterRange } from '@panneau/protocol/runtime';\n\nimport { messages } from '../messages';\nimport type { ListColumn } from '../types';\nimport { getFieldOptions, getOptionLabel } from '../values';\n\n/** The label of a filter: its `label`, the label of its field, or its id. */\nexport function getFilterLabel(\n filter: Filter,\n columns: readonly ListColumn[],\n fields: readonly Field[],\n): string {\n if (filter.label !== undefined) {\n return filter.label;\n }\n const field = findFilterField(filter, columns, fields);\n return field?.label ?? filter.id;\n}\n\n/** The field a filter filters, when a column or the list's fields have one with its id. */\nexport function findFilterField(\n filter: Filter,\n columns: readonly ListColumn[],\n fields: readonly Field[],\n): Field | null {\n return (\n fields.find((field) => field.name === filter.id) ??\n columns.find((column) => column.field?.name === filter.id)?.field ??\n null\n );\n}\n\n/** The options of a filter: its own, or those of the field it filters. */\nexport function getFilterOptions(\n filter: Filter,\n columns: readonly ListColumn[],\n fields: readonly Field[],\n): readonly Option[] {\n return filter.options ?? getFieldOptions(findFilterField(filter, columns, fields));\n}\n\nconst DATE_ONLY = /^(\\d{4})-(\\d{2})-(\\d{2})$/;\n\nfunction formatDay(value: string, intl: IntlShape): string {\n const match = DATE_ONLY.exec(value);\n if (match === null) {\n return value;\n }\n return intl.formatDate(new Date(Number(match[1]), Number(match[2]) - 1, Number(match[3])), {\n dateStyle: 'medium',\n });\n}\n\n/** The value of an active filter, as the text of its chip. */\nexport function formatFilterValue(\n filter: Filter,\n value: unknown,\n {\n intl,\n options,\n getValueLabel,\n }: {\n intl: IntlShape;\n options: readonly Option[];\n getValueLabel: (value: string) => string | null;\n },\n): string {\n const values: unknown[] = Array.isArray(value) ? value : [value];\n switch (filter.type) {\n case 'toggle':\n return intl.formatMessage(String(value) === 'true' ? messages.yes : messages.no);\n case 'date':\n return formatDay(String(value), intl);\n case 'date-range': {\n const range = isFilterRange(value) ? value : {};\n const from = range.from !== undefined ? String(range.from) : '';\n const to = range.to !== undefined ? String(range.to) : '';\n return intl.formatMessage(messages.dateRange, {\n from: from !== '' ? formatDay(from, intl) : '…',\n to: to !== '' ? formatDay(to, intl) : '…',\n });\n }\n case 'relation':\n return values.map((entry) => getValueLabel(String(entry)) ?? String(entry)).join(', ');\n default:\n return values\n .map((entry) => getOptionLabel(options, entry) ?? String(entry))\n .join(', ');\n }\n}\n"],"mappings":";;;;;AAUA,SAAgB,eACZ,QACA,SACA,QACM;CACN,IAAI,OAAO,UAAU,KAAA,GACjB,OAAO,OAAO;CAGlB,OADc,gBAAgB,QAAQ,SAAS,MACxC,CAAA,EAAO,SAAS,OAAO;AAClC;;AAGA,SAAgB,gBACZ,QACA,SACA,QACY;CACZ,OACI,OAAO,MAAM,UAAU,MAAM,SAAS,OAAO,EAAE,KAC/C,QAAQ,MAAM,WAAW,OAAO,OAAO,SAAS,OAAO,EAAE,CAAC,EAAE,SAC5D;AAER;;AAGA,SAAgB,iBACZ,QACA,SACA,QACiB;CACjB,OAAO,OAAO,WAAW,gBAAgB,gBAAgB,QAAQ,SAAS,MAAM,CAAC;AACrF;AAEA,IAAM,YAAY;AAElB,SAAS,UAAU,OAAe,MAAyB;CACvD,MAAM,QAAQ,UAAU,KAAK,KAAK;CAClC,IAAI,UAAU,MACV,OAAO;CAEX,OAAO,KAAK,WAAW,IAAI,KAAK,OAAO,MAAM,EAAE,GAAG,OAAO,MAAM,EAAE,IAAI,GAAG,OAAO,MAAM,EAAE,CAAC,GAAG,EACvF,WAAW,SACf,CAAC;AACL;;AAGA,SAAgB,kBACZ,QACA,OACA,EACI,MACA,SACA,iBAME;CACN,MAAM,SAAoB,MAAM,QAAQ,KAAK,IAAI,QAAQ,CAAC,KAAK;CAC/D,QAAQ,OAAO,MAAf;EACI,KAAK,UACD,OAAO,KAAK,cAAc,OAAO,KAAK,MAAM,SAAS,SAAS,MAAM,SAAS,EAAE;EACnF,KAAK,QACD,OAAO,UAAU,OAAO,KAAK,GAAG,IAAI;EACxC,KAAK,cAAc;GACf,MAAM,QAAQ,cAAc,KAAK,IAAI,QAAQ,CAAC;GAC9C,MAAM,OAAO,MAAM,SAAS,KAAA,IAAY,OAAO,MAAM,IAAI,IAAI;GAC7D,MAAM,KAAK,MAAM,OAAO,KAAA,IAAY,OAAO,MAAM,EAAE,IAAI;GACvD,OAAO,KAAK,cAAc,SAAS,WAAW;IAC1C,MAAM,SAAS,KAAK,UAAU,MAAM,IAAI,IAAI;IAC5C,IAAI,OAAO,KAAK,UAAU,IAAI,IAAI,IAAI;GAC1C,CAAC;EACL;EACA,KAAK,YACD,OAAO,OAAO,KAAK,UAAU,cAAc,OAAO,KAAK,CAAC,KAAK,OAAO,KAAK,CAAC,CAAC,CAAC,KAAK,IAAI;EACzF,SACI,OAAO,OACF,KAAK,UAAU,eAAe,SAAS,KAAK,KAAK,OAAO,KAAK,CAAC,CAAC,CAC/D,KAAK,IAAI;CACtB;AACJ"}
1
+ {"version":3,"file":"format.js","names":["IntlShape","Field","Filter","Option","isFilterRange","messages","ListColumn","getFieldOptions","getOptionLabel","getFilterLabel","filter","columns","fields","label","undefined","field","findFilterField","id","find","name","column","getFilterOptions","options","DATE_ONLY","formatDay","value","intl","match","exec","formatDate","Date","Number","dateStyle","formatFilterValue","getValueLabel","values","Array","isArray","type","formatMessage","String","yes","no","range","from","to","dateRange","map","entry","join"],"sources":["../../src/filters/format.ts"],"sourcesContent":["import type { IntlShape } from 'react-intl';\n\nimport type { Field, Filter, Option } from '@panneau/protocol';\nimport { isFilterRange } from '@panneau/protocol/runtime';\n\nimport { messages } from '../messages';\nimport type { ListColumn } from '../types';\nimport { getFieldOptions, getOptionLabel } from '../values';\n\n/** The label of a filter: its `label`, the label of its field, or its id. */\nexport function getFilterLabel(\n filter: Filter,\n columns: readonly ListColumn[],\n fields: readonly Field[],\n): string {\n if (filter.label !== undefined) {\n return filter.label;\n }\n const field = findFilterField(filter, columns, fields);\n return field?.label ?? filter.id;\n}\n\n/** The field a filter filters, when a column or the list's fields have one with its id. */\nexport function findFilterField(\n filter: Filter,\n columns: readonly ListColumn[],\n fields: readonly Field[],\n): Field | null {\n return (\n fields.find((field) => field.name === filter.id) ??\n columns.find((column) => column.field?.name === filter.id)?.field ??\n null\n );\n}\n\n/** The options of a filter: its own, or those of the field it filters. */\nexport function getFilterOptions(\n filter: Filter,\n columns: readonly ListColumn[],\n fields: readonly Field[],\n): readonly Option[] {\n return filter.options ?? getFieldOptions(findFilterField(filter, columns, fields));\n}\n\nconst DATE_ONLY = /^(\\d{4})-(\\d{2})-(\\d{2})$/;\n\nfunction formatDay(value: string, intl: IntlShape): string {\n const match = DATE_ONLY.exec(value);\n if (match === null) {\n return value;\n }\n return intl.formatDate(new Date(Number(match[1]), Number(match[2]) - 1, Number(match[3])), {\n dateStyle: 'medium',\n });\n}\n\n/** The value of an active filter, as the text of its chip. */\nexport function formatFilterValue(\n filter: Filter,\n value: unknown,\n {\n intl,\n options,\n getValueLabel,\n }: {\n intl: IntlShape;\n options: readonly Option[];\n getValueLabel: (value: string) => string | null;\n },\n): string {\n const values: unknown[] = Array.isArray(value) ? value : [value];\n switch (filter.type) {\n case 'toggle':\n return intl.formatMessage(String(value) === 'true' ? messages.yes : messages.no);\n case 'date':\n return formatDay(String(value), intl);\n case 'date-range': {\n const range = isFilterRange(value) ? value : {};\n const from = range.from !== undefined ? String(range.from) : '';\n const to = range.to !== undefined ? String(range.to) : '';\n return intl.formatMessage(messages.dateRange, {\n from: from !== '' ? formatDay(from, intl) : '…',\n to: to !== '' ? formatDay(to, intl) : '…',\n });\n }\n case 'relation':\n return values.map((entry) => getValueLabel(String(entry)) ?? String(entry)).join(', ');\n default:\n return values\n .map((entry) => getOptionLab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C,SAAS9B,KAAAA,IAAY0B,OAAOG,MAAMC,IAAI,IAAI;GAC7D,MAAMC,KAAKF,MAAME,OAAO/B,KAAAA,IAAY0B,OAAOG,MAAME,EAAE,IAAI;GACvD,OAAOnB,KAAKa,cAAclC,SAASyC,WAAW;IAC1CF,MAAMA,SAAS,KAAKpB,UAAUoB,MAAMlB,IAAI,IAAI;IAC5CmB,IAAIA,OAAO,KAAKrB,UAAUqB,IAAInB,IAAI,IAAI;GAC1C,CAAC;EACL;EACA,KAAK,YACD,OAAOS,OAAOY,KAAKC,UAAUd,cAAcM,OAAOQ,KAAK,CAAC,KAAKR,OAAOQ,KAAK,CAAC,CAAC,CAACC,KAAK,IAAI;EACzF,SACI,OAAOd,OACFY,KAAKC,UAAUxC,eAAec,SAAS0B,KAAK,KAAKR,OAAOQ,KAAK,CAAC,CAAC,CAC/DC,KAAK,IAAI;CACtB;AACJ"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * The URL of an image value: a media reference or a media (its thumbnail, or the URL of an
3
+ * image), a stored file (the URL of an image that browsers show), or a URL. `null` for anything
4
+ * else, such as a PDF without a thumbnail.
5
+ */
6
+ export declare function getImageUrl(value: unknown): string | null;
7
+ //# sourceMappingURL=images.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"images.d.ts","sourceRoot":"","sources":["../src/images.ts"],"names":[],"mappings":"AA4BA;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAWzD"}
package/dist/images.js ADDED
@@ -0,0 +1,39 @@
1
+ import { isRecord } from "./values.js";
2
+ //#region src/images.ts
3
+ /** The types of images that browsers show. A HEIC or TIFF original needs a thumbnail. */
4
+ var WEB_IMAGE_TYPES = /* @__PURE__ */ new Set([
5
+ "image/apng",
6
+ "image/avif",
7
+ "image/bmp",
8
+ "image/gif",
9
+ "image/jpeg",
10
+ "image/png",
11
+ "image/svg+xml",
12
+ "image/webp"
13
+ ]);
14
+ /**
15
+ * Whether the URL of a media or a file is an image to show, from its `type` (a media's URL is
16
+ * the file to show) or its `mime` (a file's URL is its original), when it says.
17
+ */
18
+ function isImage(source) {
19
+ if (typeof source.type === "string") return source.type === "image";
20
+ if (typeof source.mime === "string") return WEB_IMAGE_TYPES.has(source.mime.toLowerCase());
21
+ return true;
22
+ }
23
+ /**
24
+ * The URL of an image value: a media reference or a media (its thumbnail, or the URL of an
25
+ * image), a stored file (the URL of an image that browsers show), or a URL. `null` for anything
26
+ * else, such as a PDF without a thumbnail.
27
+ */
28
+ function getImageUrl(value) {
29
+ const first = Array.isArray(value) ? value[0] : value;
30
+ if (typeof first === "string") return first !== "" ? first : null;
31
+ if (!isRecord(first)) return null;
32
+ const source = isRecord(first.media) ? first.media : first;
33
+ const url = source.thumbnailUrl ?? (isImage(source) ? source.url : null);
34
+ return typeof url === "string" && url !== "" ? url : null;
35
+ }
36
+ //#endregion
37
+ export { getImageUrl };
38
+
39
+ //# sourceMappingURL=images.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"images.js","names":["isRecord","WEB_IMAGE_TYPES","Set","isImage","source","Record","type","mime","has","toLowerCase","getImageUrl","value","first","Array","isArray","media","url","thumbnailUrl"],"sources":["../src/images.ts"],"sourcesContent":["import { isRecord } from './values';\n\n/** The types of images that browsers show. A HEIC or TIFF original needs a thumbnail. */\nconst WEB_IMAGE_TYPES = new Set([\n 'image/apng',\n 'image/avif',\n 'image/bmp',\n 'image/gif',\n 'image/jpeg',\n 'image/png',\n 'image/svg+xml',\n 'image/webp',\n]);\n\n/**\n * Whether the URL of a media or a file is an image to show, from its `type` (a media's URL is\n * the file to show) or its `mime` (a file's URL is its original), when it says.\n */\nfunction isImage(source: Record<string, unknown>): boolean {\n if (typeof source.type === 'string') {\n return source.type === 'image';\n }\n if (typeof source.mime === 'string') {\n return WEB_IMAGE_TYPES.has(source.mime.toLowerCase());\n }\n return true;\n}\n\n/**\n * The URL of an image value: a media reference or a media (its thumbnail, or the URL of an\n * image), a stored file (the URL of an image that browsers show), or a URL. `null` for anything\n * else, such as a PDF without a thumbnail.\n */\nexport function getImageUrl(value: unknown): string | null {\n const first: unknown = Array.isArray(value) ? value[0] : value;\n if (typeof first === 'string') {\n return first !== '' ? first : null;\n }\n if (!isRecord(first)) {\n return null;\n }\n const source = isRecord(first.media) ? first.media : first;\n const url = source.thumbnailUrl ?? (isImage(source) ? source.url : null);\n return typeof url === 'string' && url !== '' ? url : null;\n}\n"],"mappings":";;;AAGA,IAAMC,kCAAkB,IAAIC,IAAI;CAC5B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AAAY,CACf;;;;;AAMD,SAASC,QAAQC,QAA0C;CACvD,IAAI,OAAOA,OAAOE,SAAS,UACvB,OAAOF,OAAOE,SAAS;CAE3B,IAAI,OAAOF,OAAOG,SAAS,UACvB,OAAON,gBAAgBO,IAAIJ,OAAOG,KAAKE,YAAY,CAAC;CAExD,OAAO;AACX;;;;;;AAOA,SAAgBC,YAAYC,OAA+B;CACvD,MAAMC,QAAiBC,MAAMC,QAAQH,KAAK,IAAIA,MAAM,KAAKA;CACzD,IAAI,OAAOC,UAAU,UACjB,OAAOA,UAAU,KAAKA,QAAQ;CAElC,IAAI,CAACZ,SAASY,KAAK,GACf,OAAO;CAEX,MAAMR,SAASJ,SAASY,MAAMG,KAAK,IAAIH,MAAMG,QAAQH;CACrD,MAAMI,MAAMZ,OAAOa,iBAAiBd,QAAQC,MAAM,IAAIA,OAAOY,MAAM;CACnE,OAAO,OAAOA,QAAQ,YAAYA,QAAQ,KAAKA,MAAM;AACzD"}
package/dist/index.d.ts CHANGED
@@ -1,19 +1,23 @@
1
- export { type ListActions, getActionHref, groupListActions, isAllowedOn } from './actions/actions';
2
- export { ConfirmDialog, type ConfirmDialogProps } from './actions/ConfirmDialog';
3
- export { type ActionIcons, getActionIcon } from './actions/icons';
4
- export { BooleanDisplay, ColorDisplay, DateDisplay, DateTimeDisplay, EmailDisplay, EmptyValue, MediaDisplay, NumberDisplay, RelationDisplay, RichTextDisplay, SelectDisplay, TextDisplay, TimeDisplay, UrlDisplay, builtInDisplays, } from './displays/displays';
5
- export { DateFilter, DateRangeFilter, RelationFilter, SelectFilter, TextFilter, ToggleFilter, builtInFilters, } from './filters/controls';
6
- export { CardsLayout } from './layouts/CardsLayout';
7
- export { TableLayout } from './layouts/TableLayout';
8
- export { builtInLayouts } from './layouts/builtIn';
9
- export { List, type ListProps } from './List';
10
- export { ListView, type ListViewProps } from './ListView';
11
- export { listsPlugin } from './plugin';
12
- export { type LocalQueryOptions, type LocalQueryResult, applyListQuery } from './query';
13
- export { countSelected, getPageSelection, isItemSelected } from './selection';
14
- export { Pagination, type PaginationProps } from './toolbar/Pagination';
15
- export { SearchField, type SearchFieldProps } from './toolbar/SearchField';
16
- export type { DisplayEntry, DisplayProps, FilterControlProps, FilterEntry, ListActionEvent, ListActionHandler, ListColumn, ListItem, ListLayoutEntry, ListLayoutProps, } from './types';
17
- export { useListState } from './useListState';
18
- export { getLocalizedValue, toText } from './values';
1
+ export { type ListActions, getActionHref, groupListActions, isAllowedOn } from './actions/actions.js';
2
+ export { ConfirmDialog, type ConfirmDialogProps, type ConfirmPreview, } from './actions/ConfirmDialog.js';
3
+ export { type ActionIcons, getActionIcon } from './actions/icons.js';
4
+ export { BooleanDisplay, ColorDisplay, CountryDisplay, DateDisplay, DateRangeDisplay, DateTimeDisplay, DurationDisplay, EmailDisplay, EmbedDisplay, EmptyValue, FileDisplay, JsonDisplay, LocationDisplay, MediaDisplay, MoneyDisplay, NumberDisplay, RegionDisplay, AddressDisplay, LinkDisplay, RelationDisplay, RichTextDisplay, SelectDisplay, TagsDisplay, TelDisplay, TextDisplay, TimeDisplay, UrlDisplay, builtInDisplays, } from './displays/displays.js';
5
+ export { DateFilter, DateRangeFilter, RelationFilter, SelectFilter, TextFilter, ToggleFilter, builtInFilters, } from './filters/controls.js';
6
+ export { CalendarLayout } from './layouts/CalendarLayout.js';
7
+ export { CardsLayout } from './layouts/CardsLayout.js';
8
+ export { GalleryLayout } from './layouts/GalleryLayout.js';
9
+ export { TableLayout } from './layouts/TableLayout.js';
10
+ export { builtInLayouts } from './layouts/builtIn.js';
11
+ export { ItemDetails, type ItemDetailsColumn, type ItemDetailsProps } from './ItemDetails.js';
12
+ export { List, type ListProps } from './List.js';
13
+ export { ListView, type ListViewProps } from './ListView.js';
14
+ export { listsPlugin } from './plugin.js';
15
+ export { type LocalQueryOptions, type LocalQueryResult, applyListQuery } from './query.js';
16
+ export { countSelected, getPageSelection, isItemSelected } from './selection.js';
17
+ export { CursorPagination, type CursorPaginationProps, Pagination, type PaginationProps, getPagingProps, } from './toolbar/Pagination.js';
18
+ export { SearchField, type SearchFieldProps } from './toolbar/SearchField.js';
19
+ export type { DisplayEntry, DisplayProps, FilterControlProps, FilterEntry, ListActionEvent, ListActionHandler, ListActionPreview, ListActionPreviewer, ListColumn, ListCalendarProps, ListItem, ListLayoutEntry, ListLayoutProps, } from './types.js';
20
+ export { useListState } from './useListState.js';
21
+ export { getImageUrl } from './images.js';
22
+ export { getLocalizedValue, toText } from './values.js';
19
23
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,WAAW,EAAE,aAAa,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACnG,OAAO,EAAE,aAAa,EAAE,KAAK,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AACjF,OAAO,EAAE,KAAK,WAAW,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAClE,OAAO,EACH,cAAc,EACd,YAAY,EACZ,WAAW,EACX,eAAe,EACf,YAAY,EACZ,UAAU,EACV,YAAY,EACZ,aAAa,EACb,eAAe,EACf,eAAe,EACf,aAAa,EACb,WAAW,EACX,WAAW,EACX,UAAU,EACV,eAAe,GAClB,MAAM,qBAAqB,CAAC;AAC7B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AAgB,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC9E,OAAO,EACH,gBAAgB,EAChB,KAAK,qBAAqB,EAC1B,UAAU,EACV,KAAK,eAAe,EACpB,cAAc,GACjB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,WAAW,EAAE,KAAK,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAC3E,YAAY,EACR,YAAY,EACZ,YAAY,EACZ,kBAAkB,EAClB,WAAW,EACX,eAAe,EACf,iBAAiB,EACjB,iBAAiB,EACjB,mBAAmB,EACnB,UAAU,EACV,iBAAiB,EACjB,QAAQ,EACR,eAAe,EACf,eAAe,GAClB,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,EAAE,iBAAiB,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC"}
package/dist/index.js CHANGED
@@ -2,17 +2,21 @@ import { getActionHref, groupListActions, isAllowedOn } from "./actions/actions.
2
2
  import { ConfirmDialog } from "./actions/ConfirmDialog.js";
3
3
  import { getActionIcon } from "./actions/icons.js";
4
4
  import { getLocalizedValue, toText } from "./values.js";
5
- import { BooleanDisplay, ColorDisplay, DateDisplay, DateTimeDisplay, EmailDisplay, EmptyValue, MediaDisplay, NumberDisplay, RelationDisplay, RichTextDisplay, SelectDisplay, TextDisplay, TimeDisplay, UrlDisplay, builtInDisplays } from "./displays/displays.js";
5
+ import { getImageUrl } from "./images.js";
6
+ import { AddressDisplay, BooleanDisplay, ColorDisplay, CountryDisplay, DateDisplay, DateRangeDisplay, DateTimeDisplay, DurationDisplay, EmailDisplay, EmbedDisplay, EmptyValue, FileDisplay, JsonDisplay, LinkDisplay, LocationDisplay, MediaDisplay, MoneyDisplay, NumberDisplay, RegionDisplay, RelationDisplay, RichTextDisplay, SelectDisplay, TagsDisplay, TelDisplay, TextDisplay, TimeDisplay, UrlDisplay, builtInDisplays } from "./displays/displays.js";
6
7
  import { DateFilter, DateRangeFilter, RelationFilter, SelectFilter, TextFilter, ToggleFilter, builtInFilters } from "./filters/controls.js";
8
+ import { CalendarLayout } from "./layouts/CalendarLayout.js";
7
9
  import { CardsLayout } from "./layouts/CardsLayout.js";
10
+ import { GalleryLayout } from "./layouts/GalleryLayout.js";
8
11
  import { TableLayout } from "./layouts/TableLayout.js";
9
12
  import { builtInLayouts } from "./layouts/builtIn.js";
13
+ import { ItemDetails } from "./ItemDetails.js";
10
14
  import { countSelected, getPageSelection, isItemSelected } from "./selection.js";
11
- import { Pagination } from "./toolbar/Pagination.js";
15
+ import { CursorPagination, Pagination, getPagingProps } from "./toolbar/Pagination.js";
12
16
  import { SearchField } from "./toolbar/SearchField.js";
13
17
  import { useListState } from "./useListState.js";
14
18
  import { ListView } from "./ListView.js";
15
19
  import { applyListQuery } from "./query.js";
16
20
  import { List } from "./List.js";
17
21
  import { listsPlugin } from "./plugin.js";
18
- export { BooleanDisplay, CardsLayout, ColorDisplay, ConfirmDialog, DateDisplay, DateFilter, DateRangeFilter, DateTimeDisplay, EmailDisplay, EmptyValue, List, ListView, MediaDisplay, NumberDisplay, Pagination, RelationDisplay, RelationFilter, RichTextDisplay, SearchField, SelectDisplay, SelectFilter, TableLayout, TextDisplay, TextFilter, TimeDisplay, ToggleFilter, UrlDisplay, applyListQuery, builtInDisplays, builtInFilters, builtInLayouts, countSelected, getActionHref, getActionIcon, getLocalizedValue, getPageSelection, groupListActions, isAllowedOn, isItemSelected, listsPlugin, toText, useListState };
22
+ export { AddressDisplay, BooleanDisplay, CalendarLayout, CardsLayout, ColorDisplay, ConfirmDialog, CountryDisplay, CursorPagination, DateDisplay, DateFilter, DateRangeDisplay, DateRangeFilter, DateTimeDisplay, DurationDisplay, EmailDisplay, EmbedDisplay, EmptyValue, FileDisplay, GalleryLayout, ItemDetails, JsonDisplay, LinkDisplay, List, ListView, LocationDisplay, MediaDisplay, MoneyDisplay, NumberDisplay, Pagination, RegionDisplay, RelationDisplay, RelationFilter, RichTextDisplay, SearchField, SelectDisplay, SelectFilter, TableLayout, TagsDisplay, TelDisplay, TextDisplay, TextFilter, TimeDisplay, ToggleFilter, UrlDisplay, applyListQuery, builtInDisplays, builtInFilters, builtInLayouts, countSelected, getActionHref, getActionIcon, getImageUrl, getLocalizedValue, getPageSelection, getPagingProps, groupListActions, isAllowedOn, isItemSelected, listsPlugin, toText, useListState };
@@ -0,0 +1,58 @@
1
+ .panneau-inline-cell {
2
+ display: flex;
3
+ flex-direction: column;
4
+ gap: var(--panneau-space-1);
5
+ min-width: 8rem;
6
+ }
7
+
8
+ .panneau-inline-cell:has(> .panneau-inline-value) {
9
+ flex-direction: row;
10
+ align-items: center;
11
+ min-width: 0;
12
+ }
13
+
14
+ .panneau-inline-value {
15
+ min-width: 0;
16
+ }
17
+
18
+ /* The edit button shows on the row under the pointer, and when it has focus. */
19
+ .panneau-inline-edit {
20
+ flex-shrink: 0;
21
+ opacity: 0;
22
+ }
23
+
24
+ tr:hover .panneau-inline-edit,
25
+ .panneau-inline-edit[data-focus-visible],
26
+ .panneau-inline-edit[data-pressed] {
27
+ opacity: 1;
28
+ }
29
+
30
+ @media (hover: none) {
31
+ .panneau-inline-edit {
32
+ opacity: 1;
33
+ }
34
+ }
35
+
36
+ .panneau-inline-control {
37
+ display: flex;
38
+ align-items: center;
39
+ gap: var(--panneau-space-2);
40
+ }
41
+
42
+ .panneau-inline-control > :first-child {
43
+ flex: 1;
44
+ }
45
+
46
+ .panneau-inline-conflict {
47
+ display: flex;
48
+ flex-direction: column;
49
+ gap: var(--panneau-space-1);
50
+ font-size: var(--panneau-font-size-sm);
51
+ color: var(--panneau-color-text-muted);
52
+ }
53
+
54
+ .panneau-inline-conflict-actions {
55
+ display: flex;
56
+ flex-wrap: wrap;
57
+ gap: var(--panneau-space-1);
58
+ }
@@ -0,0 +1,20 @@
1
+ import "./Inline.css";
2
+ //#region src/inline/Inline.module.css
3
+ var cell = "panneau-inline-cell";
4
+ var value = "panneau-inline-value";
5
+ var edit = "panneau-inline-edit";
6
+ var control = "panneau-inline-control";
7
+ var conflict = "panneau-inline-conflict";
8
+ var conflictActions = "panneau-inline-conflict-actions";
9
+ var Inline_module_default = {
10
+ cell,
11
+ value,
12
+ edit,
13
+ control,
14
+ conflict,
15
+ conflictActions
16
+ };
17
+ //#endregion
18
+ export { cell, conflict, conflictActions, control, Inline_module_default as default, edit, value };
19
+
20
+ //# sourceMappingURL=Inline.module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Inline.module.js","names":[],"sources":["../../src/inline/Inline.module.css"],"sourcesContent":[".cell {\n display: flex;\n flex-direction: column;\n gap: var(--panneau-space-1);\n min-width: 8rem;\n}\n\n.cell:has(> .value) {\n flex-direction: row;\n align-items: center;\n min-width: 0;\n}\n\n.value {\n min-width: 0;\n}\n\n/* The edit button shows on the row under the pointer, and when it has focus. */\n.edit {\n flex-shrink: 0;\n opacity: 0;\n}\n\n:global(tr):hover .edit,\n.edit[data-focus-visible],\n.edit[data-pressed] {\n opacity: 1;\n}\n\n@media (hover: none) {\n .edit {\n opacity: 1;\n }\n}\n\n.control {\n display: flex;\n align-items: center;\n gap: var(--panneau-space-2);\n}\n\n.control > :first-child {\n flex: 1;\n}\n\n.conflict {\n display: flex;\n flex-direction: column;\n gap: var(--panneau-space-1);\n font-size: var(--panneau-font-size-sm);\n color: var(--panneau-color-text-muted);\n}\n\n.conflictActions {\n display: flex;\n flex-wrap: wrap;\n gap: var(--panneau-space-1);\n}\n"],"mappings":""}
@@ -0,0 +1,29 @@
1
+ import { type ReactNode } from 'react';
2
+ import type { Field, RuleFailure } from '@panneau/protocol';
3
+ import type { ListItem } from '../types.js';
4
+ export interface InlineCellProps {
5
+ item: ListItem;
6
+ /** The field the cell edits, of a type of `INLINE_TYPES`. */
7
+ field: Field;
8
+ /** The label of the item, for the name of the edit button. */
9
+ itemLabel: string;
10
+ /** The label of an item the backend gave back, for the toast that says it was saved. */
11
+ getItemLabel?: (item: ListItem) => string;
12
+ /** The content of the cell when it doesn't edit: the value, or the title's link. */
13
+ children: ReactNode;
14
+ /** Renders a value of the field, for the current value of a conflict. */
15
+ renderValue: (item: ListItem) => ReactNode;
16
+ /** Saves the value on an item (the current one after a conflict), with its version. */
17
+ onSave: (item: ListItem, value: unknown) => Promise<ListItem>;
18
+ /** Shows an item the backend gave back: saved, or changed by someone else. */
19
+ onItem: (item: ListItem) => void;
20
+ formatError: (failure: RuleFailure) => string;
21
+ }
22
+ /**
23
+ * A cell that edits its field in place (decision 0043): a checkbox for a boolean, otherwise the
24
+ * value with a button that turns it into the field's control. Enter or leaving the cell saves,
25
+ * Escape cancels; a select and a date save when one is picked. The value is checked by the
26
+ * field's portable rules, then saved alone; errors and conflicts show in the cell.
27
+ */
28
+ export declare function InlineCell({ item, field, itemLabel, getItemLabel, children, renderValue, onSave, onItem, formatError, }: InlineCellProps): import("react").JSX.Element;
29
+ //# sourceMappingURL=InlineCell.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InlineCell.d.ts","sourceRoot":"","sources":["../../src/inline/InlineCell.tsx"],"names":[],"mappings":"AACA,OAAO,EAGH,KAAK,SAAS,EAIjB,MAAM,OAAO,CAAC;AAQf,OAAO,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAK5D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAoBzC,MAAM,WAAW,eAAe;IAC5B,IAAI,EAAE,QAAQ,CAAC;IACf,6DAA6D;IAC7D,KAAK,EAAE,KAAK,CAAC;IACb,8DAA8D;IAC9D,SAAS,EAAE,MAAM,CAAC;IAClB,wFAAwF;IACxF,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,MAAM,CAAC;IAC1C,oFAAoF;IACpF,QAAQ,EAAE,SAAS,CAAC;IACpB,yEAAyE;IACzE,WAAW,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,SAAS,CAAC;IAC3C,uFAAuF;IACvF,MAAM,EAAE,CAAC,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC;IAC9D,8EAA8E;IAC9E,MAAM,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,IAAI,CAAC;IACjC,WAAW,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,MAAM,CAAC;CACjD;AAMD;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,EACvB,IAAI,EACJ,KAAK,EACL,SAAS,EACT,YAAY,EACZ,QAAQ,EACR,WAAW,EACX,MAAM,EACN,MAAM,EACN,WAAW,GACd,EAAE,eAAe,+BAyNjB"}