@easyvision/easyvision-ui 1.7.3 → 1.7.5

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
@@ -943,13 +943,15 @@ What changes in `'eager'` mode (api only):
943
943
 
944
944
  Use `'eager-ids'` when the consumer only needs ids (bulk action by id, export by id, submit-by-id) and selections can reach the tens of thousands — `'eager'` would carry every row object across all pages, which is wasteful at that scale.
945
945
 
946
+ **Wire-level payload reduction.** During eager-ids resolution the table sets `idsOnly: true` on each `fetchData` call. The built-in loopback adapter honors this by requesting `fields: ['id']` and dropping `include` for those calls — so the server returns only id objects, not full rows, dramatically shrinking the network payload for large selections. Custom `fetchData` implementations can read `params.idsOnly` and apply the same optimization (or ignore it — they'll still work, just sending more bytes than needed). The loopback adapter accepts an `idFields?: string[]` option (defaults to `['id']`) if your model's primary key is named differently.
947
+
946
948
  Trade-offs:
947
949
 
948
950
  | Mode | Network on select-all | Memory per selection | Reorder while selected | Untick individual rows | Best for |
949
951
  |---|---|---|---|---|---|
950
952
  | `'lazy'` (default) | none | O(page) | free | via `exceptIds` | export / submit flows; no list manipulation |
951
- | `'eager'` | one paginated sweep | O(all ids + all rows) | locked | via header toggle (adds visible rows to `exceptIds`) | preview / reorder / transform before submit; one-line consumer code |
952
- | `'eager-ids'` | one paginated sweep | O(all ids only) | locked | via header toggle (adds visible rows to `exceptIds`) | bulk action by id at scale (50k+); consumer only needs ids |
953
+ | `'eager'` | one paginated sweep, full rows | O(all ids + all rows) | locked | via header toggle (adds visible rows to `exceptIds`) | preview / reorder / transform before submit; one-line consumer code |
954
+ | `'eager-ids'` | one paginated sweep, **ids only** (loopback adapter) | O(all ids only) | locked | via header toggle (adds visible rows to `exceptIds`) | bulk action by id at scale (50k+); consumer only needs ids |
953
955
 
954
956
  Has no effect when `paginationMode === 'local'` (the table already knows the full set).
955
957
 
@@ -214,6 +214,7 @@
214
214
 
215
215
  /* ---------- Checkbox ---------- */
216
216
  .ev-checkbox {
217
+ position: relative;
217
218
  display: inline-flex;
218
219
  align-items: center;
219
220
  justify-content: center;
@@ -226,6 +227,14 @@
226
227
  color: hsl(var(--primary, 222 47% 11%));
227
228
  cursor: pointer;
228
229
  }
230
+ /* Expand the click target without changing the visual size. The pseudo-element
231
+ * is part of the button, so clicks on it trigger the checkbox and any
232
+ * stopPropagation handler the consumer attached (e.g. table rows). */
233
+ .ev-checkbox::before {
234
+ content: "";
235
+ position: absolute;
236
+ inset: -0.5rem;
237
+ }
229
238
  .ev-checkbox:focus-visible {
230
239
  outline: 2px solid hsl(var(--ring, 215 20% 65%));
231
240
  outline-offset: 2px;
@@ -311,12 +320,16 @@
311
320
  overflow: hidden;
312
321
  text-overflow: ellipsis;
313
322
  white-space: nowrap;
323
+ /* The trigger is the <button>; children should never swallow the click so
324
+ * the entire visible button area always behaves as the hit target. */
325
+ pointer-events: none;
314
326
  }
315
327
  .ev-select-trigger-icon {
316
328
  height: 1rem;
317
329
  width: 1rem;
318
330
  opacity: 0.5;
319
331
  flex-shrink: 0;
332
+ pointer-events: none;
320
333
  }
321
334
 
322
335
  /* Bare trigger variant used inside chips */
@@ -1204,6 +1217,7 @@
1204
1217
  outline: none;
1205
1218
  }
1206
1219
  .ev-mf-chip-select-trigger {
1220
+ position: relative;
1207
1221
  height: auto;
1208
1222
  width: auto;
1209
1223
  min-width: 0;
@@ -1216,6 +1230,13 @@
1216
1230
  line-height: 1rem;
1217
1231
  color: hsl(var(--muted-foreground, 215 16% 47%));
1218
1232
  }
1233
+ /* The chip trigger has no padding so the visible click area is just text+icon.
1234
+ * Extend the hit target without changing visual size. */
1235
+ .ev-mf-chip-select-trigger::before {
1236
+ content: "";
1237
+ position: absolute;
1238
+ inset: -0.375rem -0.25rem;
1239
+ }
1219
1240
  .ev-mf-chip-select-trigger:focus {
1220
1241
  outline: none;
1221
1242
  }
package/dist/index.cjs CHANGED
@@ -2011,23 +2011,26 @@ function ColumnVisibilityMenu({ table, label }) {
2011
2011
 
2012
2012
  // adapters/loopback.ts
2013
2013
  function createLoopbackTableFetcher(opts) {
2014
- const { fetchPage, fetchCount, include, fields, defaultOrder } = opts;
2014
+ const { fetchPage, fetchCount, include, fields, defaultOrder, idFields } = opts;
2015
2015
  return async ({
2016
2016
  page,
2017
2017
  itemsPerPage,
2018
2018
  sort,
2019
- filter
2019
+ filter,
2020
+ idsOnly
2020
2021
  }) => {
2021
2022
  const order = sort ? [`${sort.column} ${sort.descending ? "DESC" : "ASC"}`] : defaultOrder ?? [];
2022
2023
  const skip = (page - 1) * itemsPerPage;
2023
2024
  const where = filter?.where ?? {};
2025
+ const effectiveFields = idsOnly ? idFields ?? ["id"] : fields;
2026
+ const effectiveInclude = idsOnly ? void 0 : include;
2024
2027
  const pageFilter = {
2025
2028
  where,
2026
2029
  skip,
2027
2030
  limit: itemsPerPage,
2028
2031
  order,
2029
- ...include ? { include } : {},
2030
- ...fields ? { fields } : {}
2032
+ ...effectiveInclude ? { include: effectiveInclude } : {},
2033
+ ...effectiveFields ? { fields: effectiveFields } : {}
2031
2034
  };
2032
2035
  const [rows, count] = await Promise.all([
2033
2036
  fetchPage(pageFilter),
@@ -2315,7 +2318,8 @@ function EasyVisionTable(props) {
2315
2318
  page: p,
2316
2319
  itemsPerPage: PAGE_SIZE,
2317
2320
  sort,
2318
- filter: merged
2321
+ filter: merged,
2322
+ idsOnly: !collectRows
2319
2323
  });
2320
2324
  if (seq !== eagerSeqRef.current) return;
2321
2325
  knownTotal = result.totalCount;