@visns-studio/visns-components 6.15.0 → 6.15.2

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
@@ -95,7 +95,7 @@
95
95
  "react-dom": "^17.0.0 || ^18.0.0 || ^19.0.0"
96
96
  },
97
97
  "name": "@visns-studio/visns-components",
98
- "version": "6.15.0",
98
+ "version": "6.15.2",
99
99
  "description": "Various packages to assist in the development of our Custom Applications.",
100
100
  "main": "src/index.js",
101
101
  "files": [
@@ -3145,7 +3145,7 @@ const DataGrid = forwardRef(
3145
3145
  width: '28px',
3146
3146
  height: '28px',
3147
3147
  boxShadow: '0 1px 2px rgba(0,0,0,0.05)',
3148
- margin: '0 1px',
3148
+ margin: 0,
3149
3149
  cursor: 'pointer',
3150
3150
  }}
3151
3151
  >
@@ -3194,7 +3194,7 @@ const DataGrid = forwardRef(
3194
3194
  width: '28px',
3195
3195
  height: '28px',
3196
3196
  boxShadow: '0 1px 2px rgba(0,0,0,0.05)',
3197
- margin: '0 1px',
3197
+ margin: 0,
3198
3198
  cursor: 'pointer',
3199
3199
  }}
3200
3200
  >
@@ -3203,8 +3203,12 @@ const DataGrid = forwardRef(
3203
3203
  data-tooltip-content={tooltipContent}
3204
3204
  strokeWidth={2}
3205
3205
  size={18}
3206
- className={styles.tdaction}
3206
+ // Not styles.tdaction: that class carries
3207
+ // the action column's 16px bottom margin
3208
+ // and padding, which pushed these icons
3209
+ // out of line with the row.
3207
3210
  style={{
3211
+ display: 'block',
3208
3212
  color: 'var(--primary-color, #4a90e2)',
3209
3213
  }}
3210
3214
  />
@@ -3292,15 +3296,17 @@ const DataGrid = forwardRef(
3292
3296
  return (
3293
3297
  <div
3294
3298
  style={{
3295
- display: 'inline-flex', // Changed to inline-flex to keep icons in a single row
3296
- flexWrap: 'nowrap', // Prevent wrapping
3299
+ // Same shape as the action column's cluster: one row,
3300
+ // a small even gap, centred in the cell.
3301
+ display: 'flex',
3302
+ flexWrap: 'nowrap',
3297
3303
  alignItems: 'center',
3298
- justifyContent: 'flex-start',
3299
- gap: '1px', // Reduced gap since we have margins on the icons
3300
- padding: '2px 0',
3304
+ justifyContent: 'center',
3305
+ gap: '4px',
3306
+ width: '100%',
3307
+ padding: 0,
3301
3308
  minHeight: '24px',
3302
- maxWidth: '100%',
3303
- overflow: 'hidden', // Hide overflow if too many icons
3309
+ overflow: 'hidden',
3304
3310
  }}
3305
3311
  >
3306
3312
  {icons.length > 0 ? (
@@ -3945,7 +3951,16 @@ const DataGrid = forwardRef(
3945
3951
  // clamped columns exceed the container (narrow
3946
3952
  // screens) — columns then render a few px wide
3947
3953
  // with no horizontal scrollbar ever appearing.
3948
- minWidth: column.minWidth ?? grid.columnMinWidth,
3954
+ // A date filter needs room for its locale mask
3955
+ // ("dd/mm/yyyy" + the picker glyph); below ~140px
3956
+ // the native input clips its own value.
3957
+ minWidth:
3958
+ column.minWidth ??
3959
+ (['date', 'datetime', 'datetime-local'].includes(
3960
+ column.type
3961
+ )
3962
+ ? Math.max(grid.columnMinWidth, 140)
3963
+ : grid.columnMinWidth),
3949
3964
  maxWidth: column.maxWidth ?? undefined,
3950
3965
  textAlign: column.textAlign ?? undefined,
3951
3966
  textVerticalAlign:
@@ -444,6 +444,8 @@ body.tablet-mode .InovuaReactDataGrid__cell.cell-word-wrap > div {
444
444
  .visns-native-date-filter {
445
445
  position: relative;
446
446
  display: flex;
447
+ /* Lets the rules below react to the column's width, not the window's. */
448
+ container-type: inline-size;
447
449
  /* stretch, not center: the input has to fill the 32px the theme pins the
448
450
  filter to, or the clickable area is smaller than the box it draws. */
449
451
  align-items: stretch;
@@ -483,14 +485,18 @@ body.tablet-mode .InovuaReactDataGrid__cell.cell-word-wrap > div {
483
485
  min-width: 0;
484
486
  height: auto;
485
487
  margin: 0;
486
- padding: 0 2px 0 8px;
488
+ padding: 0 2px 0 6px;
487
489
  border: none;
488
490
  outline: none;
489
491
  background: none;
490
492
  color: inherit;
491
493
  font-family: inherit;
492
- font-size: inherit;
494
+ /* A notch under the grid's 14px: the locale mask is ten characters and
495
+ the default filter row is narrow. */
496
+ font-size: 13px;
497
+ letter-spacing: -0.01em;
493
498
  line-height: 1;
499
+ font-variant-numeric: tabular-nums;
494
500
  -webkit-appearance: none;
495
501
  appearance: none;
496
502
  }
@@ -516,6 +522,25 @@ body.tablet-mode .InovuaReactDataGrid__cell.cell-word-wrap > div {
516
522
  opacity: 1;
517
523
  }
518
524
 
525
+ /* In a narrow column the glyph costs the last two digits of the year; the
526
+ field still opens the picker on click/Space, so drop the glyph first and the
527
+ clear button only when there is really no room. */
528
+ @container (max-width: 128px) {
529
+ .visns-native-date-filter__input::-webkit-calendar-picker-indicator {
530
+ display: none;
531
+ }
532
+
533
+ .visns-native-date-filter__input {
534
+ padding-right: 0;
535
+ }
536
+ }
537
+
538
+ @container (max-width: 104px) {
539
+ .visns-native-date-filter__clear {
540
+ display: none;
541
+ }
542
+ }
543
+
519
544
  /* Browser-supplied clear / spin affordances are replaced by our own button,
520
545
  which is consistent across engines. */
521
546
  .visns-native-date-filter__input::-webkit-clear-button,