@yuneta/gobj-ui 7.26.46 → 7.26.48
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 +100 -16
- package/dist/gobj-ui.cjs.js +285 -60
- package/dist/gobj-ui.es.js +285 -60
- package/package.json +1 -1
- package/scripts/validate-locales.mjs +185 -8
- package/src/c_yui_form.css +9 -0
- package/src/c_yui_form.js +158 -20
- package/src/c_yui_shell.js +73 -4
- package/src/c_yui_treedb_topic_with_form.js +8 -2
- package/src/c_yui_window.js +15 -1
- package/src/form_table_rows.wiring.test.js +169 -3
- package/src/form_time_cell_editor.js +40 -23
- package/src/form_time_cell_editor.test.js +38 -0
- package/src/form_time_field.wiring.test.js +118 -0
- package/src/form_time_value.js +59 -1
- package/src/form_time_value.test.js +25 -1
- package/src/shell_focus_trap.js +19 -24
- package/src/shell_focus_trap.test.js +53 -9
- package/src/shell_stop_overlays.wiring.test.js +90 -5
- package/src/treedb_time_cell.wiring.test.js +103 -0
- package/src/window_rect_rounding.wiring.test.js +29 -1
- package/src/yui_tabulator_i18n.js +18 -7
- package/src/yui_tabulator_i18n.test.js +36 -0
package/README.md
CHANGED
|
@@ -229,9 +229,29 @@ Published as `@yuneta/gobj-ui`. Built on top of [`@yuneta/gobj-js`](https://gith
|
|
|
229
229
|
> yui_shell_push_escape(shell, "modal", ask_then_close, close_now);
|
|
230
230
|
> ```
|
|
231
231
|
>
|
|
232
|
-
> And
|
|
233
|
-
>
|
|
234
|
-
>
|
|
232
|
+
> **And it moves no browser history (7.26.47).** The markers of the overlays it
|
|
233
|
+
> closes are left in place, inert, as those of overlays a navigation drains: a
|
|
234
|
+
> later Back lands on one and is absorbed. In 7.26.46 the stop retired them with
|
|
235
|
+
> `history.back()`, which is asynchronous, and a stopped shell no longer hears
|
|
236
|
+
> where it lands: a logout followed by a new shell in the same turn had it take
|
|
237
|
+
> the new shell's first marker (Chromium), and the next Back left the app. An
|
|
238
|
+
> overlay parked on an action route (`redirect: "stay"`) whose `on_close` calls
|
|
239
|
+
> `yui_shell_unpark_route()` has the URL rewritten in place to the resting
|
|
240
|
+
> route, not taken back (7.26.48): a single `back()` landed on the action entry
|
|
241
|
+
> under the marker left in place, and the next shell opened the overlay again.
|
|
242
|
+
> An app that unparks with its OWN `history.back()` has the same defect: call
|
|
243
|
+
> `yui_shell_unpark_route()` instead. A
|
|
244
|
+
> question open at the stop answers what Escape answers -- `false` for a yes/no
|
|
245
|
+
> or a danger question, `"cancel"` for yes/no/cancel --; a
|
|
246
|
+
> `yui_shell_confirm_ok()` resolves as on every close, so code awaiting it runs
|
|
247
|
+
> after the stop and must not take the shell for alive.
|
|
248
|
+
>
|
|
249
|
+
> A trap whose panel is out of the document is not the top: the top is the
|
|
250
|
+
> highest trap whose panel is in it, so a trap left behind by an owner torn
|
|
251
|
+
> down with it no longer stands for an overlay that is gone. It is skipped, not
|
|
252
|
+
> dropped: it leaves the stack only by its `release()`, and a panel that only
|
|
253
|
+
> moves (taken out and put back) has its trap again (7.26.47; 7.26.46 dropped
|
|
254
|
+
> it for good).
|
|
235
255
|
|
|
236
256
|
## Two maintained lines
|
|
237
257
|
|
|
@@ -3656,12 +3676,40 @@ question. A reload or a close by code still discards the open editor (it is
|
|
|
3656
3676
|
cancelled before the rows go): asking is the host's part, and `edited` is
|
|
3657
3677
|
what tells it to.
|
|
3658
3678
|
|
|
3679
|
+
An edit the reader CANCELS -- Escape, or a box left as it was -- gives back the
|
|
3680
|
+
`edited` and `changes` the form had when that editor opened (7.26.47+): what was
|
|
3681
|
+
typed is gone, and up to 7.26.46 it still counted, so closing asked about a
|
|
3682
|
+
change that no longer existed. Nothing is given back when anything else changed
|
|
3683
|
+
the form while the editor was open (another cell committed, a paste): that
|
|
3684
|
+
change is real.
|
|
3685
|
+
|
|
3686
|
+
Enter in a box of the form never submits it (7.26.47+). The table's "add"
|
|
3687
|
+
button was the form's first submit button, so Enter in any field -- or in a cell
|
|
3688
|
+
editor that stays open -- added an empty row; and a form of a single text box
|
|
3689
|
+
reloaded the page.
|
|
3690
|
+
|
|
3659
3691
|
A `time` / `now` column of a table is edited in a `datetime-local` box, to the
|
|
3660
3692
|
second, read and written as the form's own time field is (`form_time_value.js`:
|
|
3661
3693
|
an epoch in seconds, or an ISO text for a string column). Up to 7.26.45 it was
|
|
3662
3694
|
Tabulator's `datetime` editor with a luxon `format`, and nothing gives gobj-ui
|
|
3663
3695
|
luxon: it opened empty and threw when committed. Luxon is not taken in for one
|
|
3664
|
-
editor.
|
|
3696
|
+
editor. The cell shows the same local clock, `2026-03-14 09:26:53` (7.26.47+; it
|
|
3697
|
+
showed the raw epoch).
|
|
3698
|
+
|
|
3699
|
+
A date with a part cleared is not a value. The box answers `""` for it, as for an
|
|
3700
|
+
empty box, and only `validity.badInput` tells them apart: Enter leaves the editor
|
|
3701
|
+
open, outlined and with `aria-invalid`, until the date is whole again or Escape;
|
|
3702
|
+
leaving the cell cancels, and the cell keeps its time (7.26.47+; up to 7.26.46
|
|
3703
|
+
one Backspace and Enter erased the stored time). **To clear a time on purpose,
|
|
3704
|
+
clear every part of the box**: an empty box writes `null`. Inside the box Tab
|
|
3705
|
+
moves between its parts, as the browser does.
|
|
3706
|
+
|
|
3707
|
+
The form's own time field and the cell editor read and write a column the same
|
|
3708
|
+
way (7.26.47+): an epoch in seconds, an ISO text for a `string` column, and an
|
|
3709
|
+
empty box for a column that holds no time. Up to 7.26.46 the field read every
|
|
3710
|
+
column with `parseInt` -- an ISO text as 2026 seconds, in January 1970 --, wrote
|
|
3711
|
+
the epoch into a `string` column, and showed no time as January 1970, which a
|
|
3712
|
+
save wrote back as `0`.
|
|
3665
3713
|
|
|
3666
3714
|
A table hears the reader through Tabulator's `dataChanged`, which Tabulator
|
|
3667
3715
|
does not say for `setData()` / `replaceData()`, nor when its `history` module
|
|
@@ -3739,11 +3787,15 @@ so it governs the row's own click, which toggles the row (a row drawn while it
|
|
|
3739
3787
|
was `false` stays unselectable until it is drawn again). With the defaults
|
|
3740
3788
|
nothing is selected.
|
|
3741
3789
|
|
|
3742
|
-
The checkbox column (`with_checkbox`) asks `selectable` too, and is
|
|
3743
|
-
|
|
3744
|
-
toggle is refused, and its header box selects every row without asking.
|
|
3745
|
-
|
|
3746
|
-
|
|
3790
|
+
The checkbox column (`with_checkbox`) asks `selectable` too, and is hidden while
|
|
3791
|
+
the form is not selectable (7.26.46): Tabulator's row box ticks before its
|
|
3792
|
+
toggle is refused, and its header box selects every row without asking. It
|
|
3793
|
+
follows `selectable` written at any time, in every table (7.26.47+; in 7.26.46
|
|
3794
|
+
it was read when the table was built, and a `false` written later left boxes
|
|
3795
|
+
that ticked without selecting). Its header box is named *select all rows*, a
|
|
3796
|
+
row's *select row*, and both change language with the form (consumer key
|
|
3797
|
+
`select all rows`, 7.26.47). A click in a NESTED table selects in that table
|
|
3798
|
+
only; it bubbled up to the row holding the table, which toggled too.
|
|
3747
3799
|
|
|
3748
3800
|
```js
|
|
3749
3801
|
gobj_create("form", "C_YUI_FORM", {
|
|
@@ -4059,6 +4111,18 @@ next to a version raised on main with the old range, deployed under that
|
|
|
4059
4111
|
version, and a package.json MOVED after a hand raise was taken for one born
|
|
4060
4112
|
with the range; and `7.26.45` refused every shallow clone.
|
|
4061
4113
|
|
|
4114
|
+
Since `7.26.47` a move git does not see as a rename is followed too -- a `git
|
|
4115
|
+
mv` with many changes (below `-M`'s 50%), a removal and an addition in two
|
|
4116
|
+
commits, a copy: where the package.json is BORN with the range and the version
|
|
4117
|
+
of the working tree, every package.json the repository had before it is read,
|
|
4118
|
+
by version. In a repository of two apps, a new one born with the range beside
|
|
4119
|
+
one that once had its number with another range has its version raised once
|
|
4120
|
+
more than needed -- a number spent, never a bundle under an old one. A state
|
|
4121
|
+
that is not json (a stray comma, conflict markers) is read by its lines, every
|
|
4122
|
+
`"version"` it holds: up to `7.26.46` one such commit anywhere in the history
|
|
4123
|
+
refused the app on every round, without naming the commit. A package.json of
|
|
4124
|
+
the working tree that is not json is refused naming the file.
|
|
4125
|
+
|
|
4062
4126
|
### Colour: a brand token as INK takes `-on-scheme`, as a FILL it does not
|
|
4063
4127
|
|
|
4064
4128
|
A Bulma brand colour (`--bulma-link`, `--bulma-danger`, …) is built to carry
|
|
@@ -4426,7 +4490,13 @@ well (``t[`call`](x, k)``, `t[M](x, k)` with `const M = "call"`, `i18next[T](k)`
|
|
|
4426
4490
|
with `const T = "t"`), and so is a SPREAD of an array the source writes out:
|
|
4427
4491
|
`t(...["k"])`, `t.call(x, ...["k"])`, `t(...KEYS)` and `t.apply(x, KEYS)` with
|
|
4428
4492
|
`const KEYS = ["k"]` -- each element of the const read as `KEYS[0]`,
|
|
4429
|
-
`KEYS[1]`... (up to `7.26.45` none of them was read, and nothing failed).
|
|
4493
|
+
`KEYS[1]`... (up to `7.26.45` none of them was read, and nothing failed). Since
|
|
4494
|
+
`7.26.47` each of those is THAT element, so `t.apply(null, ["save", "Save it"])`
|
|
4495
|
+
asks for "save" and not for its default value (`7.26.46` read every element of
|
|
4496
|
+
the array at every position, and asked for both), and a const ALIAS of such an
|
|
4497
|
+
array (`const B = KEYS; t(...B)`), an import of one, and an
|
|
4498
|
+
`Object.freeze([...])` are read as it is (up to `7.26.46` they were spreads of
|
|
4499
|
+
what the source does not write).
|
|
4430
4500
|
An ARRAY given to it is i18next's list of fallback keys, and
|
|
4431
4501
|
each one is a key: `t([specific, "generic"])` asks for "generic". A `.bind()`
|
|
4432
4502
|
that binds a KEY makes a translator whose calls hand i18next its options or its
|
|
@@ -4479,6 +4549,12 @@ options). What is followed:
|
|
|
4479
4549
|
computed one, `NOTES[verdict]`, every value the object holds; also of a
|
|
4480
4550
|
COPY of one (since `7.26.32`): `{...BASE, title: "t"}`,
|
|
4481
4551
|
`Object.assign({}, BASE)`;
|
|
4552
|
+
- an element of a const array literal read by an index the source writes
|
|
4553
|
+
(`LABELS[1]`, `LABELS["1"]`): that element, nothing past the end or in a
|
|
4554
|
+
hole (since `7.26.47`; up to `7.26.46` every element of the array). An
|
|
4555
|
+
index past a spread, a computed one, and an array its scope writes into
|
|
4556
|
+
(`LABELS[0] = k`, `.push()`, `.reverse()`, `.sort()`, `delete`, ...: an
|
|
4557
|
+
element may be another one by then) read every element written out;
|
|
4482
4558
|
- the element of a const array literal that a `for...of` walks, or that the
|
|
4483
4559
|
first parameter of a callback of one of the methods above receives (in the
|
|
4484
4560
|
same forms, and since `7.26.42` also the callback of `Array.from(ROWS, cb)`,
|
|
@@ -4654,7 +4730,9 @@ a const alias (`const show = yui_shell_show_info`), a map in a const
|
|
|
4654
4730
|
...)`, and with a spread or an `.apply()` of an array the source writes out,
|
|
4655
4731
|
`f(shell, ...["k"])`, `f.apply(x, ARGS)` with `const ARGS = [shell, "k"]`,
|
|
4656
4732
|
since `7.26.46` -- up to `7.26.45` such a spread failed the rule per call, and
|
|
4657
|
-
`f[M](...)` was not read
|
|
4733
|
+
`f[M](...)` was not read; in `7.26.46` a const such as ARGS was read at every
|
|
4734
|
+
position as all of its elements, so this very example failed the rule per call
|
|
4735
|
+
with `shell`: each position is its own element since `7.26.47`); and a `.bind()` of it is read as the
|
|
4658
4736
|
call it prepares, at the positions it binds (since `7.26.43`):
|
|
4659
4737
|
`yui_shell_show_info.bind(null, shell, "k")` asks for "k", and a parameter
|
|
4660
4738
|
bound there fails the rule per call as it does when it is handed directly. Up
|
|
@@ -5132,8 +5210,9 @@ reading the page in another language:
|
|
|
5132
5210
|
`m` a parameter or a `let`, `t[c()? "call" : "apply"]`);
|
|
5133
5211
|
- a key handed to a translator in a spread of what is no array the source
|
|
5134
5212
|
writes out (`t(...args)`, `t.apply(x, args)` with `args` a parameter, a
|
|
5135
|
-
`let`, or a const whose array holds a spread or a hole
|
|
5136
|
-
|
|
5213
|
+
`let`, or a const whose array holds a spread or a hole; a const alias, an
|
|
5214
|
+
import or an `Object.freeze()` of an array written out is read, since
|
|
5215
|
+
`7.26.47`): from the spread on, no position is known;
|
|
5137
5216
|
- a translator handed to a FUNCTION (`{t: t}`, `yui_tabulator_lang(t)`,
|
|
5138
5217
|
`run(t)`) or to any method but those listed above (`keys.reduce(t)`,
|
|
5139
5218
|
`keys.sort(t)`, an alias of a method, `Reflect.apply()`): only those
|
|
@@ -5154,9 +5233,14 @@ reading the page in another language:
|
|
|
5154
5233
|
(`const ds = el.dataset; ds.i18nTitle = k`), by `Object.assign()` into it,
|
|
5155
5234
|
or named by a `let`;
|
|
5156
5235
|
- what is written INTO a `const` table after its declaration
|
|
5157
|
-
(`TABLE.k = "k"`): the reader follows a
|
|
5158
|
-
marked `let` is followed into what is
|
|
5159
|
-
that is written into fails: above)
|
|
5236
|
+
(`TABLE.k = "k"`, `LIST[0] = "k"`, `LIST.push("k")`): the reader follows a
|
|
5237
|
+
const to its value, and only a marked `let` is followed into what is
|
|
5238
|
+
written into it (a published list that is written into fails: above). An
|
|
5239
|
+
array written into in its own scope is read by every element at any index
|
|
5240
|
+
(above); written through an alias (`const B = LIST; B.reverse()`), from a
|
|
5241
|
+
module that imports it, or by a function it is handed to (`shuffle(LIST)`),
|
|
5242
|
+
it is not seen, and an element
|
|
5243
|
+
read by its index is the one the source writes there;
|
|
5160
5244
|
- what a module of a package exports (gobj-js, i18next), and an exported
|
|
5161
5245
|
`let`;
|
|
5162
5246
|
- in the library's forwarder search, a key stored in a heap object or a DOM
|