@visns-studio/visns-components 6.16.1 → 6.16.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/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.16.1",
98
+ "version": "6.16.3",
99
99
  "description": "Various packages to assist in the development of our Custom Applications.",
100
100
  "main": "src/index.js",
101
101
  "files": [
@@ -3953,14 +3953,15 @@ const DataGrid = forwardRef(
3953
3953
  // screens) — columns then render a few px wide
3954
3954
  // with no horizontal scrollbar ever appearing.
3955
3955
  // A date filter needs room for its locale mask
3956
- // ("dd/mm/yyyy" + the picker glyph); below ~140px
3957
- // the native input clips its own value.
3956
+ // ("dd / mm / yyyy" in Firefox, glyph included -
3957
+ // Firefox will not hide it); below ~160px the
3958
+ // native input clips its own value.
3958
3959
  minWidth:
3959
3960
  column.minWidth ??
3960
3961
  (['date', 'datetime', 'datetime-local'].includes(
3961
3962
  column.type
3962
3963
  )
3963
- ? Math.max(grid.columnMinWidth, 140)
3964
+ ? Math.max(grid.columnMinWidth, 160)
3964
3965
  : grid.columnMinWidth),
3965
3966
  maxWidth: column.maxWidth ?? undefined,
3966
3967
  textAlign: column.textAlign ?? undefined,
@@ -180,6 +180,19 @@ const NativeDateInput = ({
180
180
  {...rest}
181
181
  ref={inputRef}
182
182
  type={withTime ? 'datetime-local' : 'date'}
183
+ // The picker glyph is hidden in the grid (it cost the year); a
184
+ // click anywhere in the field opens the picker instead, where the
185
+ // browser supports it. Typing still works.
186
+ onClick={(event) => {
187
+ if (event.currentTarget.disabled) return;
188
+
189
+ try {
190
+ event.currentTarget.showPicker?.();
191
+ } catch (error) {
192
+ // Some browsers only allow showPicker from a user gesture
193
+ // in certain contexts; the field still accepts typing.
194
+ }
195
+ }}
183
196
  className="visns-native-date-filter__input"
184
197
  value={inputValue}
185
198
  disabled={disabled}
@@ -485,17 +485,22 @@ body.tablet-mode .InovuaReactDataGrid__cell.cell-word-wrap > div {
485
485
  min-width: 0;
486
486
  height: auto;
487
487
  margin: 0;
488
- padding: 0 2px 0 6px;
488
+ /* Fill the 32px row the theme pins the filter to, and centre the text in
489
+ it: Chrome lays the date segments out in an internal box that otherwise
490
+ sits high in a taller parent. */
491
+ height: 100%;
492
+ align-self: stretch;
493
+ padding: 0 4px;
489
494
  border: none;
490
495
  outline: none;
491
496
  background: none;
492
497
  color: inherit;
493
498
  font-family: 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;
499
+ /* Two notches under the grid's 14px: the locale mask is ten characters
500
+ plus Chrome's segment padding, and the filter row is narrow. */
501
+ font-size: 12px;
497
502
  letter-spacing: -0.01em;
498
- line-height: 1;
503
+ line-height: normal;
499
504
  font-variant-numeric: tabular-nums;
500
505
  -webkit-appearance: none;
501
506
  appearance: none;
@@ -509,32 +514,15 @@ body.tablet-mode .InovuaReactDataGrid__cell.cell-word-wrap > div {
509
514
  color: rgba(85, 94, 104, 0.7);
510
515
  }
511
516
 
512
- /* The calendar glyph IS how the picker opens on desktop — keep it, just
513
- shrink it into the 32px row. */
517
+ /* No calendar glyph in the grid: it cost the year in a narrow column, and a
518
+ click anywhere in the field opens the picker (showPicker) instead. */
514
519
  .visns-native-date-filter__input::-webkit-calendar-picker-indicator {
515
- margin: 0;
516
- padding: 0 2px;
517
- opacity: 0.55;
518
- cursor: pointer;
519
- }
520
-
521
- .visns-native-date-filter__input::-webkit-calendar-picker-indicator:hover {
522
- opacity: 1;
520
+ display: none;
523
521
  }
524
522
 
525
523
  /* In a narrow column the glyph costs the last two digits of the year; the
526
524
  field still opens the picker on click/Space, so drop the glyph first and the
527
525
  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
526
  @container (max-width: 104px) {
539
527
  .visns-native-date-filter__clear {
540
528
  display: none;
@@ -550,8 +538,21 @@ body.tablet-mode .InovuaReactDataGrid__cell.cell-word-wrap > div {
550
538
  }
551
539
 
552
540
  .visns-native-date-filter__input::-moz-calendar-picker-indicator {
553
- opacity: 0.55;
554
- cursor: pointer;
541
+ display: none;
542
+ }
543
+
544
+ /* Firefox (109+) draws its calendar glyph as part of the control and ignores
545
+ the pseudo-element above, and it pads each date segment itself, which sat
546
+ the text high in the 32px row. Tighter metrics, and the column default below
547
+ (160px for date types) leaves the glyph its room. */
548
+ @-moz-document url-prefix() {
549
+ .visns-native-date-filter__input {
550
+ padding: 0 0 0 2px;
551
+ font-size: 12px;
552
+ line-height: 28px;
553
+ height: 28px;
554
+ align-self: center;
555
+ }
555
556
  }
556
557
 
557
558
  .visns-native-date-filter__clear {