@operato/data-grist 10.29.81 → 10.29.84

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 (423) hide show
  1. package/dist/src/filters/filter-select-buttons.js +4 -1
  2. package/dist/src/filters/pill-choice.d.ts +4 -6
  3. package/dist/src/filters/pill-choice.js +9 -14
  4. package/dist/src/gutters/gutter-button.js +2 -4
  5. package/dist/stories/accumulator-format.stories.d.ts +41 -0
  6. package/dist/stories/accumulator-format.stories.js +241 -0
  7. package/dist/stories/append-position.stories.d.ts +8 -0
  8. package/dist/stories/append-position.stories.js +183 -0
  9. package/dist/stories/barcode-input-filter.stories.d.ts +33 -0
  10. package/dist/stories/barcode-input-filter.stories.js +185 -0
  11. package/dist/stories/bounded-select-filters.stories.d.ts +25 -0
  12. package/dist/stories/bounded-select-filters.stories.js +283 -0
  13. package/dist/stories/bounded-select-record.stories.d.ts +25 -0
  14. package/dist/stories/bounded-select-record.stories.js +286 -0
  15. package/dist/stories/click-event-custom.stories.d.ts +45 -0
  16. package/dist/stories/click-event-custom.stories.js +248 -0
  17. package/dist/stories/click-event.stories.d.ts +45 -0
  18. package/dist/stories/click-event.stories.js +243 -0
  19. package/dist/stories/creatable-only-column.stories.d.ts +29 -0
  20. package/dist/stories/creatable-only-column.stories.js +232 -0
  21. package/dist/stories/default-filters.stories.d.ts +26 -0
  22. package/dist/stories/default-filters.stories.js +219 -0
  23. package/dist/stories/dynamic-editable.stories.d.ts +25 -0
  24. package/dist/stories/dynamic-editable.stories.js +293 -0
  25. package/dist/stories/empty-sorters.stories.d.ts +25 -0
  26. package/dist/stories/empty-sorters.stories.js +162 -0
  27. package/dist/stories/explicit-fetch.stories.d.ts +25 -0
  28. package/dist/stories/explicit-fetch.stories.js +166 -0
  29. package/dist/stories/fixed-column.stories.d.ts +26 -0
  30. package/dist/stories/fixed-column.stories.js +383 -0
  31. package/dist/stories/grid-setting.stories.d.ts +47 -0
  32. package/dist/stories/grid-setting.stories.js +453 -0
  33. package/dist/stories/grist-modes.stories.d.ts +37 -0
  34. package/dist/stories/grist-modes.stories.js +416 -0
  35. package/dist/stories/group-header.stories.d.ts +26 -0
  36. package/dist/stories/group-header.stories.js +410 -0
  37. package/dist/stories/record-view.stories.d.ts +24 -0
  38. package/dist/stories/record-view.stories.js +125 -0
  39. package/dist/stories/secret.stories.d.ts +37 -0
  40. package/dist/stories/secret.stories.js +219 -0
  41. package/dist/stories/textarea.stories.d.ts +37 -0
  42. package/dist/stories/textarea.stories.js +229 -0
  43. package/dist/stories/tree-column-with-checkbox.stories.d.ts +26 -0
  44. package/dist/stories/tree-column-with-checkbox.stories.js +267 -0
  45. package/dist/stories/tree-column.stories.d.ts +26 -0
  46. package/dist/stories/tree-column.stories.js +266 -0
  47. package/package.json +28 -13
  48. package/CHANGELOG.md +0 -7721
  49. package/dist/src/accumulator/accumulator.js.map +0 -1
  50. package/dist/src/configure/column-builder.js.map +0 -1
  51. package/dist/src/configure/config-builder.js.map +0 -1
  52. package/dist/src/configure/filters-option-builder.js.map +0 -1
  53. package/dist/src/configure/imex-option-builder.js.map +0 -1
  54. package/dist/src/configure/list-option-builder.js.map +0 -1
  55. package/dist/src/configure/rows-option-builder.js.map +0 -1
  56. package/dist/src/configure/tree-option-builder.js.map +0 -1
  57. package/dist/src/configure/zero-config.js.map +0 -1
  58. package/dist/src/const.js.map +0 -1
  59. package/dist/src/data-card/data-card-field.js.map +0 -1
  60. package/dist/src/data-card/data-card-gutter-menu.js.map +0 -1
  61. package/dist/src/data-card/data-card-gutter.js.map +0 -1
  62. package/dist/src/data-card/data-card.js.map +0 -1
  63. package/dist/src/data-card/event-handlers/record-card-click-handler.js.map +0 -1
  64. package/dist/src/data-card/event-handlers/record-card-dblclick-handler.js.map +0 -1
  65. package/dist/src/data-card/ox-card-thumb.js.map +0 -1
  66. package/dist/src/data-card/record-card.js.map +0 -1
  67. package/dist/src/data-consumer.js.map +0 -1
  68. package/dist/src/data-grid/data-grid-accum-field.js.map +0 -1
  69. package/dist/src/data-grid/data-grid-body-style.js.map +0 -1
  70. package/dist/src/data-grid/data-grid-body.js.map +0 -1
  71. package/dist/src/data-grid/data-grid-field.js.map +0 -1
  72. package/dist/src/data-grid/data-grid-footer.js.map +0 -1
  73. package/dist/src/data-grid/data-grid-header.js.map +0 -1
  74. package/dist/src/data-grid/data-grid.js.map +0 -1
  75. package/dist/src/data-grid/event-handlers/data-grid-body-click-handler.js.map +0 -1
  76. package/dist/src/data-grid/event-handlers/data-grid-body-contextmenu-handler.js.map +0 -1
  77. package/dist/src/data-grid/event-handlers/data-grid-body-dblclick-handler.js.map +0 -1
  78. package/dist/src/data-grid/event-handlers/data-grid-body-focus-change-handler.js.map +0 -1
  79. package/dist/src/data-grid/event-handlers/data-grid-body-keydown-handler.js.map +0 -1
  80. package/dist/src/data-grist.js.map +0 -1
  81. package/dist/src/data-list/data-list-field.js.map +0 -1
  82. package/dist/src/data-list/data-list-gutter.js.map +0 -1
  83. package/dist/src/data-list/data-list.js.map +0 -1
  84. package/dist/src/data-list/event-handlers/record-partial-click-handler.js.map +0 -1
  85. package/dist/src/data-list/event-handlers/record-partial-dblclick-handler.js.map +0 -1
  86. package/dist/src/data-list/event-handlers/record-partial-long-press-handler.js.map +0 -1
  87. package/dist/src/data-list/record-partial.js.map +0 -1
  88. package/dist/src/data-manipulator.js.map +0 -1
  89. package/dist/src/data-provider.js.map +0 -1
  90. package/dist/src/data-report/data-report-body-style.js.map +0 -1
  91. package/dist/src/data-report/data-report-body.js.map +0 -1
  92. package/dist/src/data-report/data-report-component.js.map +0 -1
  93. package/dist/src/data-report/data-report-field.js.map +0 -1
  94. package/dist/src/data-report/data-report-header.js.map +0 -1
  95. package/dist/src/data-report/event-handlers/data-report-body-click-handler.js.map +0 -1
  96. package/dist/src/data-report/event-handlers/data-report-body-dblclick-handler.js.map +0 -1
  97. package/dist/src/data-report/event-handlers/data-report-body-keydown-handler.js.map +0 -1
  98. package/dist/src/data-report.js.map +0 -1
  99. package/dist/src/edit-rebase.js.map +0 -1
  100. package/dist/src/editors/index.js.map +0 -1
  101. package/dist/src/editors/ox-grist-editor-checkbox.js.map +0 -1
  102. package/dist/src/editors/ox-grist-editor-color.js.map +0 -1
  103. package/dist/src/editors/ox-grist-editor-date.js.map +0 -1
  104. package/dist/src/editors/ox-grist-editor-datetime.js.map +0 -1
  105. package/dist/src/editors/ox-grist-editor-email.js.map +0 -1
  106. package/dist/src/editors/ox-grist-editor-file.js.map +0 -1
  107. package/dist/src/editors/ox-grist-editor-image.js.map +0 -1
  108. package/dist/src/editors/ox-grist-editor-json5.js.map +0 -1
  109. package/dist/src/editors/ox-grist-editor-month.js.map +0 -1
  110. package/dist/src/editors/ox-grist-editor-multiple-select.js.map +0 -1
  111. package/dist/src/editors/ox-grist-editor-number.js.map +0 -1
  112. package/dist/src/editors/ox-grist-editor-password.js.map +0 -1
  113. package/dist/src/editors/ox-grist-editor-secret.js.map +0 -1
  114. package/dist/src/editors/ox-grist-editor-select.js.map +0 -1
  115. package/dist/src/editors/ox-grist-editor-tel.js.map +0 -1
  116. package/dist/src/editors/ox-grist-editor-text-select.js.map +0 -1
  117. package/dist/src/editors/ox-grist-editor-text.js.map +0 -1
  118. package/dist/src/editors/ox-grist-editor-textarea.js.map +0 -1
  119. package/dist/src/editors/ox-grist-editor-time.js.map +0 -1
  120. package/dist/src/editors/ox-grist-editor-timezone.js.map +0 -1
  121. package/dist/src/editors/ox-grist-editor-tree.js.map +0 -1
  122. package/dist/src/editors/ox-grist-editor-varname.js.map +0 -1
  123. package/dist/src/editors/ox-grist-editor-week.js.map +0 -1
  124. package/dist/src/editors/ox-grist-editor.js.map +0 -1
  125. package/dist/src/editors/ox-input-tree.js.map +0 -1
  126. package/dist/src/editors/ox-popup-code-input.js.map +0 -1
  127. package/dist/src/editors/registry.js.map +0 -1
  128. package/dist/src/empty-note-render.js.map +0 -1
  129. package/dist/src/empty-note.js.map +0 -1
  130. package/dist/src/filters/filter-checkbox.js.map +0 -1
  131. package/dist/src/filters/filter-input-barcode.js.map +0 -1
  132. package/dist/src/filters/filter-input.js.map +0 -1
  133. package/dist/src/filters/filter-ownership.js.map +0 -1
  134. package/dist/src/filters/filter-range-date.js.map +0 -1
  135. package/dist/src/filters/filter-range-number.js.map +0 -1
  136. package/dist/src/filters/filter-select-buttons.js.map +0 -1
  137. package/dist/src/filters/filter-select.js.map +0 -1
  138. package/dist/src/filters/filter-styles.js.map +0 -1
  139. package/dist/src/filters/filters-form.js.map +0 -1
  140. package/dist/src/filters/index.js.map +0 -1
  141. package/dist/src/filters/pill-choice.js.map +0 -1
  142. package/dist/src/filters/registry.js.map +0 -1
  143. package/dist/src/formatters/date-formatter.js.map +0 -1
  144. package/dist/src/formatters/index.js.map +0 -1
  145. package/dist/src/formatters/number-formatter.js.map +0 -1
  146. package/dist/src/formatters/registry.js.map +0 -1
  147. package/dist/src/formatters/text-formatter.js.map +0 -1
  148. package/dist/src/group-heading.js.map +0 -1
  149. package/dist/src/gutters/gutter-button.js.map +0 -1
  150. package/dist/src/gutters/gutter-dirty.js.map +0 -1
  151. package/dist/src/gutters/gutter-row-selector.js.map +0 -1
  152. package/dist/src/gutters/gutter-sequence.js.map +0 -1
  153. package/dist/src/gutters/index.js.map +0 -1
  154. package/dist/src/gutters/registry.js.map +0 -1
  155. package/dist/src/handlers/contextmenu-tree-mutation.js.map +0 -1
  156. package/dist/src/handlers/index.js.map +0 -1
  157. package/dist/src/handlers/move-down.js.map +0 -1
  158. package/dist/src/handlers/move-up.js.map +0 -1
  159. package/dist/src/handlers/record-copy.js.map +0 -1
  160. package/dist/src/handlers/record-delete.js.map +0 -1
  161. package/dist/src/handlers/record-view-handler.js.map +0 -1
  162. package/dist/src/handlers/registry.js.map +0 -1
  163. package/dist/src/handlers/select-row-toggle.js.map +0 -1
  164. package/dist/src/handlers/select-row.js.map +0 -1
  165. package/dist/src/index.js.map +0 -1
  166. package/dist/src/personalizer/index.js.map +0 -1
  167. package/dist/src/personalizer/ox-grist-filter-personalizer.js.map +0 -1
  168. package/dist/src/personalizer/ox-grist-personalizer.js.map +0 -1
  169. package/dist/src/personalizer/personalizer-chrome.js.map +0 -1
  170. package/dist/src/record-view/event-handlers/record-view-body-click-handler.js.map +0 -1
  171. package/dist/src/record-view/event-handlers/record-view-body-keydown-handler.js.map +0 -1
  172. package/dist/src/record-view/index.js.map +0 -1
  173. package/dist/src/record-view/ox-record-creator.js.map +0 -1
  174. package/dist/src/record-view/record-view-body.js.map +0 -1
  175. package/dist/src/record-view/record-view-handler.js.map +0 -1
  176. package/dist/src/record-view/record-view.js.map +0 -1
  177. package/dist/src/renderers/index.js.map +0 -1
  178. package/dist/src/renderers/ox-grist-renderer-boolean.js.map +0 -1
  179. package/dist/src/renderers/ox-grist-renderer-color.js.map +0 -1
  180. package/dist/src/renderers/ox-grist-renderer-date.js.map +0 -1
  181. package/dist/src/renderers/ox-grist-renderer-file.js.map +0 -1
  182. package/dist/src/renderers/ox-grist-renderer-image.js.map +0 -1
  183. package/dist/src/renderers/ox-grist-renderer-json5.js.map +0 -1
  184. package/dist/src/renderers/ox-grist-renderer-link.js.map +0 -1
  185. package/dist/src/renderers/ox-grist-renderer-password.js.map +0 -1
  186. package/dist/src/renderers/ox-grist-renderer-progress.js.map +0 -1
  187. package/dist/src/renderers/ox-grist-renderer-secret.js.map +0 -1
  188. package/dist/src/renderers/ox-grist-renderer-select.js.map +0 -1
  189. package/dist/src/renderers/ox-grist-renderer-sparkline.js.map +0 -1
  190. package/dist/src/renderers/ox-grist-renderer-text-select.js.map +0 -1
  191. package/dist/src/renderers/ox-grist-renderer-text.js.map +0 -1
  192. package/dist/src/renderers/ox-grist-renderer-textarea.js.map +0 -1
  193. package/dist/src/renderers/ox-grist-renderer-tree.js.map +0 -1
  194. package/dist/src/renderers/ox-grist-renderer.js.map +0 -1
  195. package/dist/src/renderers/registry.js.map +0 -1
  196. package/dist/src/sorters/sorters-control.js.map +0 -1
  197. package/dist/src/types.js.map +0 -1
  198. package/dist/src/utils/column-text.js.map +0 -1
  199. package/dist/src/utils/field-value.js.map +0 -1
  200. package/dist/src/utils/index.js.map +0 -1
  201. package/dist/src/utils/list-param.js.map +0 -1
  202. package/dist/src/utils/select-range.js.map +0 -1
  203. package/dist/src/utils/supports-passive.js.map +0 -1
  204. package/dist/test/accessible-name.test.d.ts +0 -2
  205. package/dist/test/accessible-name.test.js +0 -324
  206. package/dist/test/accessible-name.test.js.map +0 -1
  207. package/dist/test/accumulator-labels.test.d.ts +0 -1
  208. package/dist/test/accumulator-labels.test.js +0 -32
  209. package/dist/test/accumulator-labels.test.js.map +0 -1
  210. package/dist/test/address-intents.test.d.ts +0 -1
  211. package/dist/test/address-intents.test.js +0 -201
  212. package/dist/test/address-intents.test.js.map +0 -1
  213. package/dist/test/card-selector.test.d.ts +0 -1
  214. package/dist/test/card-selector.test.js +0 -71
  215. package/dist/test/card-selector.test.js.map +0 -1
  216. package/dist/test/card-thumb.test.d.ts +0 -1
  217. package/dist/test/card-thumb.test.js +0 -44
  218. package/dist/test/card-thumb.test.js.map +0 -1
  219. package/dist/test/card-totals-narrow.test.d.ts +0 -1
  220. package/dist/test/card-totals-narrow.test.js +0 -103
  221. package/dist/test/card-totals-narrow.test.js.map +0 -1
  222. package/dist/test/cell-button-row-height.test.d.ts +0 -1
  223. package/dist/test/cell-button-row-height.test.js +0 -53
  224. package/dist/test/cell-button-row-height.test.js.map +0 -1
  225. package/dist/test/column-resize.test.d.ts +0 -1
  226. package/dist/test/column-resize.test.js +0 -153
  227. package/dist/test/column-resize.test.js.map +0 -1
  228. package/dist/test/control-heights.test.d.ts +0 -1
  229. package/dist/test/control-heights.test.js +0 -25
  230. package/dist/test/control-heights.test.js.map +0 -1
  231. package/dist/test/count-handler.test.d.ts +0 -1
  232. package/dist/test/count-handler.test.js +0 -56
  233. package/dist/test/count-handler.test.js.map +0 -1
  234. package/dist/test/create-paste-policy.test.d.ts +0 -1
  235. package/dist/test/create-paste-policy.test.js +0 -159
  236. package/dist/test/create-paste-policy.test.js.map +0 -1
  237. package/dist/test/data-integrity.test.d.ts +0 -1
  238. package/dist/test/data-integrity.test.js +0 -145
  239. package/dist/test/data-integrity.test.js.map +0 -1
  240. package/dist/test/date-fields.test.d.ts +0 -2
  241. package/dist/test/date-fields.test.js +0 -138
  242. package/dist/test/date-fields.test.js.map +0 -1
  243. package/dist/test/destructive-actions.test.d.ts +0 -11
  244. package/dist/test/destructive-actions.test.js +0 -147
  245. package/dist/test/destructive-actions.test.js.map +0 -1
  246. package/dist/test/edit-lifecycle.test.d.ts +0 -2
  247. package/dist/test/edit-lifecycle.test.js +0 -270
  248. package/dist/test/edit-lifecycle.test.js.map +0 -1
  249. package/dist/test/edit-rebase.test.d.ts +0 -1
  250. package/dist/test/edit-rebase.test.js +0 -185
  251. package/dist/test/edit-rebase.test.js.map +0 -1
  252. package/dist/test/editor-commit.test.d.ts +0 -2
  253. package/dist/test/editor-commit.test.js +0 -68
  254. package/dist/test/editor-commit.test.js.map +0 -1
  255. package/dist/test/fetch-failure-state.test.d.ts +0 -1
  256. package/dist/test/fetch-failure-state.test.js +0 -129
  257. package/dist/test/fetch-failure-state.test.js.map +0 -1
  258. package/dist/test/field-contains-content.test.d.ts +0 -1
  259. package/dist/test/field-contains-content.test.js +0 -101
  260. package/dist/test/field-contains-content.test.js.map +0 -1
  261. package/dist/test/field-hint.test.d.ts +0 -2
  262. package/dist/test/field-hint.test.js +0 -54
  263. package/dist/test/field-hint.test.js.map +0 -1
  264. package/dist/test/filter-labels.test.d.ts +0 -2
  265. package/dist/test/filter-labels.test.js +0 -140
  266. package/dist/test/filter-labels.test.js.map +0 -1
  267. package/dist/test/filter-ownership.test.d.ts +0 -1
  268. package/dist/test/filter-ownership.test.js +0 -83
  269. package/dist/test/filter-ownership.test.js.map +0 -1
  270. package/dist/test/filter-select-buttons-count.test.d.ts +0 -1
  271. package/dist/test/filter-select-buttons-count.test.js +0 -36
  272. package/dist/test/filter-select-buttons-count.test.js.map +0 -1
  273. package/dist/test/filter-typing.test.d.ts +0 -2
  274. package/dist/test/filter-typing.test.js +0 -66
  275. package/dist/test/filter-typing.test.js.map +0 -1
  276. package/dist/test/filters-phone-width.test.d.ts +0 -1
  277. package/dist/test/filters-phone-width.test.js +0 -33
  278. package/dist/test/filters-phone-width.test.js.map +0 -1
  279. package/dist/test/filters-phone-wrap.test.d.ts +0 -1
  280. package/dist/test/filters-phone-wrap.test.js +0 -17
  281. package/dist/test/filters-phone-wrap.test.js.map +0 -1
  282. package/dist/test/filters-pills.test.d.ts +0 -2
  283. package/dist/test/filters-pills.test.js +0 -149
  284. package/dist/test/filters-pills.test.js.map +0 -1
  285. package/dist/test/first-click-stays.test.d.ts +0 -1
  286. package/dist/test/first-click-stays.test.js +0 -77
  287. package/dist/test/first-click-stays.test.js.map +0 -1
  288. package/dist/test/fixed-column-opaque.test.d.ts +0 -1
  289. package/dist/test/fixed-column-opaque.test.js +0 -134
  290. package/dist/test/fixed-column-opaque.test.js.map +0 -1
  291. package/dist/test/flexible-columns.test.d.ts +0 -1
  292. package/dist/test/flexible-columns.test.js +0 -134
  293. package/dist/test/flexible-columns.test.js.map +0 -1
  294. package/dist/test/grid-single-scroller.test.d.ts +0 -1
  295. package/dist/test/grid-single-scroller.test.js +0 -107
  296. package/dist/test/grid-single-scroller.test.js.map +0 -1
  297. package/dist/test/group-heading.test.d.ts +0 -1
  298. package/dist/test/group-heading.test.js +0 -208
  299. package/dist/test/group-heading.test.js.map +0 -1
  300. package/dist/test/latest-fetch-wins.test.d.ts +0 -1
  301. package/dist/test/latest-fetch-wins.test.js +0 -91
  302. package/dist/test/latest-fetch-wins.test.js.map +0 -1
  303. package/dist/test/list-defaults.test.d.ts +0 -2
  304. package/dist/test/list-defaults.test.js +0 -146
  305. package/dist/test/list-defaults.test.js.map +0 -1
  306. package/dist/test/list-records.test.d.ts +0 -1
  307. package/dist/test/list-records.test.js +0 -46
  308. package/dist/test/list-records.test.js.map +0 -1
  309. package/dist/test/office-density.test.d.ts +0 -1
  310. package/dist/test/office-density.test.js +0 -52
  311. package/dist/test/office-density.test.js.map +0 -1
  312. package/dist/test/page-errors.d.ts +0 -1
  313. package/dist/test/page-errors.js +0 -44
  314. package/dist/test/page-errors.js.map +0 -1
  315. package/dist/test/paste-integrity.test.d.ts +0 -1
  316. package/dist/test/paste-integrity.test.js +0 -163
  317. package/dist/test/paste-integrity.test.js.map +0 -1
  318. package/dist/test/record-card-height.test.d.ts +0 -1
  319. package/dist/test/record-card-height.test.js +0 -15
  320. package/dist/test/record-card-height.test.js.map +0 -1
  321. package/dist/test/record-view-popup-editor.test.d.ts +0 -1
  322. package/dist/test/record-view-popup-editor.test.js +0 -71
  323. package/dist/test/record-view-popup-editor.test.js.map +0 -1
  324. package/dist/test/renderer-date-calendar-day.test.d.ts +0 -1
  325. package/dist/test/renderer-date-calendar-day.test.js +0 -48
  326. package/dist/test/renderer-date-calendar-day.test.js.map +0 -1
  327. package/dist/test/request-generation.test.d.ts +0 -1
  328. package/dist/test/request-generation.test.js +0 -153
  329. package/dist/test/request-generation.test.js.map +0 -1
  330. package/dist/test/resubmit.test.d.ts +0 -1
  331. package/dist/test/resubmit.test.js +0 -83
  332. package/dist/test/resubmit.test.js.map +0 -1
  333. package/dist/test/row-hover-visible.test.d.ts +0 -1
  334. package/dist/test/row-hover-visible.test.js +0 -139
  335. package/dist/test/row-hover-visible.test.js.map +0 -1
  336. package/dist/test/search-term.test.d.ts +0 -1
  337. package/dist/test/search-term.test.js +0 -108
  338. package/dist/test/search-term.test.js.map +0 -1
  339. package/dist/test/searchable-select.test.d.ts +0 -1
  340. package/dist/test/searchable-select.test.js +0 -65
  341. package/dist/test/searchable-select.test.js.map +0 -1
  342. package/dist/test/select-empty-value.test.d.ts +0 -1
  343. package/dist/test/select-empty-value.test.js +0 -61
  344. package/dist/test/select-empty-value.test.js.map +0 -1
  345. package/dist/test/shift-range-select.test.d.ts +0 -1
  346. package/dist/test/shift-range-select.test.js +0 -100
  347. package/dist/test/shift-range-select.test.js.map +0 -1
  348. package/dist/test/sparkline-renderer.test.d.ts +0 -1
  349. package/dist/test/sparkline-renderer.test.js +0 -36
  350. package/dist/test/sparkline-renderer.test.js.map +0 -1
  351. package/dist/test/wheel-one-scroller.test.d.ts +0 -2
  352. package/dist/test/wheel-one-scroller.test.js +0 -275
  353. package/dist/test/wheel-one-scroller.test.js.map +0 -1
  354. package/dist/tsconfig.tsbuildinfo +0 -1
  355. package/docs/USER_GUIDE.md +0 -144
  356. package/docs/configuration/README.md +0 -68
  357. package/docs/configuration/columns.md +0 -391
  358. package/docs/configuration/editors.md +0 -53
  359. package/docs/configuration/events.md +0 -44
  360. package/docs/configuration/i18n.md +0 -40
  361. package/docs/configuration/options.md +0 -100
  362. package/docs/configuration/theme.md +0 -39
  363. package/docs/default-value/default-value.md +0 -97
  364. package/docs/default-value/value-generator/date-generator.md +0 -69
  365. package/docs/default-value/value-generator/hour-time-generator.md +0 -76
  366. package/docs/default-value/value-generator/minute-time-generator.md +0 -76
  367. package/docs/default-value/value-generator/month-date-generator.md +0 -45
  368. package/docs/default-value/value-generator/now-generator.md +0 -68
  369. package/docs/default-value/value-generator/time-generator.md +0 -71
  370. package/docs/default-value/value-generator/today-generator.md +0 -68
  371. package/docs/default-value/value-generator/week-date-generator.md +0 -74
  372. package/docs/default-value/value-generator/year-date-generator.md +0 -74
  373. package/docs/gutter/gutter.md +0 -7
  374. package/test/accessible-name.test.ts +0 -408
  375. package/test/accumulator-labels.test.ts +0 -36
  376. package/test/address-intents.test.ts +0 -202
  377. package/test/card-selector.test.ts +0 -82
  378. package/test/card-thumb.test.ts +0 -51
  379. package/test/card-totals-narrow.test.ts +0 -128
  380. package/test/cell-button-row-height.test.ts +0 -63
  381. package/test/column-resize.test.ts +0 -206
  382. package/test/control-heights.test.ts +0 -31
  383. package/test/count-handler.test.ts +0 -61
  384. package/test/create-paste-policy.test.ts +0 -177
  385. package/test/data-integrity.test.ts +0 -150
  386. package/test/date-fields.test.ts +0 -163
  387. package/test/destructive-actions.test.ts +0 -137
  388. package/test/edit-lifecycle.test.ts +0 -302
  389. package/test/edit-rebase.test.ts +0 -220
  390. package/test/editor-commit.test.ts +0 -103
  391. package/test/fetch-failure-state.test.ts +0 -156
  392. package/test/field-contains-content.test.ts +0 -125
  393. package/test/field-hint.test.ts +0 -60
  394. package/test/filter-labels.test.ts +0 -153
  395. package/test/filter-ownership.test.ts +0 -104
  396. package/test/filter-select-buttons-count.test.ts +0 -38
  397. package/test/filter-typing.test.ts +0 -77
  398. package/test/filters-phone-width.test.ts +0 -35
  399. package/test/filters-phone-wrap.test.ts +0 -22
  400. package/test/filters-pills.test.ts +0 -162
  401. package/test/first-click-stays.test.ts +0 -101
  402. package/test/fixed-column-opaque.test.ts +0 -183
  403. package/test/flexible-columns.test.ts +0 -181
  404. package/test/grid-single-scroller.test.ts +0 -150
  405. package/test/group-heading.test.ts +0 -244
  406. package/test/latest-fetch-wins.test.ts +0 -114
  407. package/test/list-defaults.test.ts +0 -164
  408. package/test/list-records.test.ts +0 -58
  409. package/test/office-density.test.ts +0 -57
  410. package/test/page-errors.ts +0 -43
  411. package/test/paste-integrity.test.ts +0 -168
  412. package/test/record-card-height.test.ts +0 -19
  413. package/test/record-view-popup-editor.test.ts +0 -84
  414. package/test/renderer-date-calendar-day.test.ts +0 -55
  415. package/test/request-generation.test.ts +0 -163
  416. package/test/resubmit.test.ts +0 -96
  417. package/test/row-hover-visible.test.ts +0 -180
  418. package/test/search-term.test.ts +0 -156
  419. package/test/searchable-select.test.ts +0 -77
  420. package/test/select-empty-value.test.ts +0 -71
  421. package/test/shift-range-select.test.ts +0 -112
  422. package/test/sparkline-renderer.test.ts +0 -40
  423. package/test/wheel-one-scroller.test.ts +0 -359
@@ -1,46 +0,0 @@
1
- /* Elements are compared by presence, not by value: a failing element comparison makes chai render the DOM and hang the runner. */
2
- import { expect, fixture } from '@open-wc/testing';
3
- import { html } from 'lit';
4
- import '../src/data-grist.js';
5
- import { failOnPageErrors } from './page-errors.js';
6
- /*
7
- * A list or card shows the records of its data, whenever its config arrives. The grist hands the data over at once
8
- * and the compiled config a render later - and a personal config loads later still - so a list that emptied itself
9
- * on a config change showed nothing until the next fetch (2026-10-26).
10
- */
11
- const records = [
12
- { id: '1', title: 'one' },
13
- { id: '2', title: 'two' }
14
- ];
15
- const config = (header) => ({
16
- columns: [{ type: 'string', name: 'title', header, record: { editable: true } }],
17
- rows: { appendable: false },
18
- list: { fields: ['title'] }
19
- });
20
- /* `updateComplete` resolves false while an update set another one going. */
21
- const idle = async (el) => {
22
- while (!((await el.updateComplete) && (await el.grist.updateComplete)))
23
- ;
24
- };
25
- for (const [mode, tag] of [
26
- ['LIST', 'ox-record-partial'],
27
- ['CARD', 'ox-record-card']
28
- ]) {
29
- describe(`a ${mode} and its config`, () => {
30
- failOnPageErrors();
31
- const shown = (el) => Array.from(el.grist.renderRoot.querySelectorAll(tag)).map(item => item.record.title);
32
- it('shows the records it was given with its config', async () => {
33
- const el = await fixture(html `<ox-grist style="height:300px" .mode=${mode} .config=${config('title')} .data=${{ records }}></ox-grist>`);
34
- await idle(el);
35
- expect(shown(el)).to.eql(['one', 'two']);
36
- });
37
- it('keeps its records when the config changes after them', async () => {
38
- const el = await fixture(html `<ox-grist style="height:300px" .mode=${mode} .config=${config('title')} .data=${{ records }}></ox-grist>`);
39
- await idle(el);
40
- el.config = config('renamed');
41
- await idle(el);
42
- expect(shown(el)).to.eql(['one', 'two']);
43
- });
44
- });
45
- }
46
- //# sourceMappingURL=list-records.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"list-records.test.js","sourceRoot":"","sources":["../../test/list-records.test.ts"],"names":[],"mappings":"AAAA,kIAAkI;AAClI,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AAClD,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAE1B,OAAO,sBAAsB,CAAA;AAE7B,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBA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,EAAE,KAAK,IAAI,EAAE;YAC9D,MAAM,EAAE,GAAG,MAAM,OAAO,CACtB,IAAI,CAAA,wCAAwC,IAAI,YAAY,MAAM,CAAC,OAAO,CAAC,UAAU,EAAE,OAAO,EAAE,cAAc,CAC/G,CAAA;YACD,MAAM,IAAI,CAAC,EAAE,CAAC,CAAA;YACd,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,CAAA;QAC1C,CAAC,CAAC,CAAA;QAEF,EAAE,CAAC,sDAAsD,EAAE,KAAK,IAAI,EAAE;YACpE,MAAM,EAAE,GAAG,MAAM,OAAO,CACtB,IAAI,CAAA,wCAAwC,IAAI,YAAY,MAAM,CAAC,OAAO,CAAC,UAAU,EAAE,OAAO,EAAE,cAAc,CAC/G,CAAA;YACD,MAAM,IAAI,CAAC,EAAE,CAAC,CAAA;YACd,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC,CAAA;YAC7B,MAAM,IAAI,CAAC,EAAE,CAAC,CAAA;YACd,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,CAAA;QAC1C,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC","sourcesContent":["/* Elements are compared by presence, not by value: a failing element comparison makes chai render the DOM and hang the runner. */\nimport { expect, fixture } from '@open-wc/testing'\nimport { html } from 'lit'\n\nimport '../src/data-grist.js'\nimport { DataGrist } from '../src/data-grist.js'\nimport { failOnPageErrors } from './page-errors.js'\n\n/*\n * A list or card shows the records of its data, whenever its config arrives. The grist hands the data over at once\n * and the compiled config a render later - and a personal config loads later still - so a list that emptied itself\n * on a config change showed nothing until the next fetch (2026-10-26).\n */\n\nconst records = [\n { id: '1', title: 'one' },\n { id: '2', title: 'two' }\n]\nconst config = (header: string) => ({\n columns: [{ type: 'string', name: 'title', header, record: { editable: true } }],\n rows: { appendable: false },\n list: { fields: ['title'] }\n})\n\n/* `updateComplete` resolves false while an update set another one going. */\nconst idle = async (el: DataGrist) => {\n while (!((await el.updateComplete) && (await el.grist.updateComplete)));\n}\n\nfor (const [mode, tag] of [\n ['LIST', 'ox-record-partial'],\n ['CARD', 'ox-record-card']\n] as const) {\n describe(`a ${mode} and its config`, () => {\n failOnPageErrors()\n\n const shown = (el: DataGrist) =>\n Array.from(el.grist.renderRoot.querySelectorAll(tag) as NodeListOf<any>).map(item => item.record.title)\n\n it('shows the records it was given with its config', async () => {\n const el = await fixture<DataGrist>(\n html`<ox-grist style=\"height:300px\" .mode=${mode} .config=${config('title')} .data=${{ records }}></ox-grist>`\n )\n await idle(el)\n expect(shown(el)).to.eql(['one', 'two'])\n })\n\n it('keeps its records when the config changes after them', async () => {\n const el = await fixture<DataGrist>(\n html`<ox-grist style=\"height:300px\" .mode=${mode} .config=${config('title')} .data=${{ records }}></ox-grist>`\n )\n await idle(el)\n el.config = config('renamed')\n await idle(el)\n expect(shown(el)).to.eql(['one', 'two'])\n })\n })\n}\n"]}
@@ -1 +0,0 @@
1
- import '../src/data-grist.js';
@@ -1,52 +0,0 @@
1
- import { expect, fixture, html } from '@open-wc/testing';
2
- import { setViewport } from '@web/test-runner-commands';
3
- import '../src/data-grist.js';
4
- const idle = async (el) => {
5
- while (!((await el.updateComplete) && (await el.grist.updateComplete)))
6
- ;
7
- await new Promise(resolve => requestAnimationFrame(() => requestAnimationFrame(resolve)));
8
- };
9
- const rows = [{ id: 'one', title: '첫 업무', description: '긴 업무 설명을 충분한 너비로 읽을 수 있어야 합니다.' }];
10
- const config = (button) => ({
11
- columns: [
12
- ...(button ? [{ type: 'gutter', gutterName: 'button', icon: 'edit', title: '상세', forList: true }] : []),
13
- { type: 'string', name: 'title', header: '제목', width: 'minmax(220px, 1fr)' },
14
- { type: 'string', name: 'description', header: '설명', width: 220 },
15
- ...(button ? [{ type: 'string', name: 'action', header: '', width: 40, record: { renderer: () => html `<button class="icon" aria-label="열기">↗</button>` } }] : [])
16
- ],
17
- rows: { appendable: false, editable: false, selectable: false },
18
- list: { fields: ['title'], details: ['description'] }
19
- });
20
- async function make(mode, button) {
21
- const el = await fixture(html `<ox-grist style="width:100%;height:240px;--grid-record-padding:4px 8px;--spacing-medium:8px;--spacing-small:4px;--spacing-tiny:2px;--cell-action-height:26px" .mode=${mode} .config=${config(button)} .data=${{ records: rows }}></ox-grist>`);
22
- await idle(el);
23
- return el;
24
- }
25
- describe('Office density regression', () => {
26
- afterEach(async () => setViewport({ width: 800, height: 600 }));
27
- it('an action gutter does not enlarge the grid row on desktop or phone', async () => {
28
- for (const width of [1440, 375]) {
29
- await setViewport({ width, height: 812 });
30
- const plain = await make('GRID', false);
31
- const action = await make('GRID', true);
32
- const field = (el) => el.grist.renderRoot.querySelector('ox-grid-body').renderRoot.querySelector('ox-grid-field');
33
- expect(field(action).getBoundingClientRect().height).to.equal(field(plain).getBoundingClientRect().height);
34
- expect(field(action).getBoundingClientRect().height).to.be.at.most(32);
35
- const body = action.grist.renderRoot.querySelector('ox-grid-body');
36
- const buttonCell = Array.from(body.renderRoot.querySelectorAll('ox-grid-field')).find((cell) => cell.renderRoot.querySelector('button.icon'));
37
- expect(buttonCell.renderRoot.querySelector('button.icon').getBoundingClientRect().height).to.equal(26);
38
- }
39
- });
40
- it('a phone list gives its text a full line and puts actions below it', async () => {
41
- await setViewport({ width: 375, height: 812 });
42
- const el = await make('LIST', true);
43
- const row = el.grist.renderRoot.querySelector('ox-record-partial');
44
- await row.updateComplete;
45
- const content = row.renderRoot.querySelector('[content]');
46
- const action = row.renderRoot.querySelector('ox-list-gutter');
47
- expect(content.getBoundingClientRect().width).to.be.above(320);
48
- expect(action.getBoundingClientRect().top).to.be.at.least(content.getBoundingClientRect().bottom);
49
- expect(row.scrollWidth).to.be.at.most(row.clientWidth);
50
- });
51
- });
52
- //# sourceMappingURL=office-density.test.js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AAC,CAAA;QACnC,MAAM,GAAG,GAAG,EAAE,CAAC,KAAK,CAAC,UAAU,CAAC,aAAa,CAAC,mBAAmB,CAAQ,CAAA;QACzE,MAAM,GAAG,CAAC,cAAc,CAAA;QACxB,MAAM,OAAO,GAAG,GAAG,CAAC,UAAU,CAAC,aAAa,CAAC,WAAW,CAAgB,CAAA;QACxE,MAAM,MAAM,GAAG,GAAG,CAAC,UAAU,CAAC,aAAa,CAAC,gBAAgB,CAAgB,CAAA;QAC5E,MAAM,CAAC,OAAO,CAAC,qBAAqB,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;QAC9D,MAAM,CAAC,MAAM,CAAC,qBAAqB,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,qBAAqB,EAAE,CAAC,MAAM,CAAC,CAAA;QACjG,MAAM,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,WAAW,CAAC,CAAA;IACxD,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA","sourcesContent":["import { expect, fixture, html } from '@open-wc/testing'\nimport { setViewport } from '@web/test-runner-commands'\nimport '../src/data-grist.js'\nimport type { DataGrist } from '../src/data-grist.js'\n\nconst idle = async (el: DataGrist) => {\n while (!((await el.updateComplete) && (await el.grist.updateComplete)));\n await new Promise(resolve => requestAnimationFrame(() => requestAnimationFrame(resolve)))\n}\n\nconst rows = [{ id: 'one', title: '첫 업무', description: '긴 업무 설명을 충분한 너비로 읽을 수 있어야 합니다.' }]\nconst config = (button: boolean) => ({\n columns: [\n ...(button ? [{ type: 'gutter', gutterName: 'button', icon: 'edit', title: '상세', forList: true }] : []),\n { type: 'string', name: 'title', header: '제목', width: 'minmax(220px, 1fr)' },\n { type: 'string', name: 'description', header: '설명', width: 220 },\n ...(button ? [{ type: 'string', name: 'action', header: '', width: 40, record: { renderer: () => html`<button class=\"icon\" aria-label=\"열기\">↗</button>` } }] : [])\n ],\n rows: { appendable: false, editable: false, selectable: false },\n list: { fields: ['title'], details: ['description'] }\n})\n\nasync function make(mode: string, button: boolean) {\n const el = await fixture<DataGrist>(html`<ox-grist style=\"width:100%;height:240px;--grid-record-padding:4px 8px;--spacing-medium:8px;--spacing-small:4px;--spacing-tiny:2px;--cell-action-height:26px\" .mode=${mode} .config=${config(button)} .data=${{records: rows}}></ox-grist>`)\n await idle(el)\n return el\n}\n\ndescribe('Office density regression', () => {\n afterEach(async () => setViewport({ width: 800, height: 600 }))\n\n it('an action gutter does not enlarge the grid row on desktop or phone', async () => {\n for (const width of [1440, 375]) {\n await setViewport({ width, height: 812 })\n const plain = await make('GRID', false)\n const action = await make('GRID', true)\n const field = (el: DataGrist) => (el.grist.renderRoot.querySelector('ox-grid-body') as any).renderRoot.querySelector('ox-grid-field') as HTMLElement\n expect(field(action).getBoundingClientRect().height).to.equal(field(plain).getBoundingClientRect().height)\n expect(field(action).getBoundingClientRect().height).to.be.at.most(32)\n const body = action.grist.renderRoot.querySelector('ox-grid-body') as any\n const buttonCell = Array.from(body.renderRoot.querySelectorAll('ox-grid-field')).find((cell: any) => cell.renderRoot.querySelector('button.icon')) as any\n expect(buttonCell.renderRoot.querySelector('button.icon').getBoundingClientRect().height).to.equal(26)\n }\n })\n\n it('a phone list gives its text a full line and puts actions below it', async () => {\n await setViewport({ width: 375, height: 812 })\n const el = await make('LIST', true)\n const row = el.grist.renderRoot.querySelector('ox-record-partial') as any\n await row.updateComplete\n const content = row.renderRoot.querySelector('[content]') as HTMLElement\n const action = row.renderRoot.querySelector('ox-list-gutter') as HTMLElement\n expect(content.getBoundingClientRect().width).to.be.above(320)\n expect(action.getBoundingClientRect().top).to.be.at.least(content.getBoundingClientRect().bottom)\n expect(row.scrollWidth).to.be.at.most(row.clientWidth)\n })\n})\n"]}
@@ -1 +0,0 @@
1
- export declare function failOnPageErrors(): void;
@@ -1,44 +0,0 @@
1
- /*
2
- * Fail a test when the page throws while it runs - a render exception or a rejected promise nobody awaited. The
3
- * runner only logs those as 「thrown outside a test」 and the test still passes. The browser's ResizeObserver loop
4
- * notice is not an error of the page.
5
- */
6
- export function failOnPageErrors() {
7
- const errors = [];
8
- const benign = (message) => message.includes('ResizeObserver loop');
9
- const onError = (e) => {
10
- var _a;
11
- if (benign(String(e.message))) {
12
- e.stopImmediatePropagation();
13
- e.preventDefault();
14
- return;
15
- }
16
- errors.push(String(((_a = e.error) === null || _a === void 0 ? void 0 : _a.stack) || e.message));
17
- };
18
- const onRejection = (e) => {
19
- var _a;
20
- errors.push(String(((_a = e.reason) === null || _a === void 0 ? void 0 : _a.stack) || e.reason));
21
- };
22
- let previousOnError = null;
23
- before(() => {
24
- window.addEventListener('error', onError, true);
25
- window.addEventListener('unhandledrejection', onRejection);
26
- previousOnError = window.onerror;
27
- window.onerror = (message, ...rest) => benign(String(message)) ? true : previousOnError === null || previousOnError === void 0 ? void 0 : previousOnError.call(window, message, ...rest);
28
- });
29
- after(() => {
30
- window.removeEventListener('error', onError, true);
31
- window.removeEventListener('unhandledrejection', onRejection);
32
- window.onerror = previousOnError;
33
- });
34
- beforeEach(() => {
35
- errors.length = 0;
36
- });
37
- afterEach(async () => {
38
- /* Let renders the test started finish, so their errors land in this test. */
39
- await new Promise(resolve => setTimeout(resolve, 50));
40
- if (errors.length)
41
- throw new Error(`the page threw while the test ran:\n${errors.join('\n')}`);
42
- });
43
- }
44
- //# sourceMappingURL=page-errors.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"page-errors.js","sourceRoot":"","sources":["../../test/page-errors.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,UAAU,gBAAgB;IAC9B,MAAM,MAAM,GAAa,EAAE,CAAA;IAC3B,MAAM,MAAM,GAAG,CAAC,OAAe,EAAE,EAAE,CAAC,OAAO,CAAC,QAAQ,CAA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D,MAAM,CAAC,mBAAmB,CAAC,oBAAoB,EAAE,WAAW,CAAC,CAAA;QAC7D,MAAM,CAAC,OAAO,GAAG,eAAe,CAAA;IAClC,CAAC,CAAC,CAAA;IACF,UAAU,CAAC,GAAG,EAAE;QACd,MAAM,CAAC,MAAM,GAAG,CAAC,CAAA;IACnB,CAAC,CAAC,CAAA;IACF,SAAS,CAAC,KAAK,IAAI,EAAE;QACnB,6EAA6E;QAC7E,MAAM,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAA;QACrD,IAAI,MAAM,CAAC,MAAM;YAAE,MAAM,IAAI,KAAK,CAAC,uCAAuC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;IAChG,CAAC,CAAC,CAAA;AACJ,CAAC","sourcesContent":["/*\n * Fail a test when the page throws while it runs - a render exception or a rejected promise nobody awaited. The\n * runner only logs those as 「thrown outside a test」 and the test still passes. The browser's ResizeObserver loop\n * notice is not an error of the page.\n */\nexport function failOnPageErrors() {\n const errors: string[] = []\n const benign = (message: string) => message.includes('ResizeObserver loop')\n\n const onError = (e: ErrorEvent) => {\n if (benign(String(e.message))) {\n e.stopImmediatePropagation()\n e.preventDefault()\n return\n }\n errors.push(String(e.error?.stack || e.message))\n }\n const onRejection = (e: PromiseRejectionEvent) => {\n errors.push(String(e.reason?.stack || e.reason))\n }\n let previousOnError: OnErrorEventHandler = null\n\n before(() => {\n window.addEventListener('error', onError, true)\n window.addEventListener('unhandledrejection', onRejection)\n previousOnError = window.onerror\n window.onerror = (message, ...rest) =>\n benign(String(message)) ? true : previousOnError?.call(window, message, ...rest)\n })\n after(() => {\n window.removeEventListener('error', onError, true)\n window.removeEventListener('unhandledrejection', onRejection)\n window.onerror = previousOnError\n })\n beforeEach(() => {\n errors.length = 0\n })\n afterEach(async () => {\n /* Let renders the test started finish, so their errors land in this test. */\n await new Promise(resolve => setTimeout(resolve, 50))\n if (errors.length) throw new Error(`the page threw while the test ran:\\n${errors.join('\\n')}`)\n })\n}\n"]}
@@ -1 +0,0 @@
1
- import '../src/data-grist.js';
@@ -1,163 +0,0 @@
1
- import { expect, fixture } from '@open-wc/testing';
2
- import { html } from 'lit';
3
- import '../src/data-grist.js';
4
- import { DataGridBody } from '../src/data-grid/data-grid-body.js';
5
- import { OxGristEditorNumber } from '../src/editors/ox-grist-editor-number.js';
6
- import { failOnPageErrors } from './page-errors.js';
7
- /* The clipboard holds `text` as `mime` while `run` reads it. */
8
- async function withClipboard(mime, text, run) {
9
- const previous = Object.getOwnPropertyDescriptor(navigator, 'clipboard');
10
- Object.defineProperty(navigator, 'clipboard', { configurable: true, value: {
11
- read: async () => [{ getType: async (requested) => {
12
- if (requested !== mime)
13
- throw Error('no type');
14
- return new Blob([text], { type: mime });
15
- } }]
16
- } });
17
- try {
18
- return await run();
19
- }
20
- finally {
21
- if (previous)
22
- Object.defineProperty(navigator, 'clipboard', previous);
23
- else
24
- delete navigator.clipboard;
25
- }
26
- }
27
- /* What a paste sends, read off a body that only records its field changes. */
28
- async function paste(mime, text, type = 'number', options = {}) {
29
- var _a, _b, _d;
30
- const changes = [];
31
- const body = {
32
- focused: { row: (_a = options.row) !== null && _a !== void 0 ? _a : 0, column: 0 }, data: { records: options.records || [{ id: 'a', value: 1 }] },
33
- columns: [{ name: 'value', type, record: { editable: (_b = options.editable) !== null && _b !== void 0 ? _b : true } }],
34
- config: { rows: { appendable: (_d = options.appendable) !== null && _d !== void 0 ? _d : false } }, appendRecord: { __dirty__: '+' },
35
- pasteTargets: DataGridBody.prototype.pasteTargets,
36
- resetEdit() { }, focus() { }, dispatchEvent(e) { changes.push(e.detail); }
37
- };
38
- await withClipboard(mime, text, () => DataGridBody.prototype.paste.call(body));
39
- return { body, changes };
40
- }
41
- const source = (mime, values) => mime === 'text/html'
42
- ? `<table>${values.map(value => `<tr><td>${value}</td></tr>`).join('')}</table>`
43
- : values.join('\n');
44
- describe('paste and input data contracts', () => {
45
- for (const mime of ['text/html', 'text/plain']) {
46
- for (const [type, input, expected] of [
47
- ['number', 'abc', 'abc'], ['number', '1,200', '1,200'],
48
- ['number', ' ', null], ['number', 'Infinity', 'Infinity'],
49
- ['number', '12.5', 12.5], ['integer', '12.5', 12], ['integer', '-1.5', -2],
50
- ['boolean', 'false', false], ['checkbox', 'true', true], ['number', '0', 0]
51
- ]) {
52
- it(`${mime} parses ${type} ${input}`, async () => {
53
- const { changes } = await paste(mime, source(mime, [input]), type);
54
- expect(changes[0].after).to.equal(expected);
55
- });
56
- }
57
- /* A blank cell clears an existing row's field and leaves a new row's to its default; id 0 is an existing row. */
58
- for (const [type, input, records, row, expected] of [
59
- ['number', ' ', [{ id: 0, value: 1 }], 0, null],
60
- ['string', ' ', [{ id: 'a', value: 'x' }], 1, undefined],
61
- ['number', ' ', [{ id: 'a', value: 1 }], 1, undefined],
62
- ['select', ' ', [{ id: 'a', value: 1 }], 1, undefined]
63
- ]) {
64
- it(`${mime} pastes a blank ${type} into ${row ? 'a new' : 'an existing'} row as ${expected}`, async () => {
65
- const { changes } = await paste(mime, source(mime, [input]), type, { records, row, appendable: true });
66
- expect(changes).to.have.length(1);
67
- expect(changes[0].after).to.equal(expected);
68
- });
69
- }
70
- it(`${mime} passes the destination row to editable`, async () => {
71
- const seen = [];
72
- await paste(mime, source(mime, ['1', '2']), 'number', {
73
- records: [{ id: 'a' }, { id: 'b' }],
74
- editable: (_v, _c, _r, row) => { seen.push(row); return true; }
75
- });
76
- expect(seen).to.eql([0, 1]);
77
- });
78
- }
79
- it('integer IME input uses the same conversion as the number editor', () => {
80
- let after;
81
- const column = { name: 'value', type: 'integer', record: { editable: true } };
82
- const body = { _imeBuffer: { value: '12.5' }, _resetIMEBuffer() { }, columns: [column],
83
- data: { records: [{ value: 1 }] }, dispatchEvent(e) { after = e.detail.after; } };
84
- DataGridBody.prototype._commitIMEBuffer.call(body, 0, 0);
85
- const expected = OxGristEditorNumber.prototype.formatFromEditor.call({ column }, '12.5');
86
- expect(after).to.equal(expected);
87
- });
88
- });
89
- /* Pasting into a rendered grid: the rows that end up in the grid, through its own field-change handling. */
90
- describe('paste into a grid', () => {
91
- failOnPageErrors();
92
- const mount = async (options) => {
93
- var _a, _b;
94
- const el = await fixture(html `<ox-grist
95
- style="height:300px"
96
- .config=${{
97
- columns: [
98
- { name: 'amount', type: 'number', header: 'amount', record: { editable: (_a = options.editable) !== null && _a !== void 0 ? _a : true }, validation: options.validation },
99
- { name: 'memo', type: 'string', header: 'memo', record: { editable: (_b = options.editable) !== null && _b !== void 0 ? _b : true } }
100
- ],
101
- rows: { appendable: options.appendable }
102
- }}
103
- .data=${{ records: [{ id: 'a', amount: 1, memo: 'kept' }] }}
104
- ></ox-grist>`);
105
- await el.updateComplete;
106
- await el.grist.updateComplete;
107
- return el;
108
- };
109
- const bodyOf = (el) => el.grist.renderRoot.querySelector('ox-grid-body');
110
- const pasteAt = async (el, row, mime, text, column = 0) => {
111
- const body = bodyOf(el);
112
- body.focused = { row, column };
113
- await withClipboard(mime, text, () => body.paste());
114
- await el.updateComplete;
115
- };
116
- const table = (mime, rows) => mime === 'text/html'
117
- ? `<table>${rows.map(cells => `<tr>${cells.map(cell => `<td>${cell}</td>`).join('')}</tr>`).join('')}</table>`
118
- : rows.map(cells => cells.join('\t')).join('\n');
119
- const rows = (el) => el.grist.data.records.map(({ amount, memo }) => ({ amount, memo }));
120
- for (const mime of ['text/html', 'text/plain']) {
121
- it(`${mime} stops at the last row when rows cannot be appended`, async () => {
122
- const el = await mount({ appendable: false });
123
- await pasteAt(el, 0, mime, table(mime, [['2', 'x'], ['3', 'y']]));
124
- expect(rows(el)).to.eql([{ amount: 2, memo: 'x' }]);
125
- });
126
- it(`${mime} appends new rows in order`, async () => {
127
- const el = await mount({ appendable: true });
128
- await pasteAt(el, 1, mime, table(mime, [['2', 'x'], ['3', 'y']]));
129
- expect(rows(el)).to.eql([{ amount: 1, memo: 'kept' }, { amount: 2, memo: 'x' }, { amount: 3, memo: 'y' }]);
130
- });
131
- it(`${mime} adds no row for read-only cells`, async () => {
132
- const el = await mount({ appendable: true, editable: false });
133
- await pasteAt(el, 1, mime, table(mime, [['2', 'x']]));
134
- expect(el.grist.data.records).to.have.length(1);
135
- });
136
- it(`${mime} adds no row for a blank new row`, async () => {
137
- const el = await mount({ appendable: true });
138
- await pasteAt(el, 1, mime, table(mime, [[' ', ' '], ['4', 'z']]));
139
- expect(rows(el)).to.eql([{ amount: 1, memo: 'kept' }, { amount: 4, memo: 'z' }]);
140
- expect(el.dirtyRecords).to.have.length(1);
141
- });
142
- it(`${mime} keeps a new row's cells together while one is being validated`, async () => {
143
- let resolve;
144
- const el = await mount({ appendable: true, validation: () => new Promise(done => (resolve = done)) });
145
- await pasteAt(el, 1, mime, table(mime, [['5', 'w']]));
146
- resolve(true);
147
- await new Promise(done => setTimeout(done));
148
- expect(rows(el)).to.eql([{ amount: 1, memo: 'kept' }, { amount: 5, memo: 'w' }]);
149
- });
150
- it(`${mime} into the append row and a key typed into it while the paste is validated make one row`, async () => {
151
- let resolve;
152
- const el = await mount({ appendable: true, validation: () => new Promise(done => (resolve = done)) });
153
- await pasteAt(el, 1, mime, table(mime, [['5']]));
154
- const body = bodyOf(el);
155
- body._imeBuffer.value = 'typed';
156
- body._commitIMEBuffer(1, 1);
157
- resolve(true);
158
- await new Promise(done => setTimeout(done));
159
- expect(rows(el)).to.eql([{ amount: 1, memo: 'kept' }, { amount: 5, memo: 'typed' }]);
160
- });
161
- }
162
- });
163
- //# sourceMappingURL=paste-integrity.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"paste-integrity.test.js","sourceRoot":"","sources":["../../test/paste-integrity.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AAClD,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAE1B,OAAO,sBAAsB,CAAA;AAE7B,OAAO,EAAE,Y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AM,EAAE,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC,CAAA;QACtF,CAAC,CAAC,CAAA;IACJ,CAAC;AACH,CAAC,CAAC,CAAA","sourcesContent":["import { expect, fixture } from '@open-wc/testing'\nimport { html } from 'lit'\n\nimport '../src/data-grist.js'\nimport { DataGrist } from '../src/data-grist.js'\nimport { DataGridBody } from '../src/data-grid/data-grid-body.js'\nimport { OxGristEditorNumber } from '../src/editors/ox-grist-editor-number.js'\nimport { failOnPageErrors } from './page-errors.js'\n\n/* The clipboard holds `text` as `mime` while `run` reads it. */\nasync function withClipboard<T>(mime: string, text: string, run: () => Promise<T>): Promise<T> {\n const previous = Object.getOwnPropertyDescriptor(navigator, 'clipboard')\n Object.defineProperty(navigator, 'clipboard', { configurable: true, value: {\n read: async () => [{ getType: async (requested: string) => {\n if (requested !== mime) throw Error('no type')\n return new Blob([text], { type: mime })\n } }]\n } })\n try { return await run() }\n finally {\n if (previous) Object.defineProperty(navigator, 'clipboard', previous)\n else delete (navigator as any).clipboard\n }\n}\n\n/* What a paste sends, read off a body that only records its field changes. */\nasync function paste(mime: string, text: string, type = 'number', options: any = {}) {\n const changes: any[] = []\n const body: any = {\n focused: { row: options.row ?? 0, column: 0 }, data: { records: options.records || [{ id: 'a', value: 1 }] },\n columns: [{ name: 'value', type, record: { editable: options.editable ?? true } }],\n config: { rows: { appendable: options.appendable ?? false } }, appendRecord: { __dirty__: '+' },\n pasteTargets: (DataGridBody.prototype as any).pasteTargets,\n resetEdit() {}, focus() {}, dispatchEvent(e: CustomEvent) { changes.push(e.detail) }\n }\n await withClipboard(mime, text, () => DataGridBody.prototype.paste.call(body))\n return { body, changes }\n}\nconst source = (mime: string, values: string[]) => mime === 'text/html'\n ? `<table>${values.map(value => `<tr><td>${value}</td></tr>`).join('')}</table>`\n : values.join('\\n')\n\ndescribe('paste and input data contracts', () => {\n for (const mime of ['text/html', 'text/plain']) {\n for (const [type, input, expected] of [\n ['number', 'abc', 'abc'], ['number', '1,200', '1,200'],\n ['number', ' ', null], ['number', 'Infinity', 'Infinity'],\n ['number', '12.5', 12.5], ['integer', '12.5', 12], ['integer', '-1.5', -2],\n ['boolean', 'false', false], ['checkbox', 'true', true], ['number', '0', 0]\n ] as const) {\n it(`${mime} parses ${type} ${input}`, async () => {\n const { changes } = await paste(mime, source(mime, [input]), type)\n expect(changes[0].after).to.equal(expected)\n })\n }\n /* A blank cell clears an existing row's field and leaves a new row's to its default; id 0 is an existing row. */\n for (const [type, input, records, row, expected] of [\n ['number', ' ', [{ id: 0, value: 1 }], 0, null],\n ['string', ' ', [{ id: 'a', value: 'x' }], 1, undefined],\n ['number', ' ', [{ id: 'a', value: 1 }], 1, undefined],\n ['select', ' ', [{ id: 'a', value: 1 }], 1, undefined]\n ] as const) {\n it(`${mime} pastes a blank ${type} into ${row ? 'a new' : 'an existing'} row as ${expected}`, async () => {\n const { changes } = await paste(mime, source(mime, [input]), type, { records, row, appendable: true })\n expect(changes).to.have.length(1)\n expect(changes[0].after).to.equal(expected)\n })\n }\n it(`${mime} passes the destination row to editable`, async () => {\n const seen: number[] = []\n await paste(mime, source(mime, ['1', '2']), 'number', {\n records: [{ id: 'a' }, { id: 'b' }],\n editable: (_v: any, _c: any, _r: any, row: number) => { seen.push(row); return true }\n })\n expect(seen).to.eql([0, 1])\n })\n }\n it('integer IME input uses the same conversion as the number editor', () => {\n let after: any\n const column: any = { name: 'value', type: 'integer', record: { editable: true } }\n const body: any = { _imeBuffer: { value: '12.5' }, _resetIMEBuffer() {}, columns: [column],\n data: { records: [{ value: 1 }] }, dispatchEvent(e: CustomEvent) { after = e.detail.after } }\n DataGridBody.prototype._commitIMEBuffer.call(body, 0, 0)\n const expected = OxGristEditorNumber.prototype.formatFromEditor.call({ column } as any, '12.5')\n expect(after).to.equal(expected)\n })\n})\n\n/* Pasting into a rendered grid: the rows that end up in the grid, through its own field-change handling. */\ndescribe('paste into a grid', () => {\n failOnPageErrors()\n\n const mount = async (options: { appendable: boolean; editable?: boolean; validation?: () => Promise<boolean> }) => {\n const el = await fixture<DataGrist>(html`<ox-grist\n style=\"height:300px\"\n .config=${{\n columns: [\n { name: 'amount', type: 'number', header: 'amount', record: { editable: options.editable ?? true }, validation: options.validation },\n { name: 'memo', type: 'string', header: 'memo', record: { editable: options.editable ?? true } }\n ],\n rows: { appendable: options.appendable }\n }}\n .data=${{ records: [{ id: 'a', amount: 1, memo: 'kept' }] }}\n ></ox-grist>`)\n await el.updateComplete\n await el.grist.updateComplete\n return el\n }\n const bodyOf = (el: DataGrist) => el.grist.renderRoot.querySelector('ox-grid-body') as any\n const pasteAt = async (el: DataGrist, row: number, mime: string, text: string, column = 0) => {\n const body = bodyOf(el)\n body.focused = { row, column }\n await withClipboard(mime, text, () => body.paste())\n await el.updateComplete\n }\n const table = (mime: string, rows: string[][]) => mime === 'text/html'\n ? `<table>${rows.map(cells => `<tr>${cells.map(cell => `<td>${cell}</td>`).join('')}</tr>`).join('')}</table>`\n : rows.map(cells => cells.join('\\t')).join('\\n')\n const rows = (el: DataGrist) => el.grist.data.records.map(({ amount, memo }) => ({ amount, memo }))\n\n for (const mime of ['text/html', 'text/plain']) {\n it(`${mime} stops at the last row when rows cannot be appended`, async () => {\n const el = await mount({ appendable: false })\n await pasteAt(el, 0, mime, table(mime, [['2', 'x'], ['3', 'y']]))\n expect(rows(el)).to.eql([{ amount: 2, memo: 'x' }])\n })\n\n it(`${mime} appends new rows in order`, async () => {\n const el = await mount({ appendable: true })\n await pasteAt(el, 1, mime, table(mime, [['2', 'x'], ['3', 'y']]))\n expect(rows(el)).to.eql([{ amount: 1, memo: 'kept' }, { amount: 2, memo: 'x' }, { amount: 3, memo: 'y' }])\n })\n\n it(`${mime} adds no row for read-only cells`, async () => {\n const el = await mount({ appendable: true, editable: false })\n await pasteAt(el, 1, mime, table(mime, [['2', 'x']]))\n expect(el.grist.data.records).to.have.length(1)\n })\n\n it(`${mime} adds no row for a blank new row`, async () => {\n const el = await mount({ appendable: true })\n await pasteAt(el, 1, mime, table(mime, [[' ', ' '], ['4', 'z']]))\n expect(rows(el)).to.eql([{ amount: 1, memo: 'kept' }, { amount: 4, memo: 'z' }])\n expect(el.dirtyRecords).to.have.length(1)\n })\n\n it(`${mime} keeps a new row's cells together while one is being validated`, async () => {\n let resolve!: (valid: boolean) => void\n const el = await mount({ appendable: true, validation: () => new Promise(done => (resolve = done)) })\n await pasteAt(el, 1, mime, table(mime, [['5', 'w']]))\n resolve(true)\n await new Promise(done => setTimeout(done))\n expect(rows(el)).to.eql([{ amount: 1, memo: 'kept' }, { amount: 5, memo: 'w' }])\n })\n\n it(`${mime} into the append row and a key typed into it while the paste is validated make one row`, async () => {\n let resolve!: (valid: boolean) => void\n const el = await mount({ appendable: true, validation: () => new Promise(done => (resolve = done)) })\n await pasteAt(el, 1, mime, table(mime, [['5']]))\n const body = bodyOf(el)\n body._imeBuffer.value = 'typed'\n body._commitIMEBuffer(1, 1)\n resolve(true)\n await new Promise(done => setTimeout(done))\n expect(rows(el)).to.eql([{ amount: 1, memo: 'kept' }, { amount: 5, memo: 'typed' }])\n })\n }\n})\n"]}
@@ -1 +0,0 @@
1
- export {};
@@ -1,15 +0,0 @@
1
- import { expect } from '@open-wc/testing';
2
- import { RecordCard } from '../src/data-card/record-card.js';
3
- /**
4
- * A card is as tall as its content by default. A list whose cards carry different numbers of lines (a fact row that
5
- * only some records have) stretches the cards of a row to one height through --data-card-record-card-height.
6
- */
7
- const text = (styles) => (Array.isArray(styles) ? styles : [styles]).map(s => { var _a; return String((_a = s.cssText) !== null && _a !== void 0 ? _a : s); }).join('\n');
8
- describe('record card height', () => {
9
- it('reads --data-card-record-card-height, min-content when not set', () => {
10
- const css = text(RecordCard.styles);
11
- const host = css.slice(css.indexOf(':host {'), css.indexOf('}', css.indexOf(':host {')));
12
- expect(host).to.contain('height: var(--data-card-record-card-height, min-content);');
13
- });
14
- });
15
- //# sourceMappingURL=record-card-height.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"record-card-height.test.js","sourceRoot":"","sources":["../../test/record-card-height.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AAEzC,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAA;AAE5D;;;GAGG;AAEH,MAAM,IAAI,GAAG,CAAC,MAAe,EAAE,EAAE,CAC/B,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,WAAC,OAAA,MAAM,CAAC,MAAC,CAA0B,CAAC,OAAO,mCAAI,CAAC,CAAC,CAAA,EAAA,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AAEnH,QAAQ,CAAC,oBAAoB,EAAE,GAAG,EAAE;IAClC,EAAE,CAAC,gEAAgE,EAAE,GAAG,EAAE;QACxE,MAAM,GAAG,GAAG,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,CAAA;QACnC,MAAM,IAAI,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,CAAA;QACxF,MAAM,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,2DAA2D,CAAC,CAAA;IACtF,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA","sourcesContent":["import { expect } from '@open-wc/testing'\n\nimport { RecordCard } from '../src/data-card/record-card.js'\n\n/**\n * A card is as tall as its content by default. A list whose cards carry different numbers of lines (a fact row that\n * only some records have) stretches the cards of a row to one height through --data-card-record-card-height.\n */\n\nconst text = (styles: unknown) =>\n (Array.isArray(styles) ? styles : [styles]).map(s => String((s as { cssText?: string }).cssText ?? s)).join('\\n')\n\ndescribe('record card height', () => {\n it('reads --data-card-record-card-height, min-content when not set', () => {\n const css = text(RecordCard.styles)\n const host = css.slice(css.indexOf(':host {'), css.indexOf('}', css.indexOf(':host {')))\n expect(host).to.contain('height: var(--data-card-record-card-height, min-content);')\n })\n})\n"]}
@@ -1 +0,0 @@
1
- import '../src/record-view/record-view.js';
@@ -1,71 +0,0 @@
1
- /* Elements are compared by presence, not by value: a failing element comparison makes chai render the DOM and hang the runner. */
2
- import { expect, fixture } from '@open-wc/testing';
3
- import { html } from 'lit';
4
- import '../src/record-view/record-view.js';
5
- import { buildColumn } from '../src/configure/column-builder.js';
6
- import { OxGristEditor } from '../src/editors/ox-grist-editor.js';
7
- import { registerEditor } from '../src/editors/registry.js';
8
- /*
9
- * In a form (ox-record-view - the 「만들기」 dialog of a grid) a field is pressed to be edited. A field whose editor
10
- * opens a popup used to become 「editing」 on the first press but open nothing until its editor was pressed again,
11
- * so what was typed after the first press went nowhere (pdf template 「만들기」, body HTML, 2026-10-10).
12
- */
13
- let opened = 0;
14
- class ProbePopupEditor extends OxGristEditor {
15
- _onclick(e) {
16
- e.stopPropagation();
17
- opened++;
18
- }
19
- }
20
- ProbePopupEditor.opensPopup = true;
21
- customElements.define('probe-popup-editor', ProbePopupEditor);
22
- registerEditor('probe-popup', ProbePopupEditor);
23
- const settle = (ms = 100) => new Promise(resolve => setTimeout(resolve, ms));
24
- describe('a popup field in a form', () => {
25
- it('does not emit the old inline value after a popup has confirmed a different value', async () => {
26
- const record = { body: 'old' };
27
- const editor = await fixture(html `<probe-popup-editor
28
- .column=${buildColumn({ type: 'probe-popup', name: 'body', record: { editable: true } })}
29
- .record=${record}
30
- ></probe-popup-editor>`);
31
- let changes = 0;
32
- editor.addEventListener('field-change', () => changes++);
33
- record.body = 'confirmed';
34
- editor._onfocusout();
35
- expect(changes).to.equal(0);
36
- expect(record.body).to.equal('confirmed');
37
- });
38
- it('opens its popup on the first press', async () => {
39
- opened = 0;
40
- const columns = [
41
- buildColumn({ type: 'string', name: 'name', header: 'name', record: { editable: true } }),
42
- buildColumn({ type: 'probe-popup', name: 'body', header: 'body', record: { editable: true } })
43
- ];
44
- const view = (await fixture(html `<ox-record-view .columns=${columns} .record=${{}}></ox-record-view>`));
45
- await view.updateComplete;
46
- await settle();
47
- const body = view.renderRoot.querySelector('ox-record-view-body');
48
- await body.updateComplete;
49
- const field = Array.from(body.renderRoot.querySelectorAll('ox-grid-field')).find(one => { var _a; return ((_a = one.column) === null || _a === void 0 ? void 0 : _a.name) === 'body'; });
50
- expect(!!field, 'the body field is drawn').to.equal(true);
51
- field.click();
52
- await settle(200);
53
- expect(field.getAttribute('editing'), 'the field is being edited').to.equal('true');
54
- expect(opened, 'the popup editor was opened once').to.equal(1);
55
- });
56
- it('leaves a field edited in place as it was - nothing extra is pressed', async () => {
57
- opened = 0;
58
- const columns = [buildColumn({ type: 'string', name: 'name', header: 'name', record: { editable: true } })];
59
- const view = (await fixture(html `<ox-record-view .columns=${columns} .record=${{}}></ox-record-view>`));
60
- await view.updateComplete;
61
- await settle();
62
- const body = view.renderRoot.querySelector('ox-record-view-body');
63
- await body.updateComplete;
64
- const field = body.renderRoot.querySelector('ox-grid-field');
65
- field.click();
66
- await settle(200);
67
- expect(field.getAttribute('editing')).to.equal('true');
68
- expect(opened).to.equal(0);
69
- });
70
- });
71
- //# sourceMappingURL=record-view-popup-editor.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"record-view-popup-editor.test.js","sourceRoot":"","sources":["../../test/record-view-popup-editor.test.ts"],"names":[],"mappings":"AAAA,kIAAkI;AAClI,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AAClD,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAE1B,OAAO,mCAAmC,CAAA;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAA;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAA;AACjE,OAAO,EAAE,cAAc,EAAE,M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C,EAAE,2BAA2B,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,CAAA;QACnF,MAAM,CAAC,MAAM,EAAE,kCAAkC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;IAChE,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,qEAAqE,EAAE,KAAK,IAAI,EAAE;QACnF,MAAM,GAAG,CAAC,CAAA;QACV,MAAM,OAAO,GAAG,CAAC,WAAW,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAS,CAAC,CAAC,CAAA;QAClH,MAAM,IAAI,GAAG,CAAC,MAAM,OAAO,CAAC,IAAI,CAAA,4BAA4B,OAAO,YAAY,EAAE,oBAAoB,CAAC,CAAQ,CAAA;QAC9G,MAAM,IAAI,CAAC,cAAc,CAAA;QACzB,MAAM,MAAM,EAAE,CAAA;QACd,MAAM,IAAI,GAAG,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,qBAAqB,CAAQ,CAAA;QACxE,MAAM,IAAI,CAAC,cAAc,CAAA;QACzB,MAAM,KAAK,GAAG,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,eAAe,CAAQ,CAAA;QACnE,KAAK,CAAC,KAAK,EAAE,CAAA;QACb,MAAM,MAAM,CAAC,GAAG,CAAC,CAAA;QACjB,MAAM,CAAC,KAAK,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,CAAA;QACtD,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;IAC5B,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA","sourcesContent":["/* Elements are compared by presence, not by value: a failing element comparison makes chai render the DOM and hang the runner. */\nimport { expect, fixture } from '@open-wc/testing'\nimport { html } from 'lit'\n\nimport '../src/record-view/record-view.js'\nimport { buildColumn } from '../src/configure/column-builder.js'\nimport { OxGristEditor } from '../src/editors/ox-grist-editor.js'\nimport { registerEditor } from '../src/editors/registry.js'\n\n/*\n * In a form (ox-record-view - the 「만들기」 dialog of a grid) a field is pressed to be edited. A field whose editor\n * opens a popup used to become 「editing」 on the first press but open nothing until its editor was pressed again,\n * so what was typed after the first press went nowhere (pdf template 「만들기」, body HTML, 2026-10-10).\n */\n\nlet opened = 0\n\nclass ProbePopupEditor extends OxGristEditor {\n static opensPopup = true\n\n _onclick(e: Event): void {\n e.stopPropagation()\n opened++\n }\n}\ncustomElements.define('probe-popup-editor', ProbePopupEditor)\nregisterEditor('probe-popup', ProbePopupEditor)\n\nconst settle = (ms = 100) => new Promise(resolve => setTimeout(resolve, ms))\n\ndescribe('a popup field in a form', () => {\n it('does not emit the old inline value after a popup has confirmed a different value', async () => {\n const record = { body: 'old' }\n const editor = await fixture<ProbePopupEditor>(\n html`<probe-popup-editor\n .column=${buildColumn({ type: 'probe-popup', name: 'body', record: { editable: true } } as any)}\n .record=${record}\n ></probe-popup-editor>`\n )\n let changes = 0\n editor.addEventListener('field-change', () => changes++)\n record.body = 'confirmed'\n editor._onfocusout()\n expect(changes).to.equal(0)\n expect(record.body).to.equal('confirmed')\n })\n\n it('opens its popup on the first press', async () => {\n opened = 0\n const columns = [\n buildColumn({ type: 'string', name: 'name', header: 'name', record: { editable: true } } as any),\n buildColumn({ type: 'probe-popup', name: 'body', header: 'body', record: { editable: true } } as any)\n ]\n const view = (await fixture(html`<ox-record-view .columns=${columns} .record=${{}}></ox-record-view>`)) as any\n await view.updateComplete\n await settle()\n\n const body = view.renderRoot.querySelector('ox-record-view-body') as any\n await body.updateComplete\n const field = Array.from(body.renderRoot.querySelectorAll('ox-grid-field') as NodeListOf<any>).find(one => one.column?.name === 'body')\n expect(!!field, 'the body field is drawn').to.equal(true)\n\n field.click()\n await settle(200)\n\n expect(field.getAttribute('editing'), 'the field is being edited').to.equal('true')\n expect(opened, 'the popup editor was opened once').to.equal(1)\n })\n\n it('leaves a field edited in place as it was - nothing extra is pressed', async () => {\n opened = 0\n const columns = [buildColumn({ type: 'string', name: 'name', header: 'name', record: { editable: true } } as any)]\n const view = (await fixture(html`<ox-record-view .columns=${columns} .record=${{}}></ox-record-view>`)) as any\n await view.updateComplete\n await settle()\n const body = view.renderRoot.querySelector('ox-record-view-body') as any\n await body.updateComplete\n const field = body.renderRoot.querySelector('ox-grid-field') as any\n field.click()\n await settle(200)\n expect(field.getAttribute('editing')).to.equal('true')\n expect(opened).to.equal(0)\n })\n})\n"]}
@@ -1 +0,0 @@
1
- export {};
@@ -1,48 +0,0 @@
1
- import { expect } from '@open-wc/testing';
2
- import { render } from 'lit';
3
- import { OxGristRendererDate } from '../src/renderers/ox-grist-renderer-date.js';
4
- /**
5
- * 'YYYY-MM-DD' 는 달력의 날이다. 브라우저가 UTC 서쪽에 있어도 그 날 그대로 나와야 한다.
6
- *
7
- * 시험 브라우저의 시간대는 고를 수 없으므로, 시간대를 적지 않은 Intl.DateTimeFormat 을 America/Tijuana
8
- * 로 돌린다 — 그 시간대의 브라우저가 날짜를 적는 길과 같다.
9
- */
10
- const WEST = 'America/Tijuana';
11
- function renderText(value, type) {
12
- const column = { type, record: {} };
13
- const host = document.createElement('div');
14
- render(OxGristRendererDate(value, column, {}, 0, undefined), host);
15
- return host.textContent.trim();
16
- }
17
- describe('OxGristRendererDate — calendar day', () => {
18
- const Original = Intl.DateTimeFormat;
19
- beforeEach(() => {
20
- ;
21
- Intl.DateTimeFormat = function (locales, options = {}) {
22
- return new Original(locales, { timeZone: WEST, ...options });
23
- };
24
- });
25
- afterEach(() => {
26
- ;
27
- Intl.DateTimeFormat = Original;
28
- });
29
- it("renders '2025-12-31' as Dec 31 west of UTC", () => {
30
- const expected = new Original(undefined, { year: 'numeric', month: 'numeric', day: 'numeric', timeZone: 'UTC' }).format(Date.UTC(2025, 11, 31));
31
- expect(renderText('2025-12-31', 'date')).to.equal(expected);
32
- });
33
- it('still renders a datetime instant in the browser time zone', () => {
34
- // 2025-12-31T03:00Z is Dec 30 evening in Tijuana.
35
- const text = renderText('2025-12-31T03:00:00Z', 'datetime');
36
- const expected = new Original(undefined, {
37
- year: 'numeric',
38
- month: 'numeric',
39
- day: 'numeric',
40
- hour: 'numeric',
41
- minute: '2-digit',
42
- hour12: false,
43
- timeZone: WEST
44
- }).format(new Date('2025-12-31T03:00:00Z'));
45
- expect(text).to.equal(expected);
46
- });
47
- });
48
- //# sourceMappingURL=renderer-date-calendar-day.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"renderer-date-calendar-day.test.js","sourceRoot":"","sources":["../../test/renderer-date-calendar-day.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,KAAK,CAAA;AAE5B,OAAO,EAAE,mBAAmB,EAAE,MAAM,4CAA4C,CAAA;AAEhF;;;;;GAKG;AACH,MAAM,IAAI,GAAG,iBAAiB,CAAA;AAE9B,SAAS,UAAU,CAAC,KAAU,EAAE,IAAY;IAC1C,MAAM,MAAM,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAS,CAAA;IAC1C,MAAM,IAAI,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAA;IAC1C,MAAM,CAAC,mBAAmB,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,EAAE,SAAgB,CAAQ,EAAE,IAAI,CAAC,CAAA;IAChF,OAAO,IAAI,CAAC,WAAY,CAAC,IAAI,EAAE,CAAA;AACjC,CAAC;AAED,QAAQ,CAAC,oCAAoC,EAAE,GAAG,EAAE;IAClD,MAAM,QAAQ,GAAG,IAAI,CAAC,cAAc,CAAA;IAEpC,UAAU,CAAC,GAAG,EAAE;QACd,CAAC;QAAC,IAAY,CAAC,cAAc,GAAG,UAAU,O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AC,CAAA;AACJ,CAAC,CAAC,CAAA","sourcesContent":["import { expect } from '@open-wc/testing'\nimport { render } from 'lit'\n\nimport { OxGristRendererDate } from '../src/renderers/ox-grist-renderer-date.js'\n\n/**\n * 'YYYY-MM-DD' 는 달력의 날이다. 브라우저가 UTC 서쪽에 있어도 그 날 그대로 나와야 한다.\n *\n * 시험 브라우저의 시간대는 고를 수 없으므로, 시간대를 적지 않은 Intl.DateTimeFormat 을 America/Tijuana\n * 로 돌린다 — 그 시간대의 브라우저가 날짜를 적는 길과 같다.\n */\nconst WEST = 'America/Tijuana'\n\nfunction renderText(value: any, type: string): string {\n const column = { type, record: {} } as any\n const host = document.createElement('div')\n render(OxGristRendererDate(value, column, {}, 0, undefined as any) as any, host)\n return host.textContent!.trim()\n}\n\ndescribe('OxGristRendererDate — calendar day', () => {\n const Original = Intl.DateTimeFormat\n\n beforeEach(() => {\n ;(Intl as any).DateTimeFormat = function (locales?: any, options: any = {}) {\n return new Original(locales, { timeZone: WEST, ...options })\n }\n })\n\n afterEach(() => {\n ;(Intl as any).DateTimeFormat = Original\n })\n\n it(\"renders '2025-12-31' as Dec 31 west of UTC\", () => {\n const expected = new Original(undefined, { year: 'numeric', month: 'numeric', day: 'numeric', timeZone: 'UTC' }).format(\n Date.UTC(2025, 11, 31)\n )\n expect(renderText('2025-12-31', 'date')).to.equal(expected)\n })\n\n it('still renders a datetime instant in the browser time zone', () => {\n // 2025-12-31T03:00Z is Dec 30 evening in Tijuana.\n const text = renderText('2025-12-31T03:00:00Z', 'datetime')\n const expected = new Original(undefined, {\n year: 'numeric',\n month: 'numeric',\n day: 'numeric',\n hour: 'numeric',\n minute: '2-digit',\n hour12: false,\n timeZone: WEST\n }).format(new Date('2025-12-31T03:00:00Z'))\n expect(text).to.equal(expected)\n })\n})\n"]}
@@ -1 +0,0 @@
1
- export {};