@jsenv/navi 0.29.105 → 0.29.106
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/dist/jsenv_navi.js +12 -3
- package/dist/jsenv_navi.js.map +2 -2
- package/docs/popup_open.md +28 -0
- package/package.json +1 -1
package/docs/popup_open.md
CHANGED
|
@@ -270,6 +270,34 @@ dialog hides: a popup written once, far from every press that opens it, has to
|
|
|
270
270
|
be told what it is about and has to answer somebody — and neither question
|
|
271
271
|
exists once the popup is written where it is used.
|
|
272
272
|
|
|
273
|
+
### A trigger that is only an icon
|
|
274
|
+
|
|
275
|
+
`variant="icon"` draws no value, and therefore no slot beside one either: the
|
|
276
|
+
whole trigger is its `ui`.
|
|
277
|
+
|
|
278
|
+
```jsx
|
|
279
|
+
<Picker variant="icon" ui={<DisketteSvg />} />
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
Left out, that `ui` is the icon the slot would have shown — the chevron, or the
|
|
283
|
+
one the picker's type carries (a pencil for `type="text"`, a calendar for
|
|
284
|
+
`type="date"`), so `<Picker type="date" variant="icon" />` is a calendar and
|
|
285
|
+
nothing else. `rightSlotIcon`/`rightSlot` belong to the shapes that DO draw a
|
|
286
|
+
value and want something beside it; under `variant="icon"` the first is only the
|
|
287
|
+
default for `ui`, and the second has nowhere to go — the clear cross included.
|
|
288
|
+
|
|
289
|
+
### When a shared popup is still the right answer
|
|
290
|
+
|
|
291
|
+
Two cases, and only two:
|
|
292
|
+
|
|
293
|
+
- **the press can come from anywhere** — a keyboard shortcut, a menu, a button,
|
|
294
|
+
all opening the same thing. Written per press it would exist several times
|
|
295
|
+
over, each with its own open state;
|
|
296
|
+
- **the popup has to outlive its trigger** — a row that leaves while its dialog
|
|
297
|
+
is open (a list refreshing under it) takes a popup written inside it with it.
|
|
298
|
+
|
|
299
|
+
Neither is "one popup per row of a list", which is what a picker is for.
|
|
300
|
+
|
|
273
301
|
Do not mix the two. A `<Form>` at the root of a picker's popup IS the mirrored
|
|
274
302
|
control, so its value is the picker's value: handing the picker something else
|
|
275
303
|
(a created profile, say) pushes it back down into the form's named fields and
|