@jsenv/navi 0.29.131 → 0.29.132

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.
@@ -59296,6 +59296,22 @@ const PickerConfirmBody = ({
59296
59296
 
59297
59297
  const PickerContext = createContext();
59298
59298
 
59299
+ /*
59300
+ * A typed picker (`type="date"`, `type="array"`, …) draws its value with a ui
59301
+ * of navi's own, installed as the very "ui" prop a caller overrides to draw
59302
+ * that value themselves. Marking navi's own tells the two apart afterwards:
59303
+ * an empty value is greyed as a placeholder only when the drawing is navi's —
59304
+ * a caller's ui may well be their way of writing "no filter", which is an
59305
+ * answer, not a blank (see navi-placeholder in picker.jsx).
59306
+ */
59307
+ const asPickerOwnUI = PickerUI => {
59308
+ PickerUI.isPickerOwnUI = true;
59309
+ return PickerUI;
59310
+ };
59311
+ const pickerUIIsNaviOwn = ui => {
59312
+ return Boolean(ui) && typeof ui === "object" && Boolean(ui.type?.isPickerOwnUI);
59313
+ };
59314
+
59299
59315
  const PickerNaviMinute = props => {
59300
59316
  const Next = useNextResolver();
59301
59317
  const {
@@ -66335,7 +66351,7 @@ const PickerObject = props => {
66335
66351
  "navi-state-shape": "object"
66336
66352
  });
66337
66353
  };
66338
- const PickerObjectUI = () => {
66354
+ const PickerObjectUI = asPickerOwnUI(() => {
66339
66355
  const {
66340
66356
  value,
66341
66357
  placeholder
@@ -66360,7 +66376,7 @@ const PickerObjectUI = () => {
66360
66376
  }, key);
66361
66377
  })
66362
66378
  });
66363
- };
66379
+ });
66364
66380
  const PickerArray = props => {
66365
66381
  const Next = useNextResolver();
66366
66382
  return jsx(Next, {
@@ -66370,7 +66386,7 @@ const PickerArray = props => {
66370
66386
  "navi-state-shape": "array"
66371
66387
  });
66372
66388
  };
66373
- const PickerArrayUI = () => {
66389
+ const PickerArrayUI = asPickerOwnUI(() => {
66374
66390
  const {
66375
66391
  value,
66376
66392
  placeholder,
@@ -66392,7 +66408,7 @@ const PickerArrayUI = () => {
66392
66408
  }, item);
66393
66409
  })
66394
66410
  });
66395
- };
66411
+ });
66396
66412
 
66397
66413
  /**
66398
66414
  * One value the picker holds, drawn as a chip with a cross that takes it back
@@ -66453,7 +66469,7 @@ const PickerColor = props => {
66453
66469
  ...props
66454
66470
  });
66455
66471
  };
66456
- const PickerColorUI = () => {
66472
+ const PickerColorUI = asPickerOwnUI(() => {
66457
66473
  const {
66458
66474
  value,
66459
66475
  placeholder
@@ -66467,7 +66483,7 @@ const PickerColorUI = () => {
66467
66483
  return jsx(Color, {
66468
66484
  children: value
66469
66485
  });
66470
- };
66486
+ });
66471
66487
  const PickerDate = props => {
66472
66488
  const Next = useNextResolver();
66473
66489
  return jsx(Next, {
@@ -66477,7 +66493,7 @@ const PickerDate = props => {
66477
66493
  type: "date"
66478
66494
  });
66479
66495
  };
66480
- const PickerDateUI = props => {
66496
+ const PickerDateUI = asPickerOwnUI(props => {
66481
66497
  const {
66482
66498
  value,
66483
66499
  placeholder
@@ -66499,7 +66515,7 @@ const PickerDateUI = props => {
66499
66515
  ...props,
66500
66516
  children: value
66501
66517
  });
66502
- };
66518
+ });
66503
66519
  const PickerMonth = props => {
66504
66520
  const Next = useNextResolver();
66505
66521
  return jsx(Next, {
@@ -66509,7 +66525,7 @@ const PickerMonth = props => {
66509
66525
  type: "month"
66510
66526
  });
66511
66527
  };
66512
- const PickerMonthUI = props => {
66528
+ const PickerMonthUI = asPickerOwnUI(props => {
66513
66529
  const {
66514
66530
  value,
66515
66531
  placeholder
@@ -66530,7 +66546,7 @@ const PickerMonthUI = props => {
66530
66546
  ...props,
66531
66547
  children: value
66532
66548
  });
66533
- };
66549
+ });
66534
66550
  const PickerWeek = props => {
66535
66551
  const Next = useNextResolver();
66536
66552
  return jsx(Next, {
@@ -66540,7 +66556,7 @@ const PickerWeek = props => {
66540
66556
  type: "week"
66541
66557
  });
66542
66558
  };
66543
- const PickerWeekUI = props => {
66559
+ const PickerWeekUI = asPickerOwnUI(props => {
66544
66560
  const {
66545
66561
  value,
66546
66562
  placeholder
@@ -66561,7 +66577,7 @@ const PickerWeekUI = props => {
66561
66577
  ...props,
66562
66578
  children: value
66563
66579
  });
66564
- };
66580
+ });
66565
66581
  const PickerTime = props => {
66566
66582
  const Next = useNextResolver();
66567
66583
  return jsx(Next, {
@@ -66571,7 +66587,7 @@ const PickerTime = props => {
66571
66587
  type: "time"
66572
66588
  });
66573
66589
  };
66574
- const PickerTimeUI = props => {
66590
+ const PickerTimeUI = asPickerOwnUI(props => {
66575
66591
  const {
66576
66592
  value,
66577
66593
  placeholder
@@ -66591,7 +66607,7 @@ const PickerTimeUI = props => {
66591
66607
  ...props,
66592
66608
  children: value
66593
66609
  });
66594
- };
66610
+ });
66595
66611
  const PickerDuration = props => {
66596
66612
  const Next = useNextResolver();
66597
66613
  return jsx(Next, {
@@ -66602,7 +66618,7 @@ const PickerDuration = props => {
66602
66618
  "navi-input-type": "duration"
66603
66619
  });
66604
66620
  };
66605
- const PickerDurationUI = props => {
66621
+ const PickerDurationUI = asPickerOwnUI(props => {
66606
66622
  const {
66607
66623
  value,
66608
66624
  placeholder
@@ -66622,7 +66638,7 @@ const PickerDurationUI = props => {
66622
66638
  ...props,
66623
66639
  children: value
66624
66640
  });
66625
- };
66641
+ });
66626
66642
  const PickerDatetime = props => {
66627
66643
  const Next = useNextResolver();
66628
66644
  return jsx(Next, {
@@ -66632,7 +66648,7 @@ const PickerDatetime = props => {
66632
66648
  type: "datetime-local"
66633
66649
  });
66634
66650
  };
66635
- const PickerDatetimeUI = props => {
66651
+ const PickerDatetimeUI = asPickerOwnUI(props => {
66636
66652
  const {
66637
66653
  value,
66638
66654
  placeholder
@@ -66651,7 +66667,7 @@ const PickerDatetimeUI = props => {
66651
66667
  type: "datetime",
66652
66668
  children: value
66653
66669
  });
66654
- };
66670
+ });
66655
66671
  const PickerFile = props => {
66656
66672
  const Next = useNextResolver();
66657
66673
  return jsx(Next, {
@@ -66661,7 +66677,7 @@ const PickerFile = props => {
66661
66677
  ...props
66662
66678
  });
66663
66679
  };
66664
- const PickerFileUI = () => {
66680
+ const PickerFileUI = asPickerOwnUI(() => {
66665
66681
  const {
66666
66682
  value,
66667
66683
  placeholder
@@ -66674,7 +66690,7 @@ const PickerFileUI = () => {
66674
66690
  }
66675
66691
  // value is a FileList-like string from the input; display file names
66676
66692
  return String(value);
66677
- };
66693
+ });
66678
66694
 
66679
66695
  installImportMetaCssBuild(import.meta);const css$t = /* css */`
66680
66696
  @layer navi {
@@ -67505,11 +67521,16 @@ const PickerButton = props => {
67505
67521
  ,
67506
67522
 
67507
67523
  "data-picker-facade": ui === undefined ? undefined : ""
67508
- // A button's label is not a placeholder, however empty the
67509
- // picker behind it is.
67524
+ // A placeholder is the picker saying "nothing here yet" about
67525
+ // the value navi draws — the default rendering, or the one a
67526
+ // typed picker installs for itself. A button's label is not
67527
+ // that, however empty the picker behind it is, and neither is a
67528
+ // caller's own "ui": an empty value may be exactly what the
67529
+ // caller is drawing there ("no filter", "anywhere"), so how it
67530
+ // looks empty stays theirs (documented on the ui prop below).
67510
67531
  ,
67511
67532
 
67512
- "navi-placeholder": variant !== "button" && variant !== "text" && uiStateHoldsNothing(value) ? "" : undefined,
67533
+ "navi-placeholder": (ui === undefined || pickerUIIsNaviOwn(ui)) && variant !== "button" && variant !== "text" && uiStateHoldsNothing(value) ? "" : undefined,
67513
67534
  maxLines: maxLines,
67514
67535
  children: jsx(PickerOwnContent, {
67515
67536
  children: jsx(PickerContext.Provider, {