@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.
- package/dist/src/filters/filter-select-buttons.js +4 -1
- package/dist/src/filters/pill-choice.d.ts +4 -6
- package/dist/src/filters/pill-choice.js +9 -14
- package/dist/src/gutters/gutter-button.js +2 -4
- package/dist/stories/accumulator-format.stories.d.ts +41 -0
- package/dist/stories/accumulator-format.stories.js +241 -0
- package/dist/stories/append-position.stories.d.ts +8 -0
- package/dist/stories/append-position.stories.js +183 -0
- package/dist/stories/barcode-input-filter.stories.d.ts +33 -0
- package/dist/stories/barcode-input-filter.stories.js +185 -0
- package/dist/stories/bounded-select-filters.stories.d.ts +25 -0
- package/dist/stories/bounded-select-filters.stories.js +283 -0
- package/dist/stories/bounded-select-record.stories.d.ts +25 -0
- package/dist/stories/bounded-select-record.stories.js +286 -0
- package/dist/stories/click-event-custom.stories.d.ts +45 -0
- package/dist/stories/click-event-custom.stories.js +248 -0
- package/dist/stories/click-event.stories.d.ts +45 -0
- package/dist/stories/click-event.stories.js +243 -0
- package/dist/stories/creatable-only-column.stories.d.ts +29 -0
- package/dist/stories/creatable-only-column.stories.js +232 -0
- package/dist/stories/default-filters.stories.d.ts +26 -0
- package/dist/stories/default-filters.stories.js +219 -0
- package/dist/stories/dynamic-editable.stories.d.ts +25 -0
- package/dist/stories/dynamic-editable.stories.js +293 -0
- package/dist/stories/empty-sorters.stories.d.ts +25 -0
- package/dist/stories/empty-sorters.stories.js +162 -0
- package/dist/stories/explicit-fetch.stories.d.ts +25 -0
- package/dist/stories/explicit-fetch.stories.js +166 -0
- package/dist/stories/fixed-column.stories.d.ts +26 -0
- package/dist/stories/fixed-column.stories.js +383 -0
- package/dist/stories/grid-setting.stories.d.ts +47 -0
- package/dist/stories/grid-setting.stories.js +453 -0
- package/dist/stories/grist-modes.stories.d.ts +37 -0
- package/dist/stories/grist-modes.stories.js +416 -0
- package/dist/stories/group-header.stories.d.ts +26 -0
- package/dist/stories/group-header.stories.js +410 -0
- package/dist/stories/record-view.stories.d.ts +24 -0
- package/dist/stories/record-view.stories.js +125 -0
- package/dist/stories/secret.stories.d.ts +37 -0
- package/dist/stories/secret.stories.js +219 -0
- package/dist/stories/textarea.stories.d.ts +37 -0
- package/dist/stories/textarea.stories.js +229 -0
- package/dist/stories/tree-column-with-checkbox.stories.d.ts +26 -0
- package/dist/stories/tree-column-with-checkbox.stories.js +267 -0
- package/dist/stories/tree-column.stories.d.ts +26 -0
- package/dist/stories/tree-column.stories.js +266 -0
- package/package.json +28 -13
- package/CHANGELOG.md +0 -7721
- package/dist/src/accumulator/accumulator.js.map +0 -1
- package/dist/src/configure/column-builder.js.map +0 -1
- package/dist/src/configure/config-builder.js.map +0 -1
- package/dist/src/configure/filters-option-builder.js.map +0 -1
- package/dist/src/configure/imex-option-builder.js.map +0 -1
- package/dist/src/configure/list-option-builder.js.map +0 -1
- package/dist/src/configure/rows-option-builder.js.map +0 -1
- package/dist/src/configure/tree-option-builder.js.map +0 -1
- package/dist/src/configure/zero-config.js.map +0 -1
- package/dist/src/const.js.map +0 -1
- package/dist/src/data-card/data-card-field.js.map +0 -1
- package/dist/src/data-card/data-card-gutter-menu.js.map +0 -1
- package/dist/src/data-card/data-card-gutter.js.map +0 -1
- package/dist/src/data-card/data-card.js.map +0 -1
- package/dist/src/data-card/event-handlers/record-card-click-handler.js.map +0 -1
- package/dist/src/data-card/event-handlers/record-card-dblclick-handler.js.map +0 -1
- package/dist/src/data-card/ox-card-thumb.js.map +0 -1
- package/dist/src/data-card/record-card.js.map +0 -1
- package/dist/src/data-consumer.js.map +0 -1
- package/dist/src/data-grid/data-grid-accum-field.js.map +0 -1
- package/dist/src/data-grid/data-grid-body-style.js.map +0 -1
- package/dist/src/data-grid/data-grid-body.js.map +0 -1
- package/dist/src/data-grid/data-grid-field.js.map +0 -1
- package/dist/src/data-grid/data-grid-footer.js.map +0 -1
- package/dist/src/data-grid/data-grid-header.js.map +0 -1
- package/dist/src/data-grid/data-grid.js.map +0 -1
- package/dist/src/data-grid/event-handlers/data-grid-body-click-handler.js.map +0 -1
- package/dist/src/data-grid/event-handlers/data-grid-body-contextmenu-handler.js.map +0 -1
- package/dist/src/data-grid/event-handlers/data-grid-body-dblclick-handler.js.map +0 -1
- package/dist/src/data-grid/event-handlers/data-grid-body-focus-change-handler.js.map +0 -1
- package/dist/src/data-grid/event-handlers/data-grid-body-keydown-handler.js.map +0 -1
- package/dist/src/data-grist.js.map +0 -1
- package/dist/src/data-list/data-list-field.js.map +0 -1
- package/dist/src/data-list/data-list-gutter.js.map +0 -1
- package/dist/src/data-list/data-list.js.map +0 -1
- package/dist/src/data-list/event-handlers/record-partial-click-handler.js.map +0 -1
- package/dist/src/data-list/event-handlers/record-partial-dblclick-handler.js.map +0 -1
- package/dist/src/data-list/event-handlers/record-partial-long-press-handler.js.map +0 -1
- package/dist/src/data-list/record-partial.js.map +0 -1
- package/dist/src/data-manipulator.js.map +0 -1
- package/dist/src/data-provider.js.map +0 -1
- package/dist/src/data-report/data-report-body-style.js.map +0 -1
- package/dist/src/data-report/data-report-body.js.map +0 -1
- package/dist/src/data-report/data-report-component.js.map +0 -1
- package/dist/src/data-report/data-report-field.js.map +0 -1
- package/dist/src/data-report/data-report-header.js.map +0 -1
- package/dist/src/data-report/event-handlers/data-report-body-click-handler.js.map +0 -1
- package/dist/src/data-report/event-handlers/data-report-body-dblclick-handler.js.map +0 -1
- package/dist/src/data-report/event-handlers/data-report-body-keydown-handler.js.map +0 -1
- package/dist/src/data-report.js.map +0 -1
- package/dist/src/edit-rebase.js.map +0 -1
- package/dist/src/editors/index.js.map +0 -1
- package/dist/src/editors/ox-grist-editor-checkbox.js.map +0 -1
- package/dist/src/editors/ox-grist-editor-color.js.map +0 -1
- package/dist/src/editors/ox-grist-editor-date.js.map +0 -1
- package/dist/src/editors/ox-grist-editor-datetime.js.map +0 -1
- package/dist/src/editors/ox-grist-editor-email.js.map +0 -1
- package/dist/src/editors/ox-grist-editor-file.js.map +0 -1
- package/dist/src/editors/ox-grist-editor-image.js.map +0 -1
- package/dist/src/editors/ox-grist-editor-json5.js.map +0 -1
- package/dist/src/editors/ox-grist-editor-month.js.map +0 -1
- package/dist/src/editors/ox-grist-editor-multiple-select.js.map +0 -1
- package/dist/src/editors/ox-grist-editor-number.js.map +0 -1
- package/dist/src/editors/ox-grist-editor-password.js.map +0 -1
- package/dist/src/editors/ox-grist-editor-secret.js.map +0 -1
- package/dist/src/editors/ox-grist-editor-select.js.map +0 -1
- package/dist/src/editors/ox-grist-editor-tel.js.map +0 -1
- package/dist/src/editors/ox-grist-editor-text-select.js.map +0 -1
- package/dist/src/editors/ox-grist-editor-text.js.map +0 -1
- package/dist/src/editors/ox-grist-editor-textarea.js.map +0 -1
- package/dist/src/editors/ox-grist-editor-time.js.map +0 -1
- package/dist/src/editors/ox-grist-editor-timezone.js.map +0 -1
- package/dist/src/editors/ox-grist-editor-tree.js.map +0 -1
- package/dist/src/editors/ox-grist-editor-varname.js.map +0 -1
- package/dist/src/editors/ox-grist-editor-week.js.map +0 -1
- package/dist/src/editors/ox-grist-editor.js.map +0 -1
- package/dist/src/editors/ox-input-tree.js.map +0 -1
- package/dist/src/editors/ox-popup-code-input.js.map +0 -1
- package/dist/src/editors/registry.js.map +0 -1
- package/dist/src/empty-note-render.js.map +0 -1
- package/dist/src/empty-note.js.map +0 -1
- package/dist/src/filters/filter-checkbox.js.map +0 -1
- package/dist/src/filters/filter-input-barcode.js.map +0 -1
- package/dist/src/filters/filter-input.js.map +0 -1
- package/dist/src/filters/filter-ownership.js.map +0 -1
- package/dist/src/filters/filter-range-date.js.map +0 -1
- package/dist/src/filters/filter-range-number.js.map +0 -1
- package/dist/src/filters/filter-select-buttons.js.map +0 -1
- package/dist/src/filters/filter-select.js.map +0 -1
- package/dist/src/filters/filter-styles.js.map +0 -1
- package/dist/src/filters/filters-form.js.map +0 -1
- package/dist/src/filters/index.js.map +0 -1
- package/dist/src/filters/pill-choice.js.map +0 -1
- package/dist/src/filters/registry.js.map +0 -1
- package/dist/src/formatters/date-formatter.js.map +0 -1
- package/dist/src/formatters/index.js.map +0 -1
- package/dist/src/formatters/number-formatter.js.map +0 -1
- package/dist/src/formatters/registry.js.map +0 -1
- package/dist/src/formatters/text-formatter.js.map +0 -1
- package/dist/src/group-heading.js.map +0 -1
- package/dist/src/gutters/gutter-button.js.map +0 -1
- package/dist/src/gutters/gutter-dirty.js.map +0 -1
- package/dist/src/gutters/gutter-row-selector.js.map +0 -1
- package/dist/src/gutters/gutter-sequence.js.map +0 -1
- package/dist/src/gutters/index.js.map +0 -1
- package/dist/src/gutters/registry.js.map +0 -1
- package/dist/src/handlers/contextmenu-tree-mutation.js.map +0 -1
- package/dist/src/handlers/index.js.map +0 -1
- package/dist/src/handlers/move-down.js.map +0 -1
- package/dist/src/handlers/move-up.js.map +0 -1
- package/dist/src/handlers/record-copy.js.map +0 -1
- package/dist/src/handlers/record-delete.js.map +0 -1
- package/dist/src/handlers/record-view-handler.js.map +0 -1
- package/dist/src/handlers/registry.js.map +0 -1
- package/dist/src/handlers/select-row-toggle.js.map +0 -1
- package/dist/src/handlers/select-row.js.map +0 -1
- package/dist/src/index.js.map +0 -1
- package/dist/src/personalizer/index.js.map +0 -1
- package/dist/src/personalizer/ox-grist-filter-personalizer.js.map +0 -1
- package/dist/src/personalizer/ox-grist-personalizer.js.map +0 -1
- package/dist/src/personalizer/personalizer-chrome.js.map +0 -1
- package/dist/src/record-view/event-handlers/record-view-body-click-handler.js.map +0 -1
- package/dist/src/record-view/event-handlers/record-view-body-keydown-handler.js.map +0 -1
- package/dist/src/record-view/index.js.map +0 -1
- package/dist/src/record-view/ox-record-creator.js.map +0 -1
- package/dist/src/record-view/record-view-body.js.map +0 -1
- package/dist/src/record-view/record-view-handler.js.map +0 -1
- package/dist/src/record-view/record-view.js.map +0 -1
- package/dist/src/renderers/index.js.map +0 -1
- package/dist/src/renderers/ox-grist-renderer-boolean.js.map +0 -1
- package/dist/src/renderers/ox-grist-renderer-color.js.map +0 -1
- package/dist/src/renderers/ox-grist-renderer-date.js.map +0 -1
- package/dist/src/renderers/ox-grist-renderer-file.js.map +0 -1
- package/dist/src/renderers/ox-grist-renderer-image.js.map +0 -1
- package/dist/src/renderers/ox-grist-renderer-json5.js.map +0 -1
- package/dist/src/renderers/ox-grist-renderer-link.js.map +0 -1
- package/dist/src/renderers/ox-grist-renderer-password.js.map +0 -1
- package/dist/src/renderers/ox-grist-renderer-progress.js.map +0 -1
- package/dist/src/renderers/ox-grist-renderer-secret.js.map +0 -1
- package/dist/src/renderers/ox-grist-renderer-select.js.map +0 -1
- package/dist/src/renderers/ox-grist-renderer-sparkline.js.map +0 -1
- package/dist/src/renderers/ox-grist-renderer-text-select.js.map +0 -1
- package/dist/src/renderers/ox-grist-renderer-text.js.map +0 -1
- package/dist/src/renderers/ox-grist-renderer-textarea.js.map +0 -1
- package/dist/src/renderers/ox-grist-renderer-tree.js.map +0 -1
- package/dist/src/renderers/ox-grist-renderer.js.map +0 -1
- package/dist/src/renderers/registry.js.map +0 -1
- package/dist/src/sorters/sorters-control.js.map +0 -1
- package/dist/src/types.js.map +0 -1
- package/dist/src/utils/column-text.js.map +0 -1
- package/dist/src/utils/field-value.js.map +0 -1
- package/dist/src/utils/index.js.map +0 -1
- package/dist/src/utils/list-param.js.map +0 -1
- package/dist/src/utils/select-range.js.map +0 -1
- package/dist/src/utils/supports-passive.js.map +0 -1
- package/dist/test/accessible-name.test.d.ts +0 -2
- package/dist/test/accessible-name.test.js +0 -324
- package/dist/test/accessible-name.test.js.map +0 -1
- package/dist/test/accumulator-labels.test.d.ts +0 -1
- package/dist/test/accumulator-labels.test.js +0 -32
- package/dist/test/accumulator-labels.test.js.map +0 -1
- package/dist/test/address-intents.test.d.ts +0 -1
- package/dist/test/address-intents.test.js +0 -201
- package/dist/test/address-intents.test.js.map +0 -1
- package/dist/test/card-selector.test.d.ts +0 -1
- package/dist/test/card-selector.test.js +0 -71
- package/dist/test/card-selector.test.js.map +0 -1
- package/dist/test/card-thumb.test.d.ts +0 -1
- package/dist/test/card-thumb.test.js +0 -44
- package/dist/test/card-thumb.test.js.map +0 -1
- package/dist/test/card-totals-narrow.test.d.ts +0 -1
- package/dist/test/card-totals-narrow.test.js +0 -103
- package/dist/test/card-totals-narrow.test.js.map +0 -1
- package/dist/test/cell-button-row-height.test.d.ts +0 -1
- package/dist/test/cell-button-row-height.test.js +0 -53
- package/dist/test/cell-button-row-height.test.js.map +0 -1
- package/dist/test/column-resize.test.d.ts +0 -1
- package/dist/test/column-resize.test.js +0 -153
- package/dist/test/column-resize.test.js.map +0 -1
- package/dist/test/control-heights.test.d.ts +0 -1
- package/dist/test/control-heights.test.js +0 -25
- package/dist/test/control-heights.test.js.map +0 -1
- package/dist/test/count-handler.test.d.ts +0 -1
- package/dist/test/count-handler.test.js +0 -56
- package/dist/test/count-handler.test.js.map +0 -1
- package/dist/test/create-paste-policy.test.d.ts +0 -1
- package/dist/test/create-paste-policy.test.js +0 -159
- package/dist/test/create-paste-policy.test.js.map +0 -1
- package/dist/test/data-integrity.test.d.ts +0 -1
- package/dist/test/data-integrity.test.js +0 -145
- package/dist/test/data-integrity.test.js.map +0 -1
- package/dist/test/date-fields.test.d.ts +0 -2
- package/dist/test/date-fields.test.js +0 -138
- package/dist/test/date-fields.test.js.map +0 -1
- package/dist/test/destructive-actions.test.d.ts +0 -11
- package/dist/test/destructive-actions.test.js +0 -147
- package/dist/test/destructive-actions.test.js.map +0 -1
- package/dist/test/edit-lifecycle.test.d.ts +0 -2
- package/dist/test/edit-lifecycle.test.js +0 -270
- package/dist/test/edit-lifecycle.test.js.map +0 -1
- package/dist/test/edit-rebase.test.d.ts +0 -1
- package/dist/test/edit-rebase.test.js +0 -185
- package/dist/test/edit-rebase.test.js.map +0 -1
- package/dist/test/editor-commit.test.d.ts +0 -2
- package/dist/test/editor-commit.test.js +0 -68
- package/dist/test/editor-commit.test.js.map +0 -1
- package/dist/test/fetch-failure-state.test.d.ts +0 -1
- package/dist/test/fetch-failure-state.test.js +0 -129
- package/dist/test/fetch-failure-state.test.js.map +0 -1
- package/dist/test/field-contains-content.test.d.ts +0 -1
- package/dist/test/field-contains-content.test.js +0 -101
- package/dist/test/field-contains-content.test.js.map +0 -1
- package/dist/test/field-hint.test.d.ts +0 -2
- package/dist/test/field-hint.test.js +0 -54
- package/dist/test/field-hint.test.js.map +0 -1
- package/dist/test/filter-labels.test.d.ts +0 -2
- package/dist/test/filter-labels.test.js +0 -140
- package/dist/test/filter-labels.test.js.map +0 -1
- package/dist/test/filter-ownership.test.d.ts +0 -1
- package/dist/test/filter-ownership.test.js +0 -83
- package/dist/test/filter-ownership.test.js.map +0 -1
- package/dist/test/filter-select-buttons-count.test.d.ts +0 -1
- package/dist/test/filter-select-buttons-count.test.js +0 -36
- package/dist/test/filter-select-buttons-count.test.js.map +0 -1
- package/dist/test/filter-typing.test.d.ts +0 -2
- package/dist/test/filter-typing.test.js +0 -66
- package/dist/test/filter-typing.test.js.map +0 -1
- package/dist/test/filters-phone-width.test.d.ts +0 -1
- package/dist/test/filters-phone-width.test.js +0 -33
- package/dist/test/filters-phone-width.test.js.map +0 -1
- package/dist/test/filters-phone-wrap.test.d.ts +0 -1
- package/dist/test/filters-phone-wrap.test.js +0 -17
- package/dist/test/filters-phone-wrap.test.js.map +0 -1
- package/dist/test/filters-pills.test.d.ts +0 -2
- package/dist/test/filters-pills.test.js +0 -149
- package/dist/test/filters-pills.test.js.map +0 -1
- package/dist/test/first-click-stays.test.d.ts +0 -1
- package/dist/test/first-click-stays.test.js +0 -77
- package/dist/test/first-click-stays.test.js.map +0 -1
- package/dist/test/fixed-column-opaque.test.d.ts +0 -1
- package/dist/test/fixed-column-opaque.test.js +0 -134
- package/dist/test/fixed-column-opaque.test.js.map +0 -1
- package/dist/test/flexible-columns.test.d.ts +0 -1
- package/dist/test/flexible-columns.test.js +0 -134
- package/dist/test/flexible-columns.test.js.map +0 -1
- package/dist/test/grid-single-scroller.test.d.ts +0 -1
- package/dist/test/grid-single-scroller.test.js +0 -107
- package/dist/test/grid-single-scroller.test.js.map +0 -1
- package/dist/test/group-heading.test.d.ts +0 -1
- package/dist/test/group-heading.test.js +0 -208
- package/dist/test/group-heading.test.js.map +0 -1
- package/dist/test/latest-fetch-wins.test.d.ts +0 -1
- package/dist/test/latest-fetch-wins.test.js +0 -91
- package/dist/test/latest-fetch-wins.test.js.map +0 -1
- package/dist/test/list-defaults.test.d.ts +0 -2
- package/dist/test/list-defaults.test.js +0 -146
- package/dist/test/list-defaults.test.js.map +0 -1
- package/dist/test/list-records.test.d.ts +0 -1
- package/dist/test/list-records.test.js +0 -46
- package/dist/test/list-records.test.js.map +0 -1
- package/dist/test/office-density.test.d.ts +0 -1
- package/dist/test/office-density.test.js +0 -52
- package/dist/test/office-density.test.js.map +0 -1
- package/dist/test/page-errors.d.ts +0 -1
- package/dist/test/page-errors.js +0 -44
- package/dist/test/page-errors.js.map +0 -1
- package/dist/test/paste-integrity.test.d.ts +0 -1
- package/dist/test/paste-integrity.test.js +0 -163
- package/dist/test/paste-integrity.test.js.map +0 -1
- package/dist/test/record-card-height.test.d.ts +0 -1
- package/dist/test/record-card-height.test.js +0 -15
- package/dist/test/record-card-height.test.js.map +0 -1
- package/dist/test/record-view-popup-editor.test.d.ts +0 -1
- package/dist/test/record-view-popup-editor.test.js +0 -71
- package/dist/test/record-view-popup-editor.test.js.map +0 -1
- package/dist/test/renderer-date-calendar-day.test.d.ts +0 -1
- package/dist/test/renderer-date-calendar-day.test.js +0 -48
- package/dist/test/renderer-date-calendar-day.test.js.map +0 -1
- package/dist/test/request-generation.test.d.ts +0 -1
- package/dist/test/request-generation.test.js +0 -153
- package/dist/test/request-generation.test.js.map +0 -1
- package/dist/test/resubmit.test.d.ts +0 -1
- package/dist/test/resubmit.test.js +0 -83
- package/dist/test/resubmit.test.js.map +0 -1
- package/dist/test/row-hover-visible.test.d.ts +0 -1
- package/dist/test/row-hover-visible.test.js +0 -139
- package/dist/test/row-hover-visible.test.js.map +0 -1
- package/dist/test/search-term.test.d.ts +0 -1
- package/dist/test/search-term.test.js +0 -108
- package/dist/test/search-term.test.js.map +0 -1
- package/dist/test/searchable-select.test.d.ts +0 -1
- package/dist/test/searchable-select.test.js +0 -65
- package/dist/test/searchable-select.test.js.map +0 -1
- package/dist/test/select-empty-value.test.d.ts +0 -1
- package/dist/test/select-empty-value.test.js +0 -61
- package/dist/test/select-empty-value.test.js.map +0 -1
- package/dist/test/shift-range-select.test.d.ts +0 -1
- package/dist/test/shift-range-select.test.js +0 -100
- package/dist/test/shift-range-select.test.js.map +0 -1
- package/dist/test/sparkline-renderer.test.d.ts +0 -1
- package/dist/test/sparkline-renderer.test.js +0 -36
- package/dist/test/sparkline-renderer.test.js.map +0 -1
- package/dist/test/wheel-one-scroller.test.d.ts +0 -2
- package/dist/test/wheel-one-scroller.test.js +0 -275
- package/dist/test/wheel-one-scroller.test.js.map +0 -1
- package/dist/tsconfig.tsbuildinfo +0 -1
- package/docs/USER_GUIDE.md +0 -144
- package/docs/configuration/README.md +0 -68
- package/docs/configuration/columns.md +0 -391
- package/docs/configuration/editors.md +0 -53
- package/docs/configuration/events.md +0 -44
- package/docs/configuration/i18n.md +0 -40
- package/docs/configuration/options.md +0 -100
- package/docs/configuration/theme.md +0 -39
- package/docs/default-value/default-value.md +0 -97
- package/docs/default-value/value-generator/date-generator.md +0 -69
- package/docs/default-value/value-generator/hour-time-generator.md +0 -76
- package/docs/default-value/value-generator/minute-time-generator.md +0 -76
- package/docs/default-value/value-generator/month-date-generator.md +0 -45
- package/docs/default-value/value-generator/now-generator.md +0 -68
- package/docs/default-value/value-generator/time-generator.md +0 -71
- package/docs/default-value/value-generator/today-generator.md +0 -68
- package/docs/default-value/value-generator/week-date-generator.md +0 -74
- package/docs/default-value/value-generator/year-date-generator.md +0 -74
- package/docs/gutter/gutter.md +0 -7
- package/test/accessible-name.test.ts +0 -408
- package/test/accumulator-labels.test.ts +0 -36
- package/test/address-intents.test.ts +0 -202
- package/test/card-selector.test.ts +0 -82
- package/test/card-thumb.test.ts +0 -51
- package/test/card-totals-narrow.test.ts +0 -128
- package/test/cell-button-row-height.test.ts +0 -63
- package/test/column-resize.test.ts +0 -206
- package/test/control-heights.test.ts +0 -31
- package/test/count-handler.test.ts +0 -61
- package/test/create-paste-policy.test.ts +0 -177
- package/test/data-integrity.test.ts +0 -150
- package/test/date-fields.test.ts +0 -163
- package/test/destructive-actions.test.ts +0 -137
- package/test/edit-lifecycle.test.ts +0 -302
- package/test/edit-rebase.test.ts +0 -220
- package/test/editor-commit.test.ts +0 -103
- package/test/fetch-failure-state.test.ts +0 -156
- package/test/field-contains-content.test.ts +0 -125
- package/test/field-hint.test.ts +0 -60
- package/test/filter-labels.test.ts +0 -153
- package/test/filter-ownership.test.ts +0 -104
- package/test/filter-select-buttons-count.test.ts +0 -38
- package/test/filter-typing.test.ts +0 -77
- package/test/filters-phone-width.test.ts +0 -35
- package/test/filters-phone-wrap.test.ts +0 -22
- package/test/filters-pills.test.ts +0 -162
- package/test/first-click-stays.test.ts +0 -101
- package/test/fixed-column-opaque.test.ts +0 -183
- package/test/flexible-columns.test.ts +0 -181
- package/test/grid-single-scroller.test.ts +0 -150
- package/test/group-heading.test.ts +0 -244
- package/test/latest-fetch-wins.test.ts +0 -114
- package/test/list-defaults.test.ts +0 -164
- package/test/list-records.test.ts +0 -58
- package/test/office-density.test.ts +0 -57
- package/test/page-errors.ts +0 -43
- package/test/paste-integrity.test.ts +0 -168
- package/test/record-card-height.test.ts +0 -19
- package/test/record-view-popup-editor.test.ts +0 -84
- package/test/renderer-date-calendar-day.test.ts +0 -55
- package/test/request-generation.test.ts +0 -163
- package/test/resubmit.test.ts +0 -96
- package/test/row-hover-visible.test.ts +0 -180
- package/test/search-term.test.ts +0 -156
- package/test/searchable-select.test.ts +0 -77
- package/test/select-empty-value.test.ts +0 -71
- package/test/shift-range-select.test.ts +0 -112
- package/test/sparkline-renderer.test.ts +0 -40
- package/test/wheel-one-scroller.test.ts +0 -359
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"address-intents.test.js","sourceRoot":"","sources":["../../test/address-intents.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AAClD,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC1B,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAC3E,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAA;AAE/E,OAAO,sBAAsB,CAAA;AAE7B,MAAM,IAAI,GAAG,GAAG,EAAE,CAAC,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,CAAA;AACjE,MAAM,MAAM,GAAG,GAAG,EAAE,CAAE,MAAc,CAAC,UAAU,CAAA;AAC/C,MAAM,OAAO,GAAG,CAAC,KAAa,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAA;AACpF,MAAM,OAAO,GAAG,CAAC,KAAa,EAAE,EAAE,CAAC,IAAI,eAAe,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,EAAE,CAAA;AACrF,KAAK,UAAU,KAAK,CAAC,KAAoB;IACvC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC;QAC7B,IAAI,KAAK,EAAE;YAAE,OAAM;QACnB,MAAM,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,CAAA;IACtD,CAAC;IACD,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,C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EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAA;IAC7D,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;AACnB,CAAC,CAAC,CAAA","sourcesContent":["import { expect, fixture } from '@open-wc/testing'\nimport { html } from 'lit'\nimport { addressController, writeAddress } from '@operato/utils/address.js'\nimport { decodeListQuery, encodeListQuery } from '@operato/utils/list-query.js'\nimport type { DataGrist } from '../src/data-grist.js'\nimport '../src/data-grist.js'\n\nconst turn = () => new Promise(resolve => setTimeout(resolve, 0))\nconst native = () => (window as any).navigation\nconst filters = (month: number) => [{ name: 'month', operator: 'eq', value: month }]\nconst address = (month: number) => `?${encodeListQuery({ filters: filters(month) })}`\nasync function until(check: () => boolean) {\n for (let i = 0; i < 200; i++) {\n if (check()) return\n await new Promise(resolve => setTimeout(resolve, 5))\n }\n throw new Error('intent sequence did not settle')\n}\n\n/** Product oracle: only the latest accepted intent changes the query, records, edits or history. */\nclass Intended {\n entries: number[] = [10]\n cursor = 0\n edited = false\n reads = [10]\n get month() {\n return this.entries[this.cursor]\n }\n accept(month: number) {\n if (month === this.month) return\n this.entries.splice(++this.cursor)\n this.entries.push(month)\n this.edited = false\n this.reads.push(month)\n }\n back() {\n this.cursor--\n this.edited = false\n this.reads.push(this.month)\n }\n}\n\ndescribe('overlapping user intents against query and displayed state', () => {\n let previousOnError: typeof window.onerror\n const resizeNotice = (event: ErrorEvent) => {\n if (event.message.includes('ResizeObserver loop')) {\n event.preventDefault()\n event.stopImmediatePropagation()\n }\n }\n before(() => {\n window.addEventListener('error', resizeNotice, true)\n previousOnError = window.onerror\n window.onerror = (message, ...rest) =>\n String(message).includes('ResizeObserver loop') ? true : previousOnError?.call(window, message, ...rest)\n })\n after(() => {\n window.removeEventListener('error', resizeNotice, true)\n window.onerror = previousOnError\n })\n it('checks every edit, question, refusal, supersession, adoption and browser traversal', async () => {\n const controller = addressController()\n controller.registerQuery()\n const coverage = new Set<number>()\n for (let seed = 1; seed <= 12; seed++) {\n await writeAddress(address(10))\n const floorKey = native().currentEntry.key\n const reads: number[] = []\n let shown: number[] = []\n const grist = await fixture<DataGrist>(\n html`<ox-grist\n style=\"display:block;width:800px;height:400px\"\n .urlParamsSensitive=${true}\n .config=${{ columns: [{ name: 'month', header: 'month' }], pagination: { limit: 20 } }}\n .fetchHandler=${async ({ filters: list }: any) => {\n const month = Number(list.find((filter: any) => filter.name === 'month').value)\n reads.push(month)\n return { records: [{ id: String(month), month }], total: 1 }\n }}\n @list-adopted=${(event: CustomEvent) => {\n shown = event.detail.records.map((row: any) => row.month)\n }}\n ></ox-grist>`\n )\n await until(() => grist.data?.records?.[0]?.month === 10)\n const expected = new Intended()\n // Initial configuration may make the initial read once or more; subsequent intent reads must match exactly.\n reads.splice(0, reads.length, 10)\n let decision: ((answer: boolean) => void) | undefined\n let gated = false\n const stopGuard = controller.guard({\n discards: () => grist.dirtyRecords.length > 0,\n approve: change => {\n if (!grist.dirtyRecords.length) return true\n return new Promise<boolean>(resolve => {\n const endQuestion = gated ? controller.beginQuestion() : () => {}\n const finish = (answer: boolean) => {\n endQuestion()\n resolve(answer)\n }\n decision = finish\n change.signal.addEventListener('abort', () => finish(false), { once: true })\n })\n },\n committed: () => grist.reset()\n })\n const verify = async (step: string) => {\n await turn()\n await grist.updateComplete\n expect(grist.filters, step).to.deep.equal(filters(expected.month))\n expect(\n grist.data.records.map(row => row.month),\n step\n ).to.deep.equal([expected.month])\n expect(shown, step).to.deep.equal([expected.month])\n expect(grist.dirtyRecords.length > 0, step).to.equal(expected.edited)\n expect(reads, step).to.deep.equal(expected.reads)\n const entries = native().entries()\n const floor = entries.findIndex((entry: any) => entry.key === floorKey)\n expect(floor, step).to.be.at.least(0)\n expect(\n entries\n .slice(floor)\n .map((entry: any) => (decodeListQuery(new URL(entry.url).search).filters as any[])[0].value),\n step\n ).to.deep.equal(expected.entries)\n expect(native().currentEntry.index - floor, step).to.equal(expected.cursor)\n }\n let random = seed\n try {\n for (let step = 0; step < 18; step++) {\n random = (Math.imul(random, 1664525) + 1013904223) >>> 0\n const action = random % 5\n coverage.add(action)\n const label = `seed ${seed}, step ${step}, action ${action}`\n const next = 20 + seed * 100 + step\n // Real grid edit, independent of the oracle's edit flag.\n grist.dirtyData.records[0].__dirty__ = 'M'\n grist.dirtyData.records[0].memo = label\n grist.refresh()\n expected.edited = true\n await verify(label + ' edited')\n decision = undefined\n gated = action !== 2 && action !== 4\n const first = writeAddress(address(next))\n await turn()\n await verify(label + ' before decision')\n await until(() => !!decision)\n const answerFirst = decision!\n await verify(label + ' question pending')\n if (action === 0) {\n answerFirst(false)\n expect(await first, label).to.equal(false)\n } else if (action === 1) {\n // Requests made under a real modal question are rejected without fetching or changing the view.\n expect(await writeAddress(address(next + 10000)), label).to.equal(false)\n await verify(label + ' outside request refused')\n answerFirst(true)\n expect(await first, label).to.equal(true)\n expected.accept(next)\n } else if (action === 2) {\n // An asynchronous owner decision can be superseded before a dialog is installed.\n decision = undefined\n const second = writeAddress(address(next + 10000))\n await until(() => !!decision)\n decision!(true)\n expect(await second, label).to.equal(true)\n expected.accept(next + 10000)\n answerFirst(true)\n expect(await first, label).to.equal(false)\n } else if (action === 3) {\n answerFirst(true)\n expect(await first, label).to.equal(true)\n expected.accept(next)\n } else {\n if (expected.cursor > 0) {\n // Browser navigation aborts the outstanding application approval; an old yes cannot revive it.\n decision = undefined\n const movement = native().back()\n movement.finished.catch(() => {})\n await until(() => !!decision)\n decision!(true)\n await movement.finished\n expected.back()\n answerFirst(true)\n expect(await first, label).to.equal(false)\n } else {\n answerFirst(false)\n expect(await first, label).to.equal(false)\n }\n }\n await until(() => grist.data.records[0]?.month === expected.month)\n await verify(label + ' completed')\n }\n } finally {\n stopGuard()\n grist.remove()\n }\n }\n expect([...coverage].sort()).to.deep.equal([0, 1, 2, 3, 4])\n }).timeout(45000)\n})\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import '../src/data-grist.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/data-grist.js';
|
|
5
|
-
import { failOnPageErrors } from './page-errors.js';
|
|
6
|
-
/*
|
|
7
|
-
* A card's checkbox stands beside the title. It sat in the action row under the text, a line of its own far from
|
|
8
|
-
* what it selects (Office ledgers on a phone, 2026-11-05).
|
|
9
|
-
*/
|
|
10
|
-
const records = [{ id: '1', title: 'one', amount: 990000 }];
|
|
11
|
-
const config = (gutters) => ({
|
|
12
|
-
columns: [
|
|
13
|
-
...gutters,
|
|
14
|
-
{ type: 'string', name: 'title', header: 'title' },
|
|
15
|
-
{ type: 'integer', name: 'amount', header: 'amount' }
|
|
16
|
-
],
|
|
17
|
-
rows: { appendable: false, selectable: { multiple: true } },
|
|
18
|
-
list: { fields: ['title'], details: ['amount'] }
|
|
19
|
-
});
|
|
20
|
-
const idle = async (el) => {
|
|
21
|
-
while (!((await el.updateComplete) && (await el.grist.updateComplete)))
|
|
22
|
-
;
|
|
23
|
-
};
|
|
24
|
-
const cardOf = async (gutters) => {
|
|
25
|
-
const el = await fixture(html `<ox-grist style="width:340px;height:300px" mode="CARD" .config=${config(gutters)} .data=${{ records }}></ox-grist>`);
|
|
26
|
-
await idle(el);
|
|
27
|
-
const card = el.grist.renderRoot.querySelector('ox-record-card');
|
|
28
|
-
await card.updateComplete;
|
|
29
|
-
/* The icons draw after the card, and the card makes room for them when they do. */
|
|
30
|
-
await new Promise(resolve => requestAnimationFrame(() => requestAnimationFrame(resolve)));
|
|
31
|
-
return card;
|
|
32
|
-
};
|
|
33
|
-
describe('a card and its checkbox', () => {
|
|
34
|
-
failOnPageErrors();
|
|
35
|
-
it('stands in the top-right corner, on the title line, and takes no row of its own', async () => {
|
|
36
|
-
const card = await cardOf([{ type: 'gutter', gutterName: 'row-selector', multiple: true, forList: true }]);
|
|
37
|
-
const box = card.renderRoot.querySelector('ox-card-gutter');
|
|
38
|
-
const title = card.renderRoot.querySelector('ox-card-field[name]');
|
|
39
|
-
const detail = card.renderRoot.querySelector('[detail]');
|
|
40
|
-
expect(box, 'no checkbox').to.exist;
|
|
41
|
-
const cardBox = card.getBoundingClientRect();
|
|
42
|
-
const boxRect = box.getBoundingClientRect();
|
|
43
|
-
const titleRect = title.getBoundingClientRect();
|
|
44
|
-
expect(boxRect.top, 'the checkbox is not on the title line').to.be.below(titleRect.bottom);
|
|
45
|
-
expect(cardBox.right - boxRect.right, 'the checkbox is not at the right edge').to.be.below(16);
|
|
46
|
-
expect(titleRect.right, 'the title runs under the checkbox').to.be.at.most(boxRect.left);
|
|
47
|
-
expect(cardBox.bottom - detail.getBoundingClientRect().bottom, 'the card keeps a row under its text').to.be.below(16);
|
|
48
|
-
expect(card.renderRoot.querySelector('[gutters]'), 'an empty action row').to.equal(null);
|
|
49
|
-
});
|
|
50
|
-
/* The edit icon took a row of its own under the text, the column under the checkbox empty (2026-11-10). */
|
|
51
|
-
it('stands the other actions under the checkbox, and takes no row under the text', async () => {
|
|
52
|
-
const card = await cardOf([
|
|
53
|
-
{ type: 'gutter', gutterName: 'row-selector', multiple: true, forList: true },
|
|
54
|
-
{ type: 'gutter', gutterName: 'button', icon: 'edit', forList: true }
|
|
55
|
-
]);
|
|
56
|
-
const [box, edit] = Array.from(card.renderRoot.querySelectorAll('ox-card-gutter'));
|
|
57
|
-
const title = card.renderRoot.querySelector('ox-card-field[name]');
|
|
58
|
-
const detail = card.renderRoot.querySelector('[detail]');
|
|
59
|
-
expect(edit, 'no edit icon').to.exist;
|
|
60
|
-
const cardBox = card.getBoundingClientRect();
|
|
61
|
-
const boxRect = box.getBoundingClientRect();
|
|
62
|
-
const editRect = edit.getBoundingClientRect();
|
|
63
|
-
expect(editRect.top, 'the edit icon is not under the checkbox').to.be.at.least(boxRect.bottom - 1);
|
|
64
|
-
expect(editRect.top - boxRect.bottom, 'the edit icon stands far from the checkbox').to.be.below(12);
|
|
65
|
-
expect(Math.abs((editRect.left + editRect.right) / 2 - (boxRect.left + boxRect.right) / 2), 'not one column').to.be.below(2);
|
|
66
|
-
expect(title.getBoundingClientRect().right, 'the title runs under the icons').to.be.at.most(editRect.left);
|
|
67
|
-
expect(editRect.bottom, 'the edit icon hangs out of the card').to.be.at.most(cardBox.bottom);
|
|
68
|
-
expect(cardBox.bottom - Math.max(detail.getBoundingClientRect().bottom, editRect.bottom), 'a row left under the text').to.be.below(16);
|
|
69
|
-
});
|
|
70
|
-
});
|
|
71
|
-
//# sourceMappingURL=card-selector.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"card-selector.test.js","sourceRoot":"","sources":["../../test/card-selector.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,kBAAkB,CAAA;AAEnD;;;GAGG;AAEH,MAAM,OAAO,GAAG,CAAC,EAAE,EAAE,EAAE,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAA;AAC3D,MAAM,MAAM,GAAG,CAAC,OAAc,EAAE,EAAE,CAAC,CAAC;IAClC,OAAO,EAAE;QACP,GAAG,OAAO;QACV,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE;QAClD,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE;KACtD;IACD,IAAI,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE,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,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,EAAE,gBAAgB,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;QAC5H,MAAM,CAAC,KAAK,CAAC,qBAAqB,EAAE,CAAC,KAAK,EAAE,gCAAgC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAA;QAC1G,MAAM,CAAC,QAAQ,CAAC,MAAM,EAAE,qCAAqC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAA;QAC5F,MAAM,CAAC,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,qBAAqB,EAAE,CAAC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,EAAE,2BAA2B,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,CAAA;IACxI,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/data-grist.js'\nimport { DataGrist } from '../src/data-grist.js'\nimport { failOnPageErrors } from './page-errors.js'\n\n/*\n * A card's checkbox stands beside the title. It sat in the action row under the text, a line of its own far from\n * what it selects (Office ledgers on a phone, 2026-11-05).\n */\n\nconst records = [{ id: '1', title: 'one', amount: 990000 }]\nconst config = (gutters: any[]) => ({\n columns: [\n ...gutters,\n { type: 'string', name: 'title', header: 'title' },\n { type: 'integer', name: 'amount', header: 'amount' }\n ],\n rows: { appendable: false, selectable: { multiple: true } },\n list: { fields: ['title'], details: ['amount'] }\n})\n\nconst idle = async (el: DataGrist) => {\n while (!((await el.updateComplete) && (await el.grist.updateComplete)));\n}\n\nconst cardOf = async (gutters: any[]) => {\n const el = await fixture<DataGrist>(\n html`<ox-grist style=\"width:340px;height:300px\" mode=\"CARD\" .config=${config(gutters)} .data=${{ records }}></ox-grist>`\n )\n await idle(el)\n const card = el.grist.renderRoot.querySelector('ox-record-card') as any\n await card.updateComplete\n /* The icons draw after the card, and the card makes room for them when they do. */\n await new Promise(resolve => requestAnimationFrame(() => requestAnimationFrame(resolve)))\n return card as HTMLElement & { renderRoot: ShadowRoot }\n}\n\ndescribe('a card and its checkbox', () => {\n failOnPageErrors()\n\n it('stands in the top-right corner, on the title line, and takes no row of its own', async () => {\n const card = await cardOf([{ type: 'gutter', gutterName: 'row-selector', multiple: true, forList: true }])\n const box = card.renderRoot.querySelector('ox-card-gutter') as HTMLElement\n const title = card.renderRoot.querySelector('ox-card-field[name]') as HTMLElement\n const detail = card.renderRoot.querySelector('[detail]') as HTMLElement\n expect(box, 'no checkbox').to.exist\n\n const cardBox = card.getBoundingClientRect()\n const boxRect = box.getBoundingClientRect()\n const titleRect = title.getBoundingClientRect()\n expect(boxRect.top, 'the checkbox is not on the title line').to.be.below(titleRect.bottom)\n expect(cardBox.right - boxRect.right, 'the checkbox is not at the right edge').to.be.below(16)\n expect(titleRect.right, 'the title runs under the checkbox').to.be.at.most(boxRect.left)\n expect(cardBox.bottom - detail.getBoundingClientRect().bottom, 'the card keeps a row under its text').to.be.below(16)\n expect(card.renderRoot.querySelector('[gutters]'), 'an empty action row').to.equal(null)\n })\n\n /* The edit icon took a row of its own under the text, the column under the checkbox empty (2026-11-10). */\n it('stands the other actions under the checkbox, and takes no row under the text', async () => {\n const card = await cardOf([\n { type: 'gutter', gutterName: 'row-selector', multiple: true, forList: true },\n { type: 'gutter', gutterName: 'button', icon: 'edit', forList: true }\n ])\n const [box, edit] = Array.from(card.renderRoot.querySelectorAll('ox-card-gutter')) as HTMLElement[]\n const title = card.renderRoot.querySelector('ox-card-field[name]') as HTMLElement\n const detail = card.renderRoot.querySelector('[detail]') as HTMLElement\n expect(edit, 'no edit icon').to.exist\n\n const cardBox = card.getBoundingClientRect()\n const boxRect = box.getBoundingClientRect()\n const editRect = edit.getBoundingClientRect()\n expect(editRect.top, 'the edit icon is not under the checkbox').to.be.at.least(boxRect.bottom - 1)\n expect(editRect.top - boxRect.bottom, 'the edit icon stands far from the checkbox').to.be.below(12)\n expect(Math.abs((editRect.left + editRect.right) / 2 - (boxRect.left + boxRect.right) / 2), 'not one column').to.be.below(2)\n expect(title.getBoundingClientRect().right, 'the title runs under the icons').to.be.at.most(editRect.left)\n expect(editRect.bottom, 'the edit icon hangs out of the card').to.be.at.most(cardBox.bottom)\n expect(cardBox.bottom - Math.max(detail.getBoundingClientRect().bottom, editRect.bottom), 'a row left under the text').to.be.below(16)\n })\n})\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import '../src/data-card/ox-card-thumb.js';
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { expect, fixture, html } from '@open-wc/testing';
|
|
2
|
-
import '../src/data-card/ox-card-thumb.js';
|
|
3
|
-
/*
|
|
4
|
-
* The one picture cell of a catalog card (ADR-0117 amendment 2026-10-13): the picture whole, an icon when there is
|
|
5
|
-
* none, at most one marker in the top-left corner, and a seam under it.
|
|
6
|
-
*/
|
|
7
|
-
describe('ox-card-thumb', () => {
|
|
8
|
-
it('★ shows the picture whole, never cropped, with a seam under it', async () => {
|
|
9
|
-
const thumb = await fixture(html `<ox-card-thumb
|
|
10
|
-
style="--md-sys-color-outline-variant: rgb(200, 200, 200)"
|
|
11
|
-
src="data:image/gif;base64,R0lGODlhAQABAAAAACw="
|
|
12
|
-
alt="a board"
|
|
13
|
-
></ox-card-thumb>`);
|
|
14
|
-
const img = thumb.shadowRoot.querySelector('img');
|
|
15
|
-
expect(img.getAttribute('alt')).to.equal('a board');
|
|
16
|
-
expect(getComputedStyle(img).objectFit).to.equal('contain');
|
|
17
|
-
expect(getComputedStyle(thumb).borderBottomStyle).to.equal('solid');
|
|
18
|
-
expect(thumb.shadowRoot.querySelector('[empty]')).to.equal(null);
|
|
19
|
-
});
|
|
20
|
-
it('★ draws its icon when there is no picture, or the empty slot when one is given', async () => {
|
|
21
|
-
const bare = await fixture(html `<ox-card-thumb icon="dashboard"></ox-card-thumb>`);
|
|
22
|
-
expect(bare.shadowRoot.querySelector('[empty] md-icon').textContent).to.equal('dashboard');
|
|
23
|
-
const marked = await fixture(html `<ox-card-thumb><span slot="empty" id="mark">no picture</span></ox-card-thumb>`);
|
|
24
|
-
const slot = marked.shadowRoot.querySelector('slot[name="empty"]');
|
|
25
|
-
expect(slot.assignedElements().map(e => e.id)).to.deep.equal(['mark']);
|
|
26
|
-
});
|
|
27
|
-
it('★ says one thing in the corner, in its tone, and nothing when there is nothing to say', async () => {
|
|
28
|
-
const quiet = await fixture(html `<ox-card-thumb></ox-card-thumb>`);
|
|
29
|
-
expect(quiet.shadowRoot.querySelector('[badge]')).to.equal(null);
|
|
30
|
-
const warned = await fixture(html `<ox-card-thumb badge="not latest" tone="warn"></ox-card-thumb>`);
|
|
31
|
-
const badge = warned.shadowRoot.querySelector('[badge]');
|
|
32
|
-
expect(badge.textContent).to.equal('not latest');
|
|
33
|
-
expect(badge.getAttribute('tone')).to.equal('warn');
|
|
34
|
-
expect(getComputedStyle(badge).position).to.equal('absolute');
|
|
35
|
-
expect(getComputedStyle(badge).top).to.equal('6px');
|
|
36
|
-
expect(getComputedStyle(badge).left).to.equal('6px');
|
|
37
|
-
});
|
|
38
|
-
it('lays the default slot over the picture for an action that belongs to it', async () => {
|
|
39
|
-
const thumb = await fixture(html `<ox-card-thumb><button id="del">x</button></ox-card-thumb>`);
|
|
40
|
-
const slot = thumb.shadowRoot.querySelector('slot:not([name])');
|
|
41
|
-
expect(slot.assignedElements().map(e => e.id)).to.deep.equal(['del']);
|
|
42
|
-
});
|
|
43
|
-
});
|
|
44
|
-
//# sourceMappingURL=card-thumb.test.js.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C,IAAI,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;IACtD,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,yEAAyE,EAAE,KAAK,IAAI,EAAE;QACvF,MAAM,KAAK,GAAG,MAAM,OAAO,CAAc,IAAI,CAAA,4DAA4D,CAAC,CAAA;QAC1G,MAAM,IAAI,GAAG,KAAK,CAAC,UAAW,CAAC,aAAa,CAAC,kBAAkB,CAAoB,CAAA;QACnF,MAAM,CAAC,IAAI,CAAC,gBAAgB,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,CAAA;IACvE,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA","sourcesContent":["import { expect, fixture, html } from '@open-wc/testing'\n\nimport '../src/data-card/ox-card-thumb.js'\nimport type { OxCardThumb } from '../src/data-card/ox-card-thumb.js'\n\n/*\n * The one picture cell of a catalog card (ADR-0117 amendment 2026-10-13): the picture whole, an icon when there is\n * none, at most one marker in the top-left corner, and a seam under it.\n */\ndescribe('ox-card-thumb', () => {\n it('★ shows the picture whole, never cropped, with a seam under it', async () => {\n const thumb = await fixture<OxCardThumb>(html`<ox-card-thumb\n style=\"--md-sys-color-outline-variant: rgb(200, 200, 200)\"\n src=\"data:image/gif;base64,R0lGODlhAQABAAAAACw=\"\n alt=\"a board\"\n ></ox-card-thumb>`)\n const img = thumb.shadowRoot!.querySelector('img')!\n expect(img.getAttribute('alt')).to.equal('a board')\n expect(getComputedStyle(img).objectFit).to.equal('contain')\n expect(getComputedStyle(thumb).borderBottomStyle).to.equal('solid')\n expect(thumb.shadowRoot!.querySelector('[empty]')).to.equal(null)\n })\n\n it('★ draws its icon when there is no picture, or the empty slot when one is given', async () => {\n const bare = await fixture<OxCardThumb>(html`<ox-card-thumb icon=\"dashboard\"></ox-card-thumb>`)\n expect(bare.shadowRoot!.querySelector('[empty] md-icon')!.textContent).to.equal('dashboard')\n\n const marked = await fixture<OxCardThumb>(html`<ox-card-thumb><span slot=\"empty\" id=\"mark\">no picture</span></ox-card-thumb>`)\n const slot = marked.shadowRoot!.querySelector('slot[name=\"empty\"]') as HTMLSlotElement\n expect(slot.assignedElements().map(e => e.id)).to.deep.equal(['mark'])\n })\n\n it('★ says one thing in the corner, in its tone, and nothing when there is nothing to say', async () => {\n const quiet = await fixture<OxCardThumb>(html`<ox-card-thumb></ox-card-thumb>`)\n expect(quiet.shadowRoot!.querySelector('[badge]')).to.equal(null)\n\n const warned = await fixture<OxCardThumb>(html`<ox-card-thumb badge=\"not latest\" tone=\"warn\"></ox-card-thumb>`)\n const badge = warned.shadowRoot!.querySelector('[badge]') as HTMLElement\n expect(badge.textContent).to.equal('not latest')\n expect(badge.getAttribute('tone')).to.equal('warn')\n expect(getComputedStyle(badge).position).to.equal('absolute')\n expect(getComputedStyle(badge).top).to.equal('6px')\n expect(getComputedStyle(badge).left).to.equal('6px')\n })\n\n it('lays the default slot over the picture for an action that belongs to it', async () => {\n const thumb = await fixture<OxCardThumb>(html`<ox-card-thumb><button id=\"del\">x</button></ox-card-thumb>`)\n const slot = thumb.shadowRoot!.querySelector('slot:not([name])') as HTMLSlotElement\n expect(slot.assignedElements().map(e => e.id)).to.deep.equal(['del'])\n })\n})\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import '../src/data-grist.js';
|
|
@@ -1,103 +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 report read on a phone (2026-11-06). The grid's totals row is drawn as a totals card after the cards, and a
|
|
8
|
-
* grist with a narrow mode draws it while its own width is under narrowWidth - a table on a wide screen, cards on a
|
|
9
|
-
* phone, from one config.
|
|
10
|
-
*/
|
|
11
|
-
const records = [
|
|
12
|
-
{ id: '1', name: 'one', shares: 15250, since: '2020-01-01' },
|
|
13
|
-
{ id: '2', name: 'two', shares: 5600, since: '2026-03-17' }
|
|
14
|
-
];
|
|
15
|
-
const config = (accumulator) => ({
|
|
16
|
-
columns: [
|
|
17
|
-
{ type: 'string', name: 'name', header: 'Name' },
|
|
18
|
-
{ type: 'integer', name: 'shares', header: 'Shares', accumulator: 'sum' }
|
|
19
|
-
],
|
|
20
|
-
rows: { appendable: false, editable: false, selectable: false, accumulator },
|
|
21
|
-
list: { fields: ['name'], details: ['shares'] }
|
|
22
|
-
});
|
|
23
|
-
const idle = async (el) => {
|
|
24
|
-
while (!((await el.updateComplete) && (await el.grist.updateComplete)))
|
|
25
|
-
;
|
|
26
|
-
};
|
|
27
|
-
const frame = (width) => new Promise(resolve => requestAnimationFrame(() => requestAnimationFrame(resolve)));
|
|
28
|
-
describe('a card list and its totals', () => {
|
|
29
|
-
failOnPageErrors();
|
|
30
|
-
it('draws the totals card after the cards, each total naming its column', async () => {
|
|
31
|
-
const el = await fixture(html `<ox-grist style="width:340px;height:400px" mode="CARD" .config=${config(true)} .data=${{ records }}></ox-grist>`);
|
|
32
|
-
await idle(el);
|
|
33
|
-
const totals = el.grist.renderRoot.querySelector('[totals]');
|
|
34
|
-
expect(totals, 'no totals card').to.exist;
|
|
35
|
-
const shares = totals.querySelector('[total="shares"]');
|
|
36
|
-
expect(shares.querySelector('label').textContent).to.equal('Shares');
|
|
37
|
-
expect(shares.textContent).to.contain('20850');
|
|
38
|
-
expect(totals.querySelector('[total="name"]'), 'a column with no accumulator is totalled').to.equal(null);
|
|
39
|
-
const cards = el.grist.renderRoot.querySelectorAll('ox-record-card');
|
|
40
|
-
expect(totals.getBoundingClientRect().top, 'the totals stand above a card').to.be.at.least(cards[cards.length - 1].getBoundingClientRect().bottom);
|
|
41
|
-
});
|
|
42
|
-
it('draws no totals card when the rows do not accumulate', async () => {
|
|
43
|
-
const el = await fixture(html `<ox-grist style="width:340px;height:400px" mode="CARD" .config=${config(false)} .data=${{ records }}></ox-grist>`);
|
|
44
|
-
await idle(el);
|
|
45
|
-
expect(el.grist.renderRoot.querySelector('[totals]')).to.equal(null);
|
|
46
|
-
});
|
|
47
|
-
});
|
|
48
|
-
describe('a grist with a narrow mode', () => {
|
|
49
|
-
failOnPageErrors();
|
|
50
|
-
it('draws its mode when wide and its narrow mode when narrow, by its own width', async () => {
|
|
51
|
-
const el = await fixture(html `<ox-grist style="display:flex;width:900px;height:400px" mode="GRID" narrow-mode="CARD" .config=${config(true)} .data=${{ records }}></ox-grist>`);
|
|
52
|
-
await frame(0);
|
|
53
|
-
await idle(el);
|
|
54
|
-
expect(el.shownMode).to.equal('GRID');
|
|
55
|
-
expect(el.renderRoot.querySelector('ox-grid'), 'not a grid while wide').to.exist;
|
|
56
|
-
el.style.width = '340px';
|
|
57
|
-
await frame(0);
|
|
58
|
-
await idle(el);
|
|
59
|
-
expect(el.shownMode).to.equal('CARD');
|
|
60
|
-
expect(el.renderRoot.querySelector('ox-card'), 'not cards while narrow').to.exist;
|
|
61
|
-
expect(el.mode, 'the requested mode was overwritten').to.equal('GRID');
|
|
62
|
-
el.style.width = '900px';
|
|
63
|
-
await frame(0);
|
|
64
|
-
await idle(el);
|
|
65
|
-
expect(el.renderRoot.querySelector('ox-grid'), 'not a grid again once wide').to.exist;
|
|
66
|
-
});
|
|
67
|
-
it('keeps its mode at every width when no narrow mode is set', async () => {
|
|
68
|
-
const el = await fixture(html `<ox-grist style="display:flex;width:340px;height:400px" mode="GRID" .config=${config(true)} .data=${{ records }}></ox-grist>`);
|
|
69
|
-
await frame(0);
|
|
70
|
-
await idle(el);
|
|
71
|
-
expect(el.renderRoot.querySelector('ox-grid')).to.exist;
|
|
72
|
-
});
|
|
73
|
-
});
|
|
74
|
-
describe('a card detail with a label', () => {
|
|
75
|
-
failOnPageErrors();
|
|
76
|
-
it('keeps the label whole when details stand in a row', async () => {
|
|
77
|
-
const labelled = {
|
|
78
|
-
...config(false),
|
|
79
|
-
columns: [
|
|
80
|
-
{ type: 'string', name: 'name', header: 'Name' },
|
|
81
|
-
{ type: 'string', name: 'since', header: 'Since', label: { renderer: () => '취득일' } }
|
|
82
|
-
],
|
|
83
|
-
list: { fields: ['name'], details: ['since'] }
|
|
84
|
-
};
|
|
85
|
-
const el = await fixture(html `<ox-grist style="width:340px;height:400px;font-size:13px;--data-card-detail-direction:row;--data-card-item-etc-label-font:400 11.5px sans-serif" mode="CARD" .config=${labelled} .data=${{ records }}></ox-grist>`);
|
|
86
|
-
await idle(el);
|
|
87
|
-
const card = el.grist.renderRoot.querySelector('ox-record-card');
|
|
88
|
-
const field = card.renderRoot.querySelector('[detail] ox-card-field');
|
|
89
|
-
const label = field.renderRoot.querySelector('label');
|
|
90
|
-
expect(label.scrollWidth, 'the label is cut').to.be.at.most(label.clientWidth);
|
|
91
|
-
const range = document.createRange();
|
|
92
|
-
range.setStartAfter(label);
|
|
93
|
-
range.setEnd(field.renderRoot, field.renderRoot.childNodes.length);
|
|
94
|
-
const words = document.createRange();
|
|
95
|
-
words.selectNodeContents(label);
|
|
96
|
-
expect(range.getBoundingClientRect().left - words.getBoundingClientRect().right, 'the label touches its value').to.be.at.least(4);
|
|
97
|
-
const value = Array.from(field.renderRoot.children).find(child => child !== label && child.tagName !== 'STYLE');
|
|
98
|
-
const text = document.createRange();
|
|
99
|
-
text.selectNodeContents(value);
|
|
100
|
-
expect(value.getBoundingClientRect().width, 'the value is cut').to.be.at.least(text.getBoundingClientRect().width - 0.01);
|
|
101
|
-
});
|
|
102
|
-
});
|
|
103
|
-
//# sourceMappingURL=card-totals-narrow.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"card-totals-narrow.test.js","sourceRoot":"","sources":["../../test/card-totals-narrow.test.ts"],"names":[],"mappings":"AAAA,kIA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C,KAAK,EAAE,6BAA6B,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;QACjI,MAAM,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,KAAK,KAAK,IAAI,KAAK,CAAC,OAAO,KAAK,OAAO,CAAgB,CAAA;QAC9H,MAAM,IAAI,GAAG,QAAQ,CAAC,WAAW,EAAE,CAAA;QACnC,IAAI,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAA;QAC9B,MAAM,CAAC,KAAK,CAAC,qBAAqB,EAAE,CAAC,KAAK,EAAE,kBAAkB,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,qBAAqB,EAAE,CAAC,KAAK,GAAG,IAAI,CAAC,CAAA;IAC3H,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/data-grist.js'\nimport { DataGrist } from '../src/data-grist.js'\nimport { failOnPageErrors } from './page-errors.js'\n\n/*\n * A report read on a phone (2026-11-06). The grid's totals row is drawn as a totals card after the cards, and a\n * grist with a narrow mode draws it while its own width is under narrowWidth - a table on a wide screen, cards on a\n * phone, from one config.\n */\n\nconst records = [\n { id: '1', name: 'one', shares: 15250, since: '2020-01-01' },\n { id: '2', name: 'two', shares: 5600, since: '2026-03-17' }\n]\nconst config = (accumulator: boolean) => ({\n columns: [\n { type: 'string', name: 'name', header: 'Name' },\n { type: 'integer', name: 'shares', header: 'Shares', accumulator: 'sum' }\n ],\n rows: { appendable: false, editable: false, selectable: false, accumulator },\n list: { fields: ['name'], details: ['shares'] }\n})\n\nconst idle = async (el: DataGrist) => {\n while (!((await el.updateComplete) && (await el.grist.updateComplete)));\n}\n\nconst frame = (width: number) => new Promise(resolve => requestAnimationFrame(() => requestAnimationFrame(resolve)))\n\ndescribe('a card list and its totals', () => {\n failOnPageErrors()\n\n it('draws the totals card after the cards, each total naming its column', async () => {\n const el = await fixture<DataGrist>(\n html`<ox-grist style=\"width:340px;height:400px\" mode=\"CARD\" .config=${config(true)} .data=${{ records }}></ox-grist>`\n )\n await idle(el)\n const totals = el.grist.renderRoot.querySelector('[totals]') as HTMLElement\n expect(totals, 'no totals card').to.exist\n const shares = totals.querySelector('[total=\"shares\"]') as HTMLElement\n expect(shares.querySelector('label')!.textContent).to.equal('Shares')\n expect(shares.textContent).to.contain('20850')\n expect(totals.querySelector('[total=\"name\"]'), 'a column with no accumulator is totalled').to.equal(null)\n\n const cards = el.grist.renderRoot.querySelectorAll('ox-record-card')\n expect(totals.getBoundingClientRect().top, 'the totals stand above a card').to.be.at.least(cards[cards.length - 1].getBoundingClientRect().bottom)\n })\n\n it('draws no totals card when the rows do not accumulate', async () => {\n const el = await fixture<DataGrist>(\n html`<ox-grist style=\"width:340px;height:400px\" mode=\"CARD\" .config=${config(false)} .data=${{ records }}></ox-grist>`\n )\n await idle(el)\n expect(el.grist.renderRoot.querySelector('[totals]')).to.equal(null)\n })\n})\n\ndescribe('a grist with a narrow mode', () => {\n failOnPageErrors()\n\n it('draws its mode when wide and its narrow mode when narrow, by its own width', async () => {\n const el = await fixture<DataGrist>(\n html`<ox-grist style=\"display:flex;width:900px;height:400px\" mode=\"GRID\" narrow-mode=\"CARD\" .config=${config(true)} .data=${{ records }}></ox-grist>`\n )\n await frame(0)\n await idle(el)\n expect(el.shownMode).to.equal('GRID')\n expect(el.renderRoot.querySelector('ox-grid'), 'not a grid while wide').to.exist\n\n el.style.width = '340px'\n await frame(0)\n await idle(el)\n expect(el.shownMode).to.equal('CARD')\n expect(el.renderRoot.querySelector('ox-card'), 'not cards while narrow').to.exist\n expect(el.mode, 'the requested mode was overwritten').to.equal('GRID')\n\n el.style.width = '900px'\n await frame(0)\n await idle(el)\n expect(el.renderRoot.querySelector('ox-grid'), 'not a grid again once wide').to.exist\n })\n\n it('keeps its mode at every width when no narrow mode is set', async () => {\n const el = await fixture<DataGrist>(\n html`<ox-grist style=\"display:flex;width:340px;height:400px\" mode=\"GRID\" .config=${config(true)} .data=${{ records }}></ox-grist>`\n )\n await frame(0)\n await idle(el)\n expect(el.renderRoot.querySelector('ox-grid')).to.exist\n })\n})\n\ndescribe('a card detail with a label', () => {\n failOnPageErrors()\n\n it('keeps the label whole when details stand in a row', async () => {\n const labelled = {\n ...config(false),\n columns: [\n { type: 'string', name: 'name', header: 'Name' },\n { type: 'string', name: 'since', header: 'Since', label: { renderer: () => '취득일' } }\n ],\n list: { fields: ['name'], details: ['since'] }\n }\n const el = await fixture<DataGrist>(\n html`<ox-grist style=\"width:340px;height:400px;font-size:13px;--data-card-detail-direction:row;--data-card-item-etc-label-font:400 11.5px sans-serif\" mode=\"CARD\" .config=${labelled} .data=${{ records }}></ox-grist>`\n )\n await idle(el)\n const card = el.grist.renderRoot.querySelector('ox-record-card') as any\n const field = card.renderRoot.querySelector('[detail] ox-card-field') as HTMLElement & { renderRoot: ShadowRoot }\n const label = field.renderRoot.querySelector('label') as HTMLElement\n expect(label.scrollWidth, 'the label is cut').to.be.at.most(label.clientWidth)\n const range = document.createRange()\n range.setStartAfter(label)\n range.setEnd(field.renderRoot, field.renderRoot.childNodes.length)\n const words = document.createRange()\n words.selectNodeContents(label)\n expect(range.getBoundingClientRect().left - words.getBoundingClientRect().right, 'the label touches its value').to.be.at.least(4)\n const value = Array.from(field.renderRoot.children).find(child => child !== label && child.tagName !== 'STYLE') as HTMLElement\n const text = document.createRange()\n text.selectNodeContents(value)\n expect(value.getBoundingClientRect().width, 'the value is cut').to.be.at.least(text.getBoundingClientRect().width - 0.01)\n })\n})\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import '../src/data-grist.js';
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { expect, fixture } from '@open-wc/testing';
|
|
2
|
-
import { html } from 'lit';
|
|
3
|
-
import '../src/data-grist.js';
|
|
4
|
-
import { failOnPageErrors } from './page-errors.js';
|
|
5
|
-
/*
|
|
6
|
-
* A button a renderer returns in a grid cell never raises the row. The fields take the page's button look
|
|
7
|
-
* (ButtonStyles, 2026-11-06), and with it the page's 32px action height: the scenario list's 「발행」 button
|
|
8
|
-
* (a plain <button> styled inline) made every row taller than a text row (2026-11-09).
|
|
9
|
-
*/
|
|
10
|
-
const records = [
|
|
11
|
-
{ id: '1', what: 'teams-meetings' },
|
|
12
|
-
{ id: '2', what: 'm365' }
|
|
13
|
-
];
|
|
14
|
-
const idle = async (el) => {
|
|
15
|
-
while (!((await el.updateComplete) && (await el.grist.updateComplete)))
|
|
16
|
-
;
|
|
17
|
-
};
|
|
18
|
-
const rowHeight = async (act) => {
|
|
19
|
-
const config = {
|
|
20
|
-
columns: [
|
|
21
|
-
{ type: 'string', name: 'what', header: 'What' },
|
|
22
|
-
...(act ? [{ type: 'string', name: 'act', header: '', width: 100, record: { editable: false, align: 'center', renderer: act } }] : [])
|
|
23
|
-
],
|
|
24
|
-
rows: { appendable: false, editable: false, selectable: false }
|
|
25
|
-
};
|
|
26
|
-
const el = await fixture(html `<ox-grist style="display:flex;width:700px;height:400px" mode="GRID" .config=${config} .data=${{ records }}></ox-grist>`);
|
|
27
|
-
await idle(el);
|
|
28
|
-
const root = el.grist.renderRoot.querySelector('ox-grid-body').renderRoot;
|
|
29
|
-
const cell = Array.from(root.querySelectorAll('ox-grid-field')).find((one) => { var _a; return ((_a = one.column) === null || _a === void 0 ? void 0 : _a.name) === 'what'; });
|
|
30
|
-
return cell.getBoundingClientRect().height;
|
|
31
|
-
};
|
|
32
|
-
describe('a button a renderer returns in a grid cell', () => {
|
|
33
|
-
failOnPageErrors();
|
|
34
|
-
const buttons = {
|
|
35
|
-
/* the scenario list's release button, as it is written there */
|
|
36
|
-
'a plain button styled inline': () => html `<button
|
|
37
|
-
style="cursor:pointer;display:inline-flex;align-items:center;gap:3px;font:inherit;font-size:11px;border:none;border-radius:999px;padding:2px 11px;"
|
|
38
|
-
>
|
|
39
|
-
<md-icon style="font-size:15px;">publish</md-icon>Release
|
|
40
|
-
</button>`,
|
|
41
|
-
'a plain button': () => html `<button>Open</button>`,
|
|
42
|
-
'a quiet small button': () => html `<button quiet small>Open</button>`,
|
|
43
|
-
'an icon-only button': () => html `<button icon-only><md-icon>open_in_new</md-icon></button>`
|
|
44
|
-
};
|
|
45
|
-
for (const [name, renderer] of Object.entries(buttons)) {
|
|
46
|
-
it(`keeps the row as high as a text row (${name})`, async () => {
|
|
47
|
-
const text = await rowHeight();
|
|
48
|
-
const withButton = await rowHeight(renderer);
|
|
49
|
-
expect(withButton, `a text row is ${text}px`).to.equal(text);
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
});
|
|
53
|
-
//# sourceMappingURL=cell-button-row-height.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cell-button-row-height.test.js","sourceRoot":"","sources":["../../test/cell-button-row-height.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,gBAAgB,EAAE,MAAM,kBAAkB,CAAA;AAEnD;;;;GAIG;AAEH,MAAM,OAAO,GAAG;IACd,EAAE,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE,gBAAgB,EAAE;IACnC,EAAE,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE;CAC1B,CAAA;AAED,MAAM,IAAI,GAAG,KAAK,EAAE,EAAa,EAAE,EAAE;IACnC,OAAO,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM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,4CAA4C,EAAE,GAAG,EAAE;IAC1D,gBAAgB,EAAE,CAAA;IAElB,MAAM,OAAO,GAAkC;QAC7C,gEAAgE;QAChE,8BAA8B,EAAE,GAAG,EAAE,CACnC,IAAI,CAAA;;;;gBAIM;QACZ,gBAAgB,EAAE,GAAG,EAAE,CAAC,IAAI,CAAA,uBAAuB;QACnD,sBAAsB,EAAE,GAAG,EAAE,CAAC,IAAI,CAAA,mCAAmC;QACrE,qBAAqB,EAAE,GAAG,EAAE,CAAC,IAAI,CAAA,2DAA2D;KAC7F,CAAA;IAED,KAAK,MAAM,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC;QACvD,EAAE,CAAC,wCAAwC,IAAI,GAAG,EAAE,KAAK,IAAI,EAAE;YAC7D,MAAM,IAAI,GAAG,MAAM,SAAS,EAAE,CAAA;YAC9B,MAAM,UAAU,GAAG,MAAM,SAAS,CAAC,QAAQ,CAAC,CAAA;YAC5C,MAAM,CAAC,UAAU,EAAE,iBAAiB,IAAI,IAAI,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;QAC9D,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 { failOnPageErrors } from './page-errors.js'\n\n/*\n * A button a renderer returns in a grid cell never raises the row. The fields take the page's button look\n * (ButtonStyles, 2026-11-06), and with it the page's 32px action height: the scenario list's 「발행」 button\n * (a plain <button> styled inline) made every row taller than a text row (2026-11-09).\n */\n\nconst records = [\n { id: '1', what: 'teams-meetings' },\n { id: '2', what: 'm365' }\n]\n\nconst idle = async (el: DataGrist) => {\n while (!((await el.updateComplete) && (await el.grist.updateComplete)));\n}\n\nconst rowHeight = async (act?: (value: any) => unknown) => {\n const config = {\n columns: [\n { type: 'string', name: 'what', header: 'What' },\n ...(act ? [{ type: 'string', name: 'act', header: '', width: 100, record: { editable: false, align: 'center', renderer: act } }] : [])\n ],\n rows: { appendable: false, editable: false, selectable: false }\n }\n const el = await fixture<DataGrist>(\n html`<ox-grist style=\"display:flex;width:700px;height:400px\" mode=\"GRID\" .config=${config} .data=${{ records }}></ox-grist>`\n )\n await idle(el)\n const root = (el.grist.renderRoot.querySelector('ox-grid-body') as any).renderRoot as ShadowRoot\n const cell = Array.from(root.querySelectorAll('ox-grid-field')).find((one: any) => one.column?.name === 'what') as HTMLElement\n return cell.getBoundingClientRect().height\n}\n\ndescribe('a button a renderer returns in a grid cell', () => {\n failOnPageErrors()\n\n const buttons: Record<string, () => unknown> = {\n /* the scenario list's release button, as it is written there */\n 'a plain button styled inline': () =>\n html`<button\n style=\"cursor:pointer;display:inline-flex;align-items:center;gap:3px;font:inherit;font-size:11px;border:none;border-radius:999px;padding:2px 11px;\"\n >\n <md-icon style=\"font-size:15px;\">publish</md-icon>Release\n </button>`,\n 'a plain button': () => html`<button>Open</button>`,\n 'a quiet small button': () => html`<button quiet small>Open</button>`,\n 'an icon-only button': () => html`<button icon-only><md-icon>open_in_new</md-icon></button>`\n }\n\n for (const [name, renderer] of Object.entries(buttons)) {\n it(`keeps the row as high as a text row (${name})`, async () => {\n const text = await rowHeight()\n const withButton = await rowHeight(renderer)\n expect(withButton, `a text row is ${text}px`).to.equal(text)\n })\n }\n})\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import '../src/data-grist.js';
|
|
@@ -1,153 +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 { executeServerCommand, sendMouse } from '@web/test-runner-commands';
|
|
4
|
-
import { html } from 'lit';
|
|
5
|
-
import '../src/data-grist.js';
|
|
6
|
-
const settle = (ms = 150) => new Promise(resolve => setTimeout(resolve, ms));
|
|
7
|
-
const LONG = 'A long counterparty name that does not fit its column';
|
|
8
|
-
async function grid({ editable = false, nameWidth = 120 } = {}) {
|
|
9
|
-
const columns = [
|
|
10
|
-
{ type: 'string', name: 'id', hidden: true },
|
|
11
|
-
{ type: 'string', name: 'name', header: 'name', width: nameWidth, record: { editable } },
|
|
12
|
-
{ type: 'string', name: 'code', header: 'code', width: 100, record: { editable } },
|
|
13
|
-
/* Text and a mark side by side, as the cash list's counterparty and its 「미등록」: long text pushes the mark out. */
|
|
14
|
-
{
|
|
15
|
-
type: 'string',
|
|
16
|
-
name: 'memo',
|
|
17
|
-
header: 'memo',
|
|
18
|
-
width: 120,
|
|
19
|
-
record: {
|
|
20
|
-
editable,
|
|
21
|
-
renderer: (value) => html `${value} <span style="font-size: 11px; font-weight: 600">unregistered</span>`
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
];
|
|
25
|
-
const records = Array.from({ length: 5 }, (_, r) => ({ id: String(r), name: r === 3 ? LONG : 'short', code: 'C-' + r, memo: r === 2 ? LONG : 'note' }));
|
|
26
|
-
const el = (await fixture(html `
|
|
27
|
-
<ox-grist
|
|
28
|
-
style="width: 900px; height: 300px"
|
|
29
|
-
mode="GRID"
|
|
30
|
-
.config=${{ columns, pagination: { infinite: true }, rows: { appendable: false, selectable: false } }}
|
|
31
|
-
.data=${{ records }}
|
|
32
|
-
></ox-grist>
|
|
33
|
-
`));
|
|
34
|
-
await settle();
|
|
35
|
-
await el.updateComplete;
|
|
36
|
-
const ox = el.renderRoot.querySelector('#grist');
|
|
37
|
-
await ox.updateComplete;
|
|
38
|
-
const header = ox.renderRoot.querySelector('ox-grid-header');
|
|
39
|
-
const body = ox.renderRoot.querySelector('ox-grid-body');
|
|
40
|
-
await body.updateComplete;
|
|
41
|
-
await settle(50);
|
|
42
|
-
return { ox, header, body };
|
|
43
|
-
}
|
|
44
|
-
const heads = (header) => Array.from(header.renderRoot.querySelectorAll('[role=columnheader]'));
|
|
45
|
-
const width = (element) => Math.round(element.getBoundingClientRect().width);
|
|
46
|
-
const handle = (head) => head.querySelector('span[splitter]');
|
|
47
|
-
function centre(element) {
|
|
48
|
-
const r = element.getBoundingClientRect();
|
|
49
|
-
return [Math.round(r.left + r.width / 2), Math.round(r.top + r.height / 2)];
|
|
50
|
-
}
|
|
51
|
-
/** Whether the text of any cell of the column under this header is cut - the cell itself, or text it ends with "…". */
|
|
52
|
-
function cut(head, body) {
|
|
53
|
-
const left = head.getBoundingClientRect().left;
|
|
54
|
-
return Array.from(body.renderRoot.querySelectorAll('ox-grid-field'))
|
|
55
|
-
.filter(cell => Math.abs(cell.getBoundingClientRect().left - left) < 1)
|
|
56
|
-
.some(cell => [cell, ...Array.from(cell.renderRoot.querySelectorAll('*'))]
|
|
57
|
-
.filter(e => e === cell || getComputedStyle(e).textOverflow === 'ellipsis')
|
|
58
|
-
.some(e => e.scrollWidth > e.clientWidth + 1));
|
|
59
|
-
}
|
|
60
|
-
async function drag(from, by) {
|
|
61
|
-
await sendMouse({ type: 'move', position: from });
|
|
62
|
-
await sendMouse({ type: 'down' });
|
|
63
|
-
await sendMouse({ type: 'move', position: [from[0] + by, from[1]] });
|
|
64
|
-
await sendMouse({ type: 'up' });
|
|
65
|
-
await settle(300);
|
|
66
|
-
}
|
|
67
|
-
async function doubleClick([x, y]) {
|
|
68
|
-
await executeServerCommand('send-double-click', { x, y });
|
|
69
|
-
await settle(300);
|
|
70
|
-
}
|
|
71
|
-
describe('a column edge', () => {
|
|
72
|
-
/* Resizing the grid body inside a fixture trips Chrome's benign "ResizeObserver loop" error. */
|
|
73
|
-
const ignoreResizeLoop = (e) => {
|
|
74
|
-
if (String(e.message).includes('ResizeObserver loop')) {
|
|
75
|
-
e.stopImmediatePropagation();
|
|
76
|
-
e.preventDefault();
|
|
77
|
-
}
|
|
78
|
-
};
|
|
79
|
-
let previousOnError = null;
|
|
80
|
-
before(() => {
|
|
81
|
-
window.addEventListener('error', ignoreResizeLoop, true);
|
|
82
|
-
previousOnError = window.onerror;
|
|
83
|
-
window.onerror = (message, ...rest) => String(message).includes('ResizeObserver loop') ? true : previousOnError === null || previousOnError === void 0 ? void 0 : previousOnError.call(window, message, ...rest);
|
|
84
|
-
});
|
|
85
|
-
afterEach(async () => {
|
|
86
|
-
await sendMouse({ type: 'move', position: [0, 0] });
|
|
87
|
-
});
|
|
88
|
-
after(() => {
|
|
89
|
-
window.removeEventListener('error', ignoreResizeLoop, true);
|
|
90
|
-
window.onerror = previousOnError;
|
|
91
|
-
});
|
|
92
|
-
describe('on a read-only grid', () => {
|
|
93
|
-
it('has a handle that draws no line and leaves the header as it was', async () => {
|
|
94
|
-
const { header } = await grid();
|
|
95
|
-
const name = heads(header)[0];
|
|
96
|
-
const splitter = handle(name);
|
|
97
|
-
expect(!!splitter, 'the handle is there').to.equal(true);
|
|
98
|
-
expect(getComputedStyle(splitter).borderRightColor, 'no line').to.equal('rgba(0, 0, 0, 0)');
|
|
99
|
-
expect(parseFloat(getComputedStyle(name).paddingRight), 'the right padding stays').to.be.greaterThan(0);
|
|
100
|
-
expect(width(splitter), 'the handle is narrow').to.be.at.most(8);
|
|
101
|
-
});
|
|
102
|
-
it('draws its line while the pointer is on it', async () => {
|
|
103
|
-
const { header } = await grid();
|
|
104
|
-
const splitter = handle(heads(header)[0]);
|
|
105
|
-
await sendMouse({ type: 'move', position: centre(splitter) });
|
|
106
|
-
await settle(100);
|
|
107
|
-
expect(getComputedStyle(splitter).borderRightColor).not.to.equal('rgba(0, 0, 0, 0)');
|
|
108
|
-
});
|
|
109
|
-
it('can be dragged to widen the column', async () => {
|
|
110
|
-
const { header } = await grid();
|
|
111
|
-
const name = heads(header)[0];
|
|
112
|
-
const before = width(name);
|
|
113
|
-
await drag(centre(handle(name)), 40);
|
|
114
|
-
expect(width(heads(header)[0])).to.be.within(before + 35, before + 45);
|
|
115
|
-
});
|
|
116
|
-
});
|
|
117
|
-
for (const editable of [false, true]) {
|
|
118
|
-
describe(`on ${editable ? 'an editable' : 'a read-only'} grid, a double-click`, () => {
|
|
119
|
-
it('widens the column until no cell in it is cut', async () => {
|
|
120
|
-
const { header, body } = await grid({ editable });
|
|
121
|
-
const name = heads(header)[0];
|
|
122
|
-
expect(cut(name, body), 'the long name is cut to begin with').to.equal(true);
|
|
123
|
-
const before = width(name);
|
|
124
|
-
await doubleClick(centre(handle(name)));
|
|
125
|
-
const after = heads(header)[0];
|
|
126
|
-
expect(width(after)).to.be.greaterThan(before);
|
|
127
|
-
expect(cut(after, body)).to.equal(false);
|
|
128
|
-
});
|
|
129
|
-
it('leaves a column whose cells all fit as it is', async () => {
|
|
130
|
-
const { header } = await grid({ editable });
|
|
131
|
-
const code = heads(header)[1];
|
|
132
|
-
const before = width(code);
|
|
133
|
-
await doubleClick(centre(handle(code)));
|
|
134
|
-
expect(width(heads(header)[1])).to.equal(before);
|
|
135
|
-
});
|
|
136
|
-
it('widens a column of text and a mark until the mark is back', async () => {
|
|
137
|
-
const { header, body } = await grid({ editable });
|
|
138
|
-
const memo = heads(header)[2];
|
|
139
|
-
expect(cut(memo, body), 'the long text pushes the mark out to begin with').to.equal(true);
|
|
140
|
-
await doubleClick(centre(handle(memo)));
|
|
141
|
-
expect(cut(heads(header)[2], body)).to.equal(false);
|
|
142
|
-
});
|
|
143
|
-
});
|
|
144
|
-
}
|
|
145
|
-
it('does nothing on a click that does not drag (an fr column stays flexible)', async () => {
|
|
146
|
-
const { ox, header } = await grid({ editable: true, nameWidth: 'minmax(120px, 1fr)' });
|
|
147
|
-
const before = ox.style.getPropertyValue('--grid-template-columns');
|
|
148
|
-
await sendMouse({ type: 'click', position: centre(handle(heads(header)[0])) });
|
|
149
|
-
await settle(300);
|
|
150
|
-
expect(ox.style.getPropertyValue('--grid-template-columns')).to.equal(before);
|
|
151
|
-
});
|
|
152
|
-
});
|
|
153
|
-
//# sourceMappingURL=column-resize.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"column-resize.test.js","sourceRoot":"","sources":["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tF,MAAM,MAAM,GAAG,EAAE,CAAC,KAAK,CAAC,gBAAgB,CAAC,yBAAyB,CAAC,CAAA;QACnE,MAAM,SAAS,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAE,CAAC,EAAE,CAAC,CAAA;QAC/E,MAAM,MAAM,CAAC,GAAG,CAAC,CAAA;QAEjB,MAAM,CAAC,EAAE,CAAC,KAAK,CAAC,gBAAgB,CAAC,yBAAyB,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,CAAA;IAC/E,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 { executeServerCommand, sendMouse } from '@web/test-runner-commands'\nimport { html } from 'lit'\n\nimport '../src/data-grist.js'\n\n/**\n * A column's edge can be dragged and double-clicked on every grid.\n *\n * The handle on a column's edge also draws the grid's vertical line, and a grid with nothing to edit\n * hides its lines (--grid-header-splitter-display: none) - which took the handle with them. A read\n * list then had no way to widen a column whose text was cut, though reading is what it is for.\n *\n * ```\n * read-only the handle stays and draws no line until the pointer is on it or drags it; the header\n * keeps the look it had without one (its right padding, its name not pushed)\n * drag dragging the edge sets the width, on a read-only grid as on an editable one\n * fit double-clicking the edge widens the column until no cell in it is cut, header included\n * click a click that does not drag changes nothing (an fr column stays flexible)\n * ```\n */\n\ntype Root = HTMLElement & { renderRoot: ShadowRoot; updateComplete: Promise<unknown> }\n\nconst settle = (ms = 150) => new Promise(resolve => setTimeout(resolve, ms))\n\nconst LONG = 'A long counterparty name that does not fit its column'\n\nasync function grid({ editable = false, nameWidth = 120 as number | string } = {}) {\n const columns: any[] = [\n { type: 'string', name: 'id', hidden: true },\n { type: 'string', name: 'name', header: 'name', width: nameWidth, record: { editable } },\n { type: 'string', name: 'code', header: 'code', width: 100, record: { editable } },\n /* Text and a mark side by side, as the cash list's counterparty and its 「미등록」: long text pushes the mark out. */\n {\n type: 'string',\n name: 'memo',\n header: 'memo',\n width: 120,\n record: {\n editable,\n renderer: (value: string) => html`${value} <span style=\"font-size: 11px; font-weight: 600\">unregistered</span>`\n }\n }\n ]\n const records = Array.from({ length: 5 }, (_, r) => ({ id: String(r), name: r === 3 ? LONG : 'short', code: 'C-' + r, memo: r === 2 ? LONG : 'note' }))\n\n const el = (await fixture(html`\n <ox-grist\n style=\"width: 900px; height: 300px\"\n mode=\"GRID\"\n .config=${{ columns, pagination: { infinite: true }, rows: { appendable: false, selectable: false } }}\n .data=${{ records }}\n ></ox-grist>\n `)) as Root\n\n await settle()\n await el.updateComplete\n const ox = el.renderRoot.querySelector('#grist') as Root\n await ox.updateComplete\n const header = ox.renderRoot.querySelector('ox-grid-header') as Root\n const body = ox.renderRoot.querySelector('ox-grid-body') as Root\n await body.updateComplete\n await settle(50)\n\n return { ox, header, body }\n}\n\nconst heads = (header: Root) => Array.from(header.renderRoot.querySelectorAll('[role=columnheader]')) as HTMLElement[]\nconst width = (element: Element) => Math.round(element.getBoundingClientRect().width)\nconst handle = (head: HTMLElement) => head.querySelector('span[splitter]') as HTMLElement | null\n\nfunction centre(element: Element): [number, number] {\n const r = element.getBoundingClientRect()\n return [Math.round(r.left + r.width / 2), Math.round(r.top + r.height / 2)]\n}\n\n/** Whether the text of any cell of the column under this header is cut - the cell itself, or text it ends with \"…\". */\nfunction cut(head: HTMLElement, body: Root) {\n const left = head.getBoundingClientRect().left\n return (Array.from(body.renderRoot.querySelectorAll('ox-grid-field')) as Root[])\n .filter(cell => Math.abs(cell.getBoundingClientRect().left - left) < 1)\n .some(cell =>\n [cell, ...Array.from(cell.renderRoot.querySelectorAll('*'))]\n .filter(e => e === cell || getComputedStyle(e).textOverflow === 'ellipsis')\n .some(e => e.scrollWidth > e.clientWidth + 1)\n )\n}\n\nasync function drag(from: [number, number], by: number) {\n await sendMouse({ type: 'move', position: from })\n await sendMouse({ type: 'down' })\n await sendMouse({ type: 'move', position: [from[0] + by, from[1]] })\n await sendMouse({ type: 'up' })\n await settle(300)\n}\n\nasync function doubleClick([x, y]: [number, number]) {\n await executeServerCommand('send-double-click', { x, y })\n await settle(300)\n}\n\ndescribe('a column edge', () => {\n /* Resizing the grid body inside a fixture trips Chrome's benign \"ResizeObserver loop\" error. */\n const ignoreResizeLoop = (e: ErrorEvent) => {\n if (String(e.message).includes('ResizeObserver loop')) {\n e.stopImmediatePropagation()\n e.preventDefault()\n }\n }\n let previousOnError: OnErrorEventHandler = null\n before(() => {\n window.addEventListener('error', ignoreResizeLoop, true)\n previousOnError = window.onerror\n window.onerror = (message, ...rest) =>\n String(message).includes('ResizeObserver loop') ? true : previousOnError?.call(window, message, ...rest)\n })\n afterEach(async () => {\n await sendMouse({ type: 'move', position: [0, 0] })\n })\n after(() => {\n window.removeEventListener('error', ignoreResizeLoop, true)\n window.onerror = previousOnError\n })\n\n describe('on a read-only grid', () => {\n it('has a handle that draws no line and leaves the header as it was', async () => {\n const { header } = await grid()\n\n const name = heads(header)[0]\n const splitter = handle(name)\n expect(!!splitter, 'the handle is there').to.equal(true)\n expect(getComputedStyle(splitter!).borderRightColor, 'no line').to.equal('rgba(0, 0, 0, 0)')\n expect(parseFloat(getComputedStyle(name).paddingRight), 'the right padding stays').to.be.greaterThan(0)\n expect(width(splitter!), 'the handle is narrow').to.be.at.most(8)\n })\n\n it('draws its line while the pointer is on it', async () => {\n const { header } = await grid()\n\n const splitter = handle(heads(header)[0])!\n await sendMouse({ type: 'move', position: centre(splitter) })\n await settle(100)\n\n expect(getComputedStyle(splitter).borderRightColor).not.to.equal('rgba(0, 0, 0, 0)')\n })\n\n it('can be dragged to widen the column', async () => {\n const { header } = await grid()\n\n const name = heads(header)[0]\n const before = width(name)\n await drag(centre(handle(name)!), 40)\n\n expect(width(heads(header)[0])).to.be.within(before + 35, before + 45)\n })\n })\n\n for (const editable of [false, true]) {\n describe(`on ${editable ? 'an editable' : 'a read-only'} grid, a double-click`, () => {\n it('widens the column until no cell in it is cut', async () => {\n const { header, body } = await grid({ editable })\n\n const name = heads(header)[0]\n expect(cut(name, body), 'the long name is cut to begin with').to.equal(true)\n const before = width(name)\n await doubleClick(centre(handle(name)!))\n\n const after = heads(header)[0]\n expect(width(after)).to.be.greaterThan(before)\n expect(cut(after, body)).to.equal(false)\n })\n\n it('leaves a column whose cells all fit as it is', async () => {\n const { header } = await grid({ editable })\n\n const code = heads(header)[1]\n const before = width(code)\n await doubleClick(centre(handle(code)!))\n\n expect(width(heads(header)[1])).to.equal(before)\n })\n\n it('widens a column of text and a mark until the mark is back', async () => {\n const { header, body } = await grid({ editable })\n\n const memo = heads(header)[2]\n expect(cut(memo, body), 'the long text pushes the mark out to begin with').to.equal(true)\n await doubleClick(centre(handle(memo)!))\n\n expect(cut(heads(header)[2], body)).to.equal(false)\n })\n })\n }\n\n it('does nothing on a click that does not drag (an fr column stays flexible)', async () => {\n const { ox, header } = await grid({ editable: true, nameWidth: 'minmax(120px, 1fr)' })\n\n const before = ox.style.getPropertyValue('--grid-template-columns')\n await sendMouse({ type: 'click', position: centre(handle(heads(header)[0])!) })\n await settle(300)\n\n expect(ox.style.getPropertyValue('--grid-template-columns')).to.equal(before)\n })\n})\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|