@operato/data-grist 10.29.30 → 10.29.31

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@operato/data-grist",
3
- "version": "10.29.30",
3
+ "version": "10.29.31",
4
4
  "description": "User interface for grid (desktop) and list (mobile)",
5
5
  "author": "heartyoh",
6
6
  "type": "module",
@@ -120,5 +120,5 @@
120
120
  "prettier --write"
121
121
  ]
122
122
  },
123
- "gitHead": "44682a97746b11fb380a3a5ce7718f3428e4943c"
123
+ "gitHead": "0b1246851e25dae823d204c352757c93585f6612"
124
124
  }
@@ -65,4 +65,35 @@ describe('필터 라벨', () => {
65
65
  expect(label!.querySelector('span')?.textContent?.trim()).to.equal(name)
66
66
  }
67
67
  })
68
+
69
+ /*
70
+ * A header may draw more than its words - a help `?` beside them. The filter is not the header: it names the column
71
+ * by its words, or a press on that `?` would also tick the checkbox around it.
72
+ */
73
+ it('names a filter by the header words when the header draws more', async () => {
74
+ const drawn = [
75
+ { type: 'checkbox', name: 'flag', header: { text: 'flag', renderer: () => html`flag <button class="extra">?</button>` }, filter: true },
76
+ { type: 'select', name: 'kind', header: { text: 'kind', renderer: () => html`kind <button class="extra">?</button>` }, record: { options: ['', 'A'] }, filter: true }
77
+ ]
78
+ const el = (await fixture(html`
79
+ <ox-grist
80
+ style="height: 300px"
81
+ mode="GRID"
82
+ .config=${{ columns: drawn, pagination: { pages: [20] } }}
83
+ .fetchHandler=${async () => ({ page: 1, limit: 20, total: 0, records: [] })}
84
+ >
85
+ <div slot="headroom"><ox-filters-form without-search></ox-filters-form></div>
86
+ </ox-grist>
87
+ `)) as any
88
+ await settle()
89
+
90
+ const form = el.querySelector('ox-filters-form') as any
91
+ await form.updateComplete
92
+ const root = form.renderRoot as ShadowRoot
93
+ const deep = (node: ParentNode): boolean =>
94
+ Array.from(node.querySelectorAll('*')).some(one => one.matches('button.extra') || (!!one.shadowRoot && deep(one.shadowRoot)))
95
+ expect(deep(root), 'the header drawing is not in the filter form').to.equal(false)
96
+ expect(root.textContent).to.contain('flag')
97
+ expect(root.textContent).to.contain('kind')
98
+ })
68
99
  })