vastgrid 0.1.0 → 0.2.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 (312) hide show
  1. package/README.md +175 -13
  2. package/dist/canvas/geometry.d.ts +92 -0
  3. package/dist/canvas/geometry.d.ts.map +1 -0
  4. package/dist/canvas/geometry.js +197 -0
  5. package/dist/canvas/geometry.js.map +1 -0
  6. package/dist/canvas/grid-canvas.d.ts +161 -0
  7. package/dist/canvas/grid-canvas.d.ts.map +1 -0
  8. package/dist/canvas/grid-canvas.js +1146 -0
  9. package/dist/canvas/grid-canvas.js.map +1 -0
  10. package/dist/canvas/hooks.d.ts +61 -0
  11. package/dist/canvas/hooks.d.ts.map +1 -0
  12. package/dist/canvas/hooks.js +2 -0
  13. package/dist/canvas/hooks.js.map +1 -0
  14. package/dist/canvas/keys.d.ts +26 -0
  15. package/dist/canvas/keys.d.ts.map +1 -0
  16. package/dist/canvas/keys.js +133 -0
  17. package/dist/canvas/keys.js.map +1 -0
  18. package/dist/canvas/layout.d.ts +26 -0
  19. package/dist/canvas/layout.d.ts.map +1 -0
  20. package/dist/canvas/layout.js +73 -0
  21. package/dist/canvas/layout.js.map +1 -0
  22. package/dist/canvas/scroll.d.ts +31 -0
  23. package/dist/canvas/scroll.d.ts.map +1 -0
  24. package/dist/canvas/scroll.js +111 -0
  25. package/dist/canvas/scroll.js.map +1 -0
  26. package/dist/canvas/text.d.ts +23 -0
  27. package/dist/canvas/text.d.ts.map +1 -0
  28. package/dist/canvas/text.js +142 -0
  29. package/dist/canvas/text.js.map +1 -0
  30. package/dist/{theme.d.ts → canvas/theme.d.ts} +8 -0
  31. package/dist/canvas/theme.d.ts.map +1 -0
  32. package/dist/canvas/theme.js +62 -0
  33. package/dist/canvas/theme.js.map +1 -0
  34. package/dist/core/cache.d.ts +48 -0
  35. package/dist/core/cache.d.ts.map +1 -0
  36. package/dist/core/cache.js +222 -0
  37. package/dist/core/cache.js.map +1 -0
  38. package/dist/core/checked.d.ts +20 -0
  39. package/dist/core/checked.d.ts.map +1 -0
  40. package/dist/core/checked.js +61 -0
  41. package/dist/core/checked.js.map +1 -0
  42. package/dist/core/client.d.ts +33 -0
  43. package/dist/core/client.d.ts.map +1 -0
  44. package/dist/core/client.js +103 -0
  45. package/dist/core/client.js.map +1 -0
  46. package/dist/core/conditions.d.ts +48 -0
  47. package/dist/core/conditions.d.ts.map +1 -0
  48. package/dist/core/conditions.js +105 -0
  49. package/dist/core/conditions.js.map +1 -0
  50. package/dist/core/evaluate.d.ts +20 -0
  51. package/dist/core/evaluate.d.ts.map +1 -0
  52. package/dist/core/evaluate.js +210 -0
  53. package/dist/core/evaluate.js.map +1 -0
  54. package/dist/core/filters.d.ts +51 -0
  55. package/dist/core/filters.d.ts.map +1 -0
  56. package/dist/core/filters.js +303 -0
  57. package/dist/core/filters.js.map +1 -0
  58. package/dist/core/format.d.ts +14 -0
  59. package/dist/core/format.d.ts.map +1 -0
  60. package/dist/core/format.js +303 -0
  61. package/dist/core/format.js.map +1 -0
  62. package/dist/core/measures.d.ts +26 -0
  63. package/dist/core/measures.d.ts.map +1 -0
  64. package/dist/core/measures.js +105 -0
  65. package/dist/core/measures.js.map +1 -0
  66. package/dist/core/request-ids.d.ts +20 -0
  67. package/dist/core/request-ids.d.ts.map +1 -0
  68. package/dist/core/request-ids.js +55 -0
  69. package/dist/core/request-ids.js.map +1 -0
  70. package/dist/core/rows.d.ts +79 -0
  71. package/dist/core/rows.d.ts.map +1 -0
  72. package/dist/core/rows.js +173 -0
  73. package/dist/core/rows.js.map +1 -0
  74. package/dist/core/store.d.ts +233 -0
  75. package/dist/core/store.d.ts.map +1 -0
  76. package/dist/core/store.js +1162 -0
  77. package/dist/core/store.js.map +1 -0
  78. package/dist/core/totals.d.ts +24 -0
  79. package/dist/core/totals.d.ts.map +1 -0
  80. package/dist/core/totals.js +49 -0
  81. package/dist/core/totals.js.map +1 -0
  82. package/dist/core/trace.d.ts +7 -0
  83. package/dist/core/trace.d.ts.map +1 -0
  84. package/dist/core/trace.js +26 -0
  85. package/dist/core/trace.js.map +1 -0
  86. package/dist/core/transports.d.ts +50 -0
  87. package/dist/core/transports.d.ts.map +1 -0
  88. package/dist/core/transports.js +160 -0
  89. package/dist/core/transports.js.map +1 -0
  90. package/dist/core/types.d.ts +150 -0
  91. package/dist/core/types.d.ts.map +1 -0
  92. package/dist/core/types.js +45 -0
  93. package/dist/core/types.js.map +1 -0
  94. package/dist/core.d.ts +12 -0
  95. package/dist/core.d.ts.map +1 -0
  96. package/dist/core.js +11 -0
  97. package/dist/core.js.map +1 -0
  98. package/dist/index.d.ts +15 -6
  99. package/dist/index.d.ts.map +1 -1
  100. package/dist/index.js +13 -7
  101. package/dist/index.js.map +1 -1
  102. package/dist/react/accessible-rows.d.ts +13 -0
  103. package/dist/react/accessible-rows.d.ts.map +1 -0
  104. package/dist/react/accessible-rows.js +320 -0
  105. package/dist/react/accessible-rows.js.map +1 -0
  106. package/dist/react/cell-editor.d.ts +22 -0
  107. package/dist/react/cell-editor.d.ts.map +1 -0
  108. package/dist/react/cell-editor.js +431 -0
  109. package/dist/react/cell-editor.js.map +1 -0
  110. package/dist/react/cell-menu.d.ts +18 -0
  111. package/dist/react/cell-menu.d.ts.map +1 -0
  112. package/dist/react/cell-menu.js +299 -0
  113. package/dist/react/cell-menu.js.map +1 -0
  114. package/dist/react/column-menu.d.ts +16 -0
  115. package/dist/react/column-menu.d.ts.map +1 -0
  116. package/dist/react/column-menu.js +1311 -0
  117. package/dist/react/column-menu.js.map +1 -0
  118. package/dist/react/columns-menu.d.ts +7 -0
  119. package/dist/react/columns-menu.d.ts.map +1 -0
  120. package/dist/react/columns-menu.js +249 -0
  121. package/dist/react/columns-menu.js.map +1 -0
  122. package/dist/react/conditions-menu.d.ts +10 -0
  123. package/dist/react/conditions-menu.d.ts.map +1 -0
  124. package/dist/react/conditions-menu.js +795 -0
  125. package/dist/react/conditions-menu.js.map +1 -0
  126. package/dist/react/context.d.ts +29 -0
  127. package/dist/react/context.d.ts.map +1 -0
  128. package/dist/react/context.js +18 -0
  129. package/dist/react/context.js.map +1 -0
  130. package/dist/react/data-grid.d.ts +79 -0
  131. package/dist/react/data-grid.d.ts.map +1 -0
  132. package/dist/react/data-grid.js +653 -0
  133. package/dist/react/data-grid.js.map +1 -0
  134. package/dist/react/detail-panel.d.ts +22 -0
  135. package/dist/react/detail-panel.d.ts.map +1 -0
  136. package/dist/react/detail-panel.js +242 -0
  137. package/dist/react/detail-panel.js.map +1 -0
  138. package/dist/react/export-menu.d.ts +11 -0
  139. package/dist/react/export-menu.d.ts.map +1 -0
  140. package/dist/react/export-menu.js +304 -0
  141. package/dist/react/export-menu.js.map +1 -0
  142. package/dist/react/find-bar.d.ts +11 -0
  143. package/dist/react/find-bar.d.ts.map +1 -0
  144. package/dist/react/find-bar.js +303 -0
  145. package/dist/react/find-bar.js.map +1 -0
  146. package/dist/react/format-form.d.ts +12 -0
  147. package/dist/react/format-form.d.ts.map +1 -0
  148. package/dist/react/format-form.js +863 -0
  149. package/dist/react/format-form.js.map +1 -0
  150. package/dist/react/formula-menu.d.ts +6 -0
  151. package/dist/react/formula-menu.d.ts.map +1 -0
  152. package/dist/react/formula-menu.js +343 -0
  153. package/dist/react/formula-menu.js.map +1 -0
  154. package/dist/react/grid-body.d.ts +33 -0
  155. package/dist/react/grid-body.d.ts.map +1 -0
  156. package/dist/react/grid-body.js +1389 -0
  157. package/dist/react/grid-body.js.map +1 -0
  158. package/dist/react/group-menu.d.ts +7 -0
  159. package/dist/react/group-menu.d.ts.map +1 -0
  160. package/dist/react/group-menu.js +508 -0
  161. package/dist/react/group-menu.js.map +1 -0
  162. package/dist/react/hooks.d.ts +33 -0
  163. package/dist/react/hooks.d.ts.map +1 -0
  164. package/dist/react/hooks.js +161 -0
  165. package/dist/react/hooks.js.map +1 -0
  166. package/dist/react/messages.d.ts +180 -0
  167. package/dist/react/messages.d.ts.map +1 -0
  168. package/dist/react/messages.js +414 -0
  169. package/dist/react/messages.js.map +1 -0
  170. package/dist/react/save.d.ts +9 -0
  171. package/dist/react/save.d.ts.map +1 -0
  172. package/dist/react/save.js +102 -0
  173. package/dist/react/save.js.map +1 -0
  174. package/dist/react/static-rows.d.ts +9 -0
  175. package/dist/react/static-rows.d.ts.map +1 -0
  176. package/dist/react/static-rows.js +176 -0
  177. package/dist/react/static-rows.js.map +1 -0
  178. package/dist/react/status-bar.d.ts +12 -0
  179. package/dist/react/status-bar.d.ts.map +1 -0
  180. package/dist/react/status-bar.js +413 -0
  181. package/dist/react/status-bar.js.map +1 -0
  182. package/dist/react/toolbar-popover.d.ts +14 -0
  183. package/dist/react/toolbar-popover.d.ts.map +1 -0
  184. package/dist/react/toolbar-popover.js +143 -0
  185. package/dist/react/toolbar-popover.js.map +1 -0
  186. package/dist/react/toolbar.d.ts +13 -0
  187. package/dist/react/toolbar.d.ts.map +1 -0
  188. package/dist/react/toolbar.js +344 -0
  189. package/dist/react/toolbar.js.map +1 -0
  190. package/dist/server.d.ts +22 -0
  191. package/dist/server.d.ts.map +1 -0
  192. package/dist/server.js +45 -0
  193. package/dist/server.js.map +1 -0
  194. package/dist/styles.css +496 -316
  195. package/package.json +43 -18
  196. package/src/canvas/geometry.ts +197 -0
  197. package/src/canvas/grid-canvas.ts +1222 -0
  198. package/src/canvas/hooks.ts +61 -0
  199. package/src/canvas/keys.ts +96 -0
  200. package/src/canvas/layout.ts +77 -0
  201. package/src/canvas/scroll.ts +120 -0
  202. package/src/canvas/text.ts +155 -0
  203. package/src/{theme.ts → canvas/theme.ts} +14 -1
  204. package/src/core/cache.ts +247 -0
  205. package/src/core/checked.ts +64 -0
  206. package/src/core/client.ts +103 -0
  207. package/src/core/conditions.ts +89 -0
  208. package/src/core/evaluate.ts +221 -0
  209. package/src/core/filters.ts +268 -0
  210. package/src/core/format.ts +309 -0
  211. package/src/core/measures.ts +99 -0
  212. package/src/core/request-ids.ts +54 -0
  213. package/src/core/rows.ts +213 -0
  214. package/src/core/store.ts +1122 -0
  215. package/src/core/totals.ts +59 -0
  216. package/src/core/trace.ts +44 -0
  217. package/src/core/transports.ts +177 -0
  218. package/src/core/types.ts +168 -0
  219. package/src/core.ts +39 -0
  220. package/src/index.ts +24 -12
  221. package/src/react/accessible-rows.tsx +242 -0
  222. package/src/react/cell-editor.tsx +216 -0
  223. package/src/react/cell-menu.tsx +166 -0
  224. package/src/react/column-menu.tsx +619 -0
  225. package/src/react/columns-menu.tsx +116 -0
  226. package/src/react/conditions-menu.tsx +289 -0
  227. package/src/react/context.ts +33 -0
  228. package/src/react/data-grid.tsx +286 -0
  229. package/src/react/detail-panel.tsx +92 -0
  230. package/src/react/export-menu.tsx +112 -0
  231. package/src/react/find-bar.tsx +112 -0
  232. package/src/react/format-form.tsx +421 -0
  233. package/src/react/formula-menu.tsx +163 -0
  234. package/src/react/grid-body.tsx +744 -0
  235. package/src/react/group-menu.tsx +214 -0
  236. package/src/react/hooks.ts +104 -0
  237. package/src/react/messages.ts +556 -0
  238. package/src/react/save.ts +42 -0
  239. package/src/react/static-rows.tsx +59 -0
  240. package/src/react/status-bar.tsx +175 -0
  241. package/src/react/toolbar-popover.tsx +69 -0
  242. package/src/react/toolbar.tsx +152 -0
  243. package/src/server.ts +58 -0
  244. package/src/styles.css +496 -316
  245. package/dist/components/bars.d.ts +0 -14
  246. package/dist/components/bars.d.ts.map +0 -1
  247. package/dist/components/bars.js +0 -67
  248. package/dist/components/bars.js.map +0 -1
  249. package/dist/components/cell-inspector.d.ts +0 -11
  250. package/dist/components/cell-inspector.d.ts.map +0 -1
  251. package/dist/components/cell-inspector.js +0 -37
  252. package/dist/components/cell-inspector.js.map +0 -1
  253. package/dist/components/columns-panel.d.ts +0 -12
  254. package/dist/components/columns-panel.d.ts.map +0 -1
  255. package/dist/components/columns-panel.js +0 -11
  256. package/dist/components/columns-panel.js.map +0 -1
  257. package/dist/components/filter-panel.d.ts +0 -17
  258. package/dist/components/filter-panel.d.ts.map +0 -1
  259. package/dist/components/filter-panel.js +0 -165
  260. package/dist/components/filter-panel.js.map +0 -1
  261. package/dist/components/find-bar.d.ts +0 -9
  262. package/dist/components/find-bar.d.ts.map +0 -1
  263. package/dist/components/find-bar.js +0 -46
  264. package/dist/components/find-bar.js.map +0 -1
  265. package/dist/components/popover.d.ts +0 -38
  266. package/dist/components/popover.d.ts.map +0 -1
  267. package/dist/components/popover.js +0 -104
  268. package/dist/components/popover.js.map +0 -1
  269. package/dist/components/stats-panel.d.ts +0 -12
  270. package/dist/components/stats-panel.d.ts.map +0 -1
  271. package/dist/components/stats-panel.js +0 -40
  272. package/dist/components/stats-panel.js.map +0 -1
  273. package/dist/controller.d.ts +0 -218
  274. package/dist/controller.d.ts.map +0 -1
  275. package/dist/controller.js +0 -788
  276. package/dist/controller.js.map +0 -1
  277. package/dist/data-grid.d.ts +0 -51
  278. package/dist/data-grid.d.ts.map +0 -1
  279. package/dist/data-grid.js +0 -698
  280. package/dist/data-grid.js.map +0 -1
  281. package/dist/labels.d.ts +0 -9
  282. package/dist/labels.d.ts.map +0 -1
  283. package/dist/labels.js +0 -38
  284. package/dist/labels.js.map +0 -1
  285. package/dist/messages.d.ts +0 -99
  286. package/dist/messages.d.ts.map +0 -1
  287. package/dist/messages.js +0 -276
  288. package/dist/messages.js.map +0 -1
  289. package/dist/renderer.d.ts +0 -52
  290. package/dist/renderer.d.ts.map +0 -1
  291. package/dist/renderer.js +0 -522
  292. package/dist/renderer.js.map +0 -1
  293. package/dist/text.d.ts +0 -14
  294. package/dist/text.d.ts.map +0 -1
  295. package/dist/text.js +0 -63
  296. package/dist/text.js.map +0 -1
  297. package/dist/theme.d.ts.map +0 -1
  298. package/dist/theme.js +0 -54
  299. package/dist/theme.js.map +0 -1
  300. package/src/components/bars.tsx +0 -179
  301. package/src/components/cell-inspector.tsx +0 -70
  302. package/src/components/columns-panel.tsx +0 -59
  303. package/src/components/filter-panel.tsx +0 -290
  304. package/src/components/find-bar.tsx +0 -104
  305. package/src/components/popover.tsx +0 -194
  306. package/src/components/stats-panel.tsx +0 -153
  307. package/src/controller.ts +0 -887
  308. package/src/data-grid.tsx +0 -1029
  309. package/src/labels.ts +0 -46
  310. package/src/messages.ts +0 -390
  311. package/src/renderer.ts +0 -535
  312. package/src/text.ts +0 -55
package/src/labels.ts DELETED
@@ -1,46 +0,0 @@
1
- import { type CellValue, type ColumnSchema, type Filter, plainText, type ValueFormatter } from "vastgrid-core";
2
- import type { Messages } from "./messages.js";
3
-
4
- /** Formats counts with the locale's grouping. */
5
- export function countFormat(locale: string | undefined) {
6
- const format = new Intl.NumberFormat(locale);
7
- return (value: number) => format.format(value);
8
- }
9
-
10
- /** Formats summary numbers (sums, averages) with up to 6 fraction digits. */
11
- export function numberFormat(locale: string | undefined) {
12
- const format = new Intl.NumberFormat(locale, { maximumFractionDigits: 6 });
13
- return (value: number) => format.format(value);
14
- }
15
-
16
- function valueText(value: CellValue, schema: ColumnSchema | undefined, formatter: ValueFormatter, messages: Messages) {
17
- if (value === null || value === "") return messages.blank;
18
- return formatter.format(value, schema?.type ?? "string");
19
- }
20
-
21
- /** A short description of a filter, for chips ("price ≥ 100", "city: Tokyo +2"). */
22
- export function filterLabel(
23
- filter: Filter,
24
- schema: ColumnSchema | undefined,
25
- formatter: ValueFormatter,
26
- messages: Messages,
27
- ) {
28
- const name = schema?.name ?? `#${filter.column}`;
29
- switch (filter.type) {
30
- case "values": {
31
- const shown = filter.values.slice(0, 2).map((value) => valueText(value, schema, formatter, messages));
32
- const more = filter.values.length > 2 ? ` +${filter.values.length - 2}` : "";
33
- return `${name} ${filter.exclude ? "≠" : ":"} ${shown.join(", ")}${more}`;
34
- }
35
- case "compare": {
36
- const symbols = { eq: "=", ne: "≠", lt: "<", le: "≤", gt: ">", ge: "≥" } as const;
37
- return `${name} ${symbols[filter.op]} ${plainText(filter.value)}`;
38
- }
39
- case "between":
40
- return `${name}: ${filter.min === undefined ? "" : plainText(filter.min)}–${filter.max === undefined ? "" : plainText(filter.max)}`;
41
- case "text":
42
- return `${name} ${messages.operators[filter.op]} “${filter.value}”`;
43
- case "blank":
44
- return `${name}: ${filter.blank ? messages.operators.blank : messages.operators.notBlank}`;
45
- }
46
- }
package/src/messages.ts DELETED
@@ -1,390 +0,0 @@
1
- /** Every text the grid shows. Pass a partial object to `messages` to change some of them. */
2
- export interface Messages {
3
- gridLabel: string;
4
- loading: string;
5
- loadingRows: (loaded: string) => string;
6
- loadingProgress: (percent: string) => string;
7
- buildingView: string;
8
- noRows: string;
9
- error: string;
10
- retry: string;
11
- rows: (count: string) => string;
12
- rowsOf: (shown: string, total: string) => string;
13
- search: string;
14
- searchPlaceholder: string;
15
- clearSearch: string;
16
- clearFilters: string;
17
- removeFilter: (label: string) => string;
18
- columns: string;
19
- showAllColumns: string;
20
- sortAscending: string;
21
- sortDescending: string;
22
- addSortAscending: string;
23
- addSortDescending: string;
24
- clearSort: string;
25
- filter: string;
26
- filterBy: (column: string) => string;
27
- statistics: string;
28
- hideColumn: string;
29
- freezeUpTo: string;
30
- unfreeze: string;
31
- autoFit: string;
32
- copy: string;
33
- copyWithHeaders: string;
34
- copyAsMarkdown: string;
35
- copyColumnName: string;
36
- copied: (cells: string) => string;
37
- copyTooLarge: (limit: string) => string;
38
- copyFailed: string;
39
- copying: string;
40
- filterToValue: string;
41
- excludeValue: string;
42
- inspectCell: string;
43
- close: string;
44
- apply: string;
45
- clear: string;
46
- cancel: string;
47
- selectAll: string;
48
- blank: string;
49
- valuesTruncated: (shown: string) => string;
50
- valuesSearch: string;
51
- condition: string;
52
- conditionNone: string;
53
- operators: Record<
54
- | "eq"
55
- | "ne"
56
- | "lt"
57
- | "le"
58
- | "gt"
59
- | "ge"
60
- | "between"
61
- | "contains"
62
- | "notContains"
63
- | "startsWith"
64
- | "endsWith"
65
- | "equals"
66
- | "notEquals"
67
- | "blank"
68
- | "notBlank",
69
- string
70
- >;
71
- value: string;
72
- minimum: string;
73
- maximum: string;
74
- matchCase: string;
75
- find: string;
76
- findPlaceholder: string;
77
- findNext: string;
78
- findPrevious: string;
79
- notFound: string;
80
- searching: string;
81
- stats: {
82
- rows: string;
83
- nulls: string;
84
- distinct: string;
85
- approximate: string;
86
- min: string;
87
- max: string;
88
- mean: string;
89
- stddev: string;
90
- quartiles: string;
91
- length: string;
92
- histogram: string;
93
- top: string;
94
- };
95
- summary: {
96
- count: string;
97
- numericCount: string;
98
- sum: string;
99
- average: string;
100
- min: string;
101
- max: string;
102
- };
103
- types: Record<string, string>;
104
- sortedBy: (columns: string) => string;
105
- filtered: string;
106
- cell: (row: string, column: string) => string;
107
- originalRow: (row: string) => string;
108
- textTruncated: string;
109
- notes: Record<string, string>;
110
- export: string;
111
- }
112
-
113
- export const en: Messages = {
114
- gridLabel: "Data table",
115
- loading: "Loading…",
116
- loadingRows: (loaded) => `Loading… ${loaded} rows ready`,
117
- loadingProgress: (percent) => `Loading ${percent}`,
118
- buildingView: "Sorting and filtering…",
119
- noRows: "No rows",
120
- error: "The table could not be shown.",
121
- retry: "Retry",
122
- rows: (count) => `${count} rows`,
123
- rowsOf: (shown, total) => `${shown} of ${total} rows`,
124
- search: "Search",
125
- searchPlaceholder: "Search all columns",
126
- clearSearch: "Clear search",
127
- clearFilters: "Clear all",
128
- removeFilter: (label) => `Remove filter: ${label}`,
129
- columns: "Columns",
130
- showAllColumns: "Show all",
131
- sortAscending: "Sort ascending",
132
- sortDescending: "Sort descending",
133
- addSortAscending: "Then sort ascending",
134
- addSortDescending: "Then sort descending",
135
- clearSort: "Clear sort",
136
- filter: "Filter…",
137
- filterBy: (column) => `Filter ${column}`,
138
- statistics: "Column statistics",
139
- hideColumn: "Hide column",
140
- freezeUpTo: "Freeze up to this column",
141
- unfreeze: "Unfreeze columns",
142
- autoFit: "Fit width to content",
143
- copy: "Copy",
144
- copyWithHeaders: "Copy with headers",
145
- copyAsMarkdown: "Copy as Markdown",
146
- copyColumnName: "Copy column name",
147
- copied: (cells) => `Copied ${cells} cells`,
148
- copyTooLarge: (limit) => `Select at most ${limit} cells to copy.`,
149
- copyFailed: "Could not write to the clipboard.",
150
- copying: "Copying…",
151
- filterToValue: "Filter to this value",
152
- excludeValue: "Exclude this value",
153
- inspectCell: "Show full value",
154
- close: "Close",
155
- apply: "Apply",
156
- clear: "Clear",
157
- cancel: "Cancel",
158
- selectAll: "(Select all)",
159
- blank: "(Blank)",
160
- valuesTruncated: (shown) => `Showing the ${shown} most common values. Search to find others.`,
161
- valuesSearch: "Search values",
162
- condition: "Condition",
163
- conditionNone: "None",
164
- operators: {
165
- eq: "Equals",
166
- ne: "Does not equal",
167
- lt: "Less than",
168
- le: "Less than or equal to",
169
- gt: "Greater than",
170
- ge: "Greater than or equal to",
171
- between: "Between",
172
- contains: "Contains",
173
- notContains: "Does not contain",
174
- startsWith: "Begins with",
175
- endsWith: "Ends with",
176
- equals: "Equals",
177
- notEquals: "Does not equal",
178
- blank: "Is blank",
179
- notBlank: "Is not blank",
180
- },
181
- value: "Value",
182
- minimum: "From",
183
- maximum: "To",
184
- matchCase: "Match case",
185
- find: "Find",
186
- findPlaceholder: "Find in table",
187
- findNext: "Next match",
188
- findPrevious: "Previous match",
189
- notFound: "No matches",
190
- searching: "Searching…",
191
- stats: {
192
- rows: "Rows",
193
- nulls: "Blank",
194
- distinct: "Distinct",
195
- approximate: "approx.",
196
- min: "Min",
197
- max: "Max",
198
- mean: "Mean",
199
- stddev: "Std. dev.",
200
- quartiles: "Quartiles",
201
- length: "Length",
202
- histogram: "Distribution",
203
- top: "Most common",
204
- },
205
- summary: {
206
- count: "Count",
207
- numericCount: "Numbers",
208
- sum: "Sum",
209
- average: "Average",
210
- min: "Min",
211
- max: "Max",
212
- },
213
- types: {
214
- integer: "Integer",
215
- bigint: "Integer",
216
- float: "Number",
217
- decimal: "Decimal",
218
- boolean: "Boolean",
219
- string: "Text",
220
- date: "Date",
221
- time: "Time",
222
- timestamp: "Date and time",
223
- timestamptz: "Date and time (zone)",
224
- interval: "Interval",
225
- uuid: "UUID",
226
- binary: "Binary",
227
- list: "List",
228
- struct: "Struct",
229
- map: "Map",
230
- json: "JSON",
231
- unknown: "Other",
232
- },
233
- sortedBy: (columns) => `Sorted by ${columns}`,
234
- filtered: "Filtered",
235
- cell: (row, column) => `Row ${row}, ${column}`,
236
- originalRow: (row) => `Row ${row} in the file`,
237
- textTruncated: "Long text is cut in the table. Show the full value to read all of it.",
238
- notes: {
239
- all_varchar: "Some rows did not match the column types, so every column was read as text.",
240
- invalid_utf8_replaced: "Invalid characters were replaced with �.",
241
- "encoding:shift_jis": "Converted from Shift_JIS.",
242
- "encoding:euc-jp": "Converted from EUC-JP.",
243
- "encoding:latin-1": "Converted from Latin-1.",
244
- "encoding:utf-16": "Converted from UTF-16.",
245
- },
246
- export: "Export",
247
- };
248
-
249
- const number = (value: string) => value;
250
-
251
- export const ja: Messages = {
252
- gridLabel: "データの表",
253
- loading: "読み込んでいます…",
254
- loadingRows: (loaded) => `読み込んでいます… ${loaded} 行を表示できます`,
255
- loadingProgress: (percent) => `読み込み中 ${percent}`,
256
- buildingView: "並べ替え・絞り込みをしています…",
257
- noRows: "行がありません",
258
- error: "表を表示できませんでした。",
259
- retry: "再試行",
260
- rows: (count) => `${number(count)} 行`,
261
- rowsOf: (shown, total) => `${shown} / ${total} 行`,
262
- search: "検索",
263
- searchPlaceholder: "すべての列から絞り込む",
264
- clearSearch: "検索を消す",
265
- clearFilters: "すべて解除",
266
- removeFilter: (label) => `絞り込みを解除: ${label}`,
267
- columns: "列",
268
- showAllColumns: "すべて表示",
269
- sortAscending: "昇順に並べ替え",
270
- sortDescending: "降順に並べ替え",
271
- addSortAscending: "次の順で昇順に並べ替え",
272
- addSortDescending: "次の順で降順に並べ替え",
273
- clearSort: "並べ替えを解除",
274
- filter: "絞り込み…",
275
- filterBy: (column) => `${column} で絞り込み`,
276
- statistics: "列の統計",
277
- hideColumn: "列を隠す",
278
- freezeUpTo: "この列までを固定",
279
- unfreeze: "列の固定を解除",
280
- autoFit: "幅を内容に合わせる",
281
- copy: "コピー",
282
- copyWithHeaders: "見出しを含めてコピー",
283
- copyAsMarkdown: "Markdown の表としてコピー",
284
- copyColumnName: "列名をコピー",
285
- copied: (cells) => `${cells} 個のセルをコピーしました`,
286
- copyTooLarge: (limit) => `コピーできるのは ${limit} セルまでです。`,
287
- copyFailed: "クリップボードに書き込めませんでした。",
288
- copying: "コピーしています…",
289
- filterToValue: "この値で絞り込む",
290
- excludeValue: "この値を除く",
291
- inspectCell: "値の全体を表示",
292
- close: "閉じる",
293
- apply: "適用",
294
- clear: "解除",
295
- cancel: "キャンセル",
296
- selectAll: "(すべて選択)",
297
- blank: "(空白)",
298
- valuesTruncated: (shown) => `多い順に ${shown} 件を表示しています。ほかの値は検索してください。`,
299
- valuesSearch: "値を検索",
300
- condition: "条件",
301
- conditionNone: "なし",
302
- operators: {
303
- eq: "等しい",
304
- ne: "等しくない",
305
- lt: "より小さい",
306
- le: "以下",
307
- gt: "より大きい",
308
- ge: "以上",
309
- between: "範囲",
310
- contains: "を含む",
311
- notContains: "を含まない",
312
- startsWith: "で始まる",
313
- endsWith: "で終わる",
314
- equals: "と等しい",
315
- notEquals: "と等しくない",
316
- blank: "空白",
317
- notBlank: "空白以外",
318
- },
319
- value: "値",
320
- minimum: "下限",
321
- maximum: "上限",
322
- matchCase: "大文字と小文字を区別",
323
- find: "検索",
324
- findPlaceholder: "表の中を検索",
325
- findNext: "次を検索",
326
- findPrevious: "前を検索",
327
- notFound: "見つかりません",
328
- searching: "検索しています…",
329
- stats: {
330
- rows: "行数",
331
- nulls: "空白",
332
- distinct: "種類",
333
- approximate: "概数",
334
- min: "最小",
335
- max: "最大",
336
- mean: "平均",
337
- stddev: "標準偏差",
338
- quartiles: "四分位",
339
- length: "文字数",
340
- histogram: "分布",
341
- top: "多い値",
342
- },
343
- summary: {
344
- count: "データの個数",
345
- numericCount: "数値の個数",
346
- sum: "合計",
347
- average: "平均",
348
- min: "最小",
349
- max: "最大",
350
- },
351
- types: {
352
- integer: "整数",
353
- bigint: "整数",
354
- float: "数値",
355
- decimal: "小数",
356
- boolean: "真偽値",
357
- string: "文字列",
358
- date: "日付",
359
- time: "時刻",
360
- timestamp: "日時",
361
- timestamptz: "日時(時差)",
362
- interval: "期間",
363
- uuid: "UUID",
364
- binary: "バイナリ",
365
- list: "リスト",
366
- struct: "構造",
367
- map: "マップ",
368
- json: "JSON",
369
- unknown: "その他",
370
- },
371
- sortedBy: (columns) => `並べ替え: ${columns}`,
372
- filtered: "絞り込み中",
373
- cell: (row, column) => `${row} 行目、${column}`,
374
- originalRow: (row) => `ファイルの ${row} 行目`,
375
- textTruncated: "長い文字列は表の中では途中まで表示します。全体は「値の全体を表示」で読めます。",
376
- notes: {
377
- all_varchar: "列の型に合わない行があったため、すべての列を文字列として読み込みました。",
378
- invalid_utf8_replaced: "読めない文字を � に置き換えました。",
379
- "encoding:shift_jis": "Shift_JIS から変換して表示しています。",
380
- "encoding:euc-jp": "EUC-JP から変換して表示しています。",
381
- "encoding:latin-1": "Latin-1 から変換して表示しています。",
382
- "encoding:utf-16": "UTF-16 から変換して表示しています。",
383
- },
384
- export: "書き出し",
385
- };
386
-
387
- /** Picks the built-in messages for a locale ("ja…" → Japanese, otherwise English). */
388
- export function messagesFor(locale: string | undefined): Messages {
389
- return locale?.toLowerCase().startsWith("ja") ? ja : en;
390
- }