@itrocks/list 0.28.0 → 0.28.3

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/README.md CHANGED
@@ -31,7 +31,7 @@ HTML rendering provides columns, filters, ordered sorting and session preference
31
31
  business objects for API consumers. See the public methods below for their shared contracts.
32
32
 
33
33
  Column filter values use the same text highlight as the toolbar summary.
34
- After applying column filters, the toolbar shows a decorative filter icon and a read-only summary.
34
+ When a filter is active, the toolbar shows the read-only summary beside a button that focuses the first column filter.
35
35
  The summary uses unique single-word column labels when available.
36
36
  Applying a search from a column filter returns focus to that field and selects its full value.
37
37
  When the toolbar runs out of space, the filter and add-column button move to a second row.
@@ -1,5 +1,7 @@
1
1
  <!--criteria-->
2
- <span class="list-filter-icon" aria-hidden="true"></span>
2
+ <button aria-label="Edit the filter" class="list-filter-icon" data-focus-column-filter
3
+ title="Edit the filter" type="button"></button>
3
4
  <span aria-label="Active list filters" class="list-filter-text" role="group"
4
- ><!--items--><code>{caption}</code><code class="list-filter-value">{value}</code>{space}<!--end--></span>
5
+ ><!--items--><code class="list-filter-criterion"
6
+ >{caption}<span class="list-filter-value">{value}</span></code>{space}<!--end--></span>
5
7
  <!--end-->
package/cjs/list.html CHANGED
@@ -41,7 +41,7 @@
41
41
  <thead>
42
42
  <tr class="properties">
43
43
  <th class="select" data-freeze><!--selection-->{{template}}<!--end-->
44
- <input class="search-submit" title="Search" type="submit" value="Search">
44
+ <input class="search-submit" title="Filter" type="submit" value="Filter">
45
45
  </th>
46
46
  <!--columns-->
47
47
  <th data-property="{name}" data-reverse="{?reverse}" data-sort="{?sort}"
package/list.css CHANGED
@@ -257,11 +257,9 @@ table.objects > thead > tr.properties > th > input:focus:not(.search-submit) {
257
257
  }
258
258
 
259
259
  main > article[data-action=list] > header > .list-toolbar {
260
- --list-toolbar-gap: 5px;
261
260
  align-items: center;
262
261
  border-bottom: 1px solid #ccc;
263
262
  display: grid;
264
- gap: var(--list-toolbar-gap);
265
263
  grid-template-areas: "actions filter count add";
266
264
  grid-template-columns: auto minmax(0, 1fr) auto max-content;
267
265
  }
@@ -270,7 +268,6 @@ main > article[data-action=list] > header > .list-toolbar:has(> .add-column[hidd
270
268
  grid-template-columns: auto minmax(0, 1fr) auto;
271
269
  }
272
270
  main > article[data-action=list] > header > .list-toolbar[data-filter-row] {
273
- gap: 0;
274
271
  grid-template-areas: "actions count count" "filter filter add";
275
272
  grid-template-columns: minmax(0, 1fr) auto max-content;
276
273
  }
@@ -278,11 +275,9 @@ main > article[data-action=list] > header > .list-toolbar[data-filter-row]:has(>
278
275
  grid-template-areas: "actions count" "filter filter";
279
276
  grid-template-columns: minmax(0, 1fr) auto;
280
277
  }
281
- main > article[data-action=list] > header > .list-toolbar[data-filter-row] > :is(.general.actions, .summary) {
278
+ main > article[data-action=list] > header > .list-toolbar[data-filter-row] > .general.actions {
282
279
  align-self: stretch;
283
280
  border-bottom: 1px solid #ccc;
284
- }
285
- main > article[data-action=list] > header > .list-toolbar[data-filter-row] > .general.actions {
286
281
  flex-wrap: wrap;
287
282
  overflow-x: auto;
288
283
  }
@@ -290,9 +285,7 @@ main > article[data-action=list] > header > .list-toolbar[data-filter-row] > .li
290
285
  align-self: stretch;
291
286
  }
292
287
  main > article[data-action=list] > header > .list-toolbar[data-filter-row] > .summary {
293
- align-content: center;
294
- justify-self: stretch;
295
- text-align: end;
288
+ border-bottom: 1px solid #ccc;
296
289
  }
297
290
  main > article[data-action=list] > header > .list-toolbar > .add-column {
298
291
  align-self: stretch;
@@ -312,50 +305,51 @@ main > article[data-action=list] > header > .list-toolbar > .add-column:hover {
312
305
  }
313
306
  main > article[data-action=list] > header > .list-toolbar > .list-filter {
314
307
  grid-area: filter;
315
- padding-inline: 5px;
316
308
  }
317
309
  main > article[data-action=list] > header > .list-toolbar > .general.actions {
318
310
  border-bottom: 0;
319
311
  flex-wrap: nowrap;
320
312
  grid-area: actions;
321
313
  min-width: 0;
314
+ padding-inline-end: 0;
322
315
  }
323
316
  main > article[data-action=list] > header > .list-toolbar > .general.actions > li {
324
317
  flex: none;
325
318
  white-space: nowrap;
326
319
  }
327
320
  main > article[data-action=list] > header > .list-toolbar > .summary {
328
- display: inline-block;
321
+ align-content: center;
322
+ align-self: stretch;
329
323
  grid-area: count;
330
- justify-self: end;
331
- padding: 5px 10px;
324
+ padding-inline: 4px 10px;
325
+ text-align: end;
332
326
  white-space: nowrap;
333
327
  }
334
328
 
335
329
  .list-filter {
330
+ --list-filter-criterion-color: #888;
331
+ --list-filter-value-background: #d5edff;
332
+ --list-filter-value-color: #12365b;
336
333
  align-items: center;
337
334
  display: flex;
338
335
  flex: 1;
339
- gap: 0.4em;
340
336
  min-width: 0;
341
337
  }
342
338
  .list-filter .list-filter-icon {
343
339
  background: url("filter.svg") center/18px no-repeat;
344
340
  }
345
- .list-filter span.list-filter-icon {
341
+ .list-filter .list-filter-icon, .list-filter > .list-filter-reset {
342
+ box-sizing: border-box;
346
343
  flex: none;
347
- height: 18px;
348
- width: 18px;
344
+ height: 36px;
345
+ padding: 0;
346
+ width: 32px;
349
347
  }
350
348
  .list-filter button.list-filter-icon, .list-filter > .list-filter-reset {
351
349
  border: 0;
352
350
  border-radius: 2px;
353
351
  cursor: pointer;
354
- flex: none;
355
- height: 36px;
356
- padding: 0;
357
352
  touch-action: manipulation;
358
- width: 32px;
359
353
  }
360
354
  .list-filter button.list-filter-icon:hover, .list-filter > .list-filter-reset:hover {
361
355
  background-color: #eee;
@@ -371,8 +365,6 @@ main > article[data-action=list] > header > .list-toolbar > .summary {
371
365
  display: block;
372
366
  }
373
367
  .list-filter .list-filter-text {
374
- border-bottom: 1px dotted #888;
375
- flex: 1;
376
368
  min-width: 0;
377
369
  overflow-x: auto;
378
370
  white-space: pre;
@@ -380,7 +372,10 @@ main > article[data-action=list] > header > .list-toolbar > .summary {
380
372
  .list-filter code {
381
373
  font: inherit;
382
374
  }
375
+ .list-filter .list-filter-criterion {
376
+ text-decoration: underline dotted var(--list-filter-criterion-color);
377
+ }
383
378
  .list-filter .list-filter-value {
384
- background: #d5edff;
385
- color: #12365b;
379
+ background: var(--list-filter-value-background);
380
+ color: var(--list-filter-value-color);
386
381
  }
package/package.json CHANGED
@@ -33,6 +33,7 @@
33
33
  "@itrocks/class-file": "latest",
34
34
  "@itrocks/fastify-file-session-store": "latest",
35
35
  "@types/node": "^24.10",
36
+ "pdf-lib": "^1.17.1",
36
37
  "sass": "^1.95",
37
38
  "typescript": "^7.0"
38
39
  },
@@ -102,5 +103,5 @@
102
103
  "build:front": "tsc -p src/front/tsconfig.json",
103
104
  "test": "npm run build:cjs && node --test \"test/**/*.test.mjs\""
104
105
  },
105
- "version": "0.28.0"
106
+ "version": "0.28.3"
106
107
  }
package/search-focus.js CHANGED
@@ -42,6 +42,10 @@ build({
42
42
  priority: 2000,
43
43
  selector: 'article[data-action="list"] > form'
44
44
  });
45
+ build('.list-filter > button[data-focus-column-filter]', 'click', function () {
46
+ this.closest('article[data-action="list"]')
47
+ ?.querySelector(':scope > form input[data-property-filter]:enabled')?.focus();
48
+ });
45
49
  build('.list-filter > .list-filter-reset', 'click', function () {
46
50
  const form = this.closest('article[data-action="list"]')?.querySelector(':scope > form');
47
51
  if (!form)
package/toolbar.js CHANGED
@@ -58,9 +58,8 @@ function watchToolbar(toolbar) {
58
58
  frame = undefined;
59
59
  const style = getComputedStyle(toolbar);
60
60
  const available = toolbar.getBoundingClientRect().width - inlineEdges(style);
61
- const gaps = (add.hidden ? 2 : 3) * pixels(style.getPropertyValue('--list-toolbar-gap'));
62
61
  const required = actionsWidth(actions) + filterWidth(filter) + contentWidth(count, getComputedStyle(count))
63
- + add.getBoundingClientRect().width + gaps;
62
+ + add.getBoundingClientRect().width;
64
63
  toolbar.toggleAttribute('data-filter-row', required > available);
65
64
  }
66
65
  function schedule() {