@operato/data-grist 10.29.39 → 10.29.40

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.39",
3
+ "version": "10.29.40",
4
4
  "description": "User interface for grid (desktop) and list (mobile)",
5
5
  "author": "heartyoh",
6
6
  "type": "module",
@@ -78,10 +78,10 @@
78
78
  "@material/web": "^2.0.0",
79
79
  "@operato/headroom": "^10.29.1",
80
80
  "@operato/i18n": "^10.29.27",
81
- "@operato/input": "^10.29.39",
81
+ "@operato/input": "^10.29.40",
82
82
  "@operato/list-state": "^10.29.39",
83
- "@operato/p13n": "^10.29.39",
84
- "@operato/popup": "^10.29.39",
83
+ "@operato/p13n": "^10.29.40",
84
+ "@operato/popup": "^10.29.40",
85
85
  "@operato/pull-to-refresh": "^10.29.23",
86
86
  "@operato/styles": "^10.29.30",
87
87
  "@operato/time-calculator": "^10.29.1",
@@ -124,5 +124,5 @@
124
124
  "prettier --write"
125
125
  ]
126
126
  },
127
- "gitHead": "f48742480ad2b9ce87f0b3b4c3ac5923f4866ad6"
127
+ "gitHead": "54a5aa4812524b56cd5a1b67e76d9fad28abffc8"
128
128
  }
@@ -21,10 +21,24 @@ describe('filter field ownership', () => {
21
21
  [year, month],
22
22
  ['month']
23
23
  )
24
- expect(result).to.deep.equal([...base.filter(filter => filter.name !== 'month'), predicate('month', 'eq', 11)])
24
+ expect(result).to.deep.equal([base[0], base[1], base[2], predicate('month', 'eq', 11), base[4]])
25
25
  expect(externalFilters(result, [year, month]).map(one => one.filter)).to.deep.equal([base[1], base[2], base[4]])
26
26
  })
27
27
 
28
+ it('a field changed to the value it holds leaves the filters as they were, order included', () => {
29
+ const base = [predicate('year', 'eq', '2026'), predicate('month', 'eq', '10')]
30
+ const fields = [predicate('year', 'eq', '2026'), predicate('month', 'eq', '10')]
31
+ expect(patchFilterFields(base, fields, [year, month], ['year'])).to.deep.equal(base)
32
+ })
33
+
34
+ it('a field that held nothing adds its predicate after the others', () => {
35
+ const base = [predicate('amount', 'gte', 100000)]
36
+ expect(patchFilterFields(base, [predicate('month', 'eq', '9')], [year, month], ['month'])).to.deep.equal([
37
+ base[0],
38
+ predicate('month', 'eq', '9')
39
+ ])
40
+ })
41
+
28
42
  it('ambiguous equalities both stay as chips and leave the field empty', () => {
29
43
  const base = [predicate('year', 'eq', 2025), predicate('year', 'eq', 2026)]
30
44
  expect(ownedFilterIndex(base, year)).to.equal(-1)