@yuneta/gobj-ui 7.26.45 → 7.26.47
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 +168 -17
- package/dist/gobj-ui.cjs.js +437 -43
- package/dist/gobj-ui.es.js +438 -44
- package/package.json +1 -1
- package/scripts/validate-locales.mjs +388 -56
- package/src/c_yui_form.css +9 -0
- package/src/c_yui_form.js +225 -36
- package/src/c_yui_shell.js +82 -12
- package/src/c_yui_treedb_topic_with_form.js +8 -2
- package/src/c_yui_window.js +29 -1
- package/src/form_table_rows.wiring.test.js +330 -1
- package/src/form_time_cell_editor.js +160 -0
- package/src/form_time_cell_editor.test.js +154 -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/i18n_key_functions.test.js +8 -4
- package/src/shell_focus_trap.js +29 -3
- package/src/shell_focus_trap.test.js +139 -0
- package/src/shell_modals.js +2 -2
- package/src/shell_stop_overlays.wiring.test.js +175 -0
- package/src/tabulator_edit_internals.test.js +50 -0
- package/src/treedb_time_cell.wiring.test.js +103 -0
- package/src/window_rect_rounding.wiring.test.js +52 -1
- package/src/yui_tabulator_i18n.js +18 -7
- package/src/yui_tabulator_i18n.test.js +36 -0
package/README.md
CHANGED
|
@@ -214,6 +214,38 @@ Published as `@yuneta/gobj-ui`. Built on top of [`@yuneta/gobj-js`](https://gith
|
|
|
214
214
|
> the dialog), and every Tab after that "wrapped" to it, did nothing and was
|
|
215
215
|
> prevented -- the keyboard never got into a dialog. It now skips a control
|
|
216
216
|
> that is not drawn.
|
|
217
|
+
>
|
|
218
|
+
> **A shell that stops closes what it has open (7.26.46).** A logout, or a
|
|
219
|
+
> session cut, with the drawer, a modal or a question up: the shell closes
|
|
220
|
+
> each one, the top first, as if it had been dismissed -- a modal's `on_close`
|
|
221
|
+
> runs (its `before_close` is not asked: that guard is for the reader), a
|
|
222
|
+
> question answers what Escape answers. Up to 7.26.45 only the toolbar
|
|
223
|
+
> dropdown was closed; the others kept their focus trap, and every window
|
|
224
|
+
> opened afterwards believed itself under an overlay and took no focus. An
|
|
225
|
+
> overlay of the app that uses the shell's Escape chain passes its
|
|
226
|
+
> unconditional close as the fourth argument, or it is left to its owner:
|
|
227
|
+
>
|
|
228
|
+
> ```js
|
|
229
|
+
> yui_shell_push_escape(shell, "modal", ask_then_close, close_now);
|
|
230
|
+
> ```
|
|
231
|
+
>
|
|
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. A
|
|
238
|
+
> question open at the stop answers what Escape answers -- `false` for a yes/no
|
|
239
|
+
> or a danger question, `"cancel"` for yes/no/cancel --; a
|
|
240
|
+
> `yui_shell_confirm_ok()` resolves as on every close, so code awaiting it runs
|
|
241
|
+
> after the stop and must not take the shell for alive.
|
|
242
|
+
>
|
|
243
|
+
> A trap whose panel is out of the document is not the top: the top is the
|
|
244
|
+
> highest trap whose panel is in it, so a trap left behind by an owner torn
|
|
245
|
+
> down with it no longer stands for an overlay that is gone. It is skipped, not
|
|
246
|
+
> dropped: it leaves the stack only by its `release()`, and a panel that only
|
|
247
|
+
> moves (taken out and put back) has its trap again (7.26.47; 7.26.46 dropped
|
|
248
|
+
> it for good).
|
|
217
249
|
|
|
218
250
|
## Two maintained lines
|
|
219
251
|
|
|
@@ -3630,6 +3662,49 @@ opened changed did not hear its tables at all, so closing it lost a table edit
|
|
|
3630
3662
|
without a question. And the titles of those tables change language with the
|
|
3631
3663
|
shell's `EV_LANGUAGE_CHANGED` (7.26.41+), like the rest of the form.
|
|
3632
3664
|
|
|
3665
|
+
What the reader TYPES in a cell editor is `edited` at once (7.26.46+), as in a
|
|
3666
|
+
field of the form: Tabulator says `dataChanged` only when the editor commits,
|
|
3667
|
+
so up to 7.26.45 a half-typed cell was not edited, and a host that asks
|
|
3668
|
+
`edited` before it reloads or closes the form by code dropped it without a
|
|
3669
|
+
question. A reload or a close by code still discards the open editor (it is
|
|
3670
|
+
cancelled before the rows go): asking is the host's part, and `edited` is
|
|
3671
|
+
what tells it to.
|
|
3672
|
+
|
|
3673
|
+
An edit the reader CANCELS -- Escape, or a box left as it was -- gives back the
|
|
3674
|
+
`edited` and `changes` the form had when that editor opened (7.26.47+): what was
|
|
3675
|
+
typed is gone, and up to 7.26.46 it still counted, so closing asked about a
|
|
3676
|
+
change that no longer existed. Nothing is given back when anything else changed
|
|
3677
|
+
the form while the editor was open (another cell committed, a paste): that
|
|
3678
|
+
change is real.
|
|
3679
|
+
|
|
3680
|
+
Enter in a box of the form never submits it (7.26.47+). The table's "add"
|
|
3681
|
+
button was the form's first submit button, so Enter in any field -- or in a cell
|
|
3682
|
+
editor that stays open -- added an empty row; and a form of a single text box
|
|
3683
|
+
reloaded the page.
|
|
3684
|
+
|
|
3685
|
+
A `time` / `now` column of a table is edited in a `datetime-local` box, to the
|
|
3686
|
+
second, read and written as the form's own time field is (`form_time_value.js`:
|
|
3687
|
+
an epoch in seconds, or an ISO text for a string column). Up to 7.26.45 it was
|
|
3688
|
+
Tabulator's `datetime` editor with a luxon `format`, and nothing gives gobj-ui
|
|
3689
|
+
luxon: it opened empty and threw when committed. Luxon is not taken in for one
|
|
3690
|
+
editor. The cell shows the same local clock, `2026-03-14 09:26:53` (7.26.47+; it
|
|
3691
|
+
showed the raw epoch).
|
|
3692
|
+
|
|
3693
|
+
A date with a part cleared is not a value. The box answers `""` for it, as for an
|
|
3694
|
+
empty box, and only `validity.badInput` tells them apart: Enter leaves the editor
|
|
3695
|
+
open, outlined and with `aria-invalid`, until the date is whole again or Escape;
|
|
3696
|
+
leaving the cell cancels, and the cell keeps its time (7.26.47+; up to 7.26.46
|
|
3697
|
+
one Backspace and Enter erased the stored time). **To clear a time on purpose,
|
|
3698
|
+
clear every part of the box**: an empty box writes `null`. Inside the box Tab
|
|
3699
|
+
moves between its parts, as the browser does.
|
|
3700
|
+
|
|
3701
|
+
The form's own time field and the cell editor read and write a column the same
|
|
3702
|
+
way (7.26.47+): an epoch in seconds, an ISO text for a `string` column, and an
|
|
3703
|
+
empty box for a column that holds no time. Up to 7.26.46 the field read every
|
|
3704
|
+
column with `parseInt` -- an ISO text as 2026 seconds, in January 1970 --, wrote
|
|
3705
|
+
the epoch into a `string` column, and showed no time as January 1970, which a
|
|
3706
|
+
save wrote back as `0`.
|
|
3707
|
+
|
|
3633
3708
|
A table hears the reader through Tabulator's `dataChanged`, which Tabulator
|
|
3634
3709
|
does not say for `setData()` / `replaceData()`, nor when its `history` module
|
|
3635
3710
|
undoes or redoes a cell edit or a row move (`Ctrl+Z`; a row added or deleted
|
|
@@ -3706,6 +3781,16 @@ so it governs the row's own click, which toggles the row (a row drawn while it
|
|
|
3706
3781
|
was `false` stays unselectable until it is drawn again). With the defaults
|
|
3707
3782
|
nothing is selected.
|
|
3708
3783
|
|
|
3784
|
+
The checkbox column (`with_checkbox`) asks `selectable` too, and is hidden while
|
|
3785
|
+
the form is not selectable (7.26.46): Tabulator's row box ticks before its
|
|
3786
|
+
toggle is refused, and its header box selects every row without asking. It
|
|
3787
|
+
follows `selectable` written at any time, in every table (7.26.47+; in 7.26.46
|
|
3788
|
+
it was read when the table was built, and a `false` written later left boxes
|
|
3789
|
+
that ticked without selecting). Its header box is named *select all rows*, a
|
|
3790
|
+
row's *select row*, and both change language with the form (consumer key
|
|
3791
|
+
`select all rows`, 7.26.47). A click in a NESTED table selects in that table
|
|
3792
|
+
only; it bubbled up to the row holding the table, which toggled too.
|
|
3793
|
+
|
|
3709
3794
|
```js
|
|
3710
3795
|
gobj_create("form", "C_YUI_FORM", {
|
|
3711
3796
|
template: template,
|
|
@@ -4001,14 +4086,36 @@ range raised by hand), and leaves it when it did (the round run twice, a
|
|
|
4001
4086
|
package.json two apps share): the package.json's git history says which, and
|
|
4002
4087
|
one whose history cannot be read is refused (since `7.26.43`; up to `7.26.42`
|
|
4003
4088
|
a refused app kept the files raised before the refusal, `--no-wait` could
|
|
4004
|
-
lower a range, and "already" deployed a new bundle under the old number).
|
|
4005
|
-
commit that brought the range is the newest one whose parent has ANOTHER
|
|
4006
|
-
range, and a shallow clone is refused, since it may not hold that parent; its
|
|
4089
|
+
lower a range, and "already" deployed a new bundle under the old number). Its
|
|
4007
4090
|
log line says `range already ^x.y.z, version raised` (since `7.26.45`; up to
|
|
4008
|
-
`7.26.44` a commit that only reformatted the line
|
|
4009
|
-
round run again
|
|
4010
|
-
the range by hand
|
|
4011
|
-
|
|
4091
|
+
`7.26.44` it said `range raised`, a commit that only reformatted the line made
|
|
4092
|
+
a round run again raise the version twice, and a shallow clone whose HEAD
|
|
4093
|
+
raised the range by hand deployed under the old number).
|
|
4094
|
+
|
|
4095
|
+
The history is read by its VALUES (since `7.26.46`): the version is raised when
|
|
4096
|
+
ANY state the package.json had -- every branch merged in, a merge that combines
|
|
4097
|
+
two sides, a rename followed to the old name -- carries it with another range,
|
|
4098
|
+
since a number that stood beside another range may have gone out with it. A
|
|
4099
|
+
shallow clone is read as far as it goes when the oldest state it holds does not
|
|
4100
|
+
carry the range yet (a clone of depth 2 holding the commit before the raise);
|
|
4101
|
+
one cut where the range was already raised is refused, and the message says
|
|
4102
|
+
`git fetch --unshallow`. Up to `7.26.45` the round read ONE commit, the one
|
|
4103
|
+
that brought the range, so a merge of a branch that raised the range by hand,
|
|
4104
|
+
next to a version raised on main with the old range, deployed under that
|
|
4105
|
+
version, and a package.json MOVED after a hand raise was taken for one born
|
|
4106
|
+
with the range; and `7.26.45` refused every shallow clone.
|
|
4107
|
+
|
|
4108
|
+
Since `7.26.47` a move git does not see as a rename is followed too -- a `git
|
|
4109
|
+
mv` with many changes (below `-M`'s 50%), a removal and an addition in two
|
|
4110
|
+
commits, a copy: where the package.json is BORN with the range and the version
|
|
4111
|
+
of the working tree, every package.json the repository had before it is read,
|
|
4112
|
+
by version. In a repository of two apps, a new one born with the range beside
|
|
4113
|
+
one that once had its number with another range has its version raised once
|
|
4114
|
+
more than needed -- a number spent, never a bundle under an old one. A state
|
|
4115
|
+
that is not json (a stray comma, conflict markers) is read by its lines, every
|
|
4116
|
+
`"version"` it holds: up to `7.26.46` one such commit anywhere in the history
|
|
4117
|
+
refused the app on every round, without naming the commit. A package.json of
|
|
4118
|
+
the working tree that is not json is refused naming the file.
|
|
4012
4119
|
|
|
4013
4120
|
### Colour: a brand token as INK takes `-on-scheme`, as a FILL it does not
|
|
4014
4121
|
|
|
@@ -4372,6 +4479,18 @@ reader reads --, called as `t(k)`, `t?.(k)`, `t.call(x, k)` or
|
|
|
4372
4479
|
`t.apply(x, [k])`, and `.call`, `.apply` and `.bind` written as computed
|
|
4373
4480
|
members too (`t["call"](x, k)`, `t["bind"](null, k)`, since `7.26.45`; up to
|
|
4374
4481
|
`7.26.44` those forms were not read, and a key handed that way went unasked).
|
|
4482
|
+
Since `7.26.46` a computed member is read by a const name and by a template as
|
|
4483
|
+
well (``t[`call`](x, k)``, `t[M](x, k)` with `const M = "call"`, `i18next[T](k)`
|
|
4484
|
+
with `const T = "t"`), and so is a SPREAD of an array the source writes out:
|
|
4485
|
+
`t(...["k"])`, `t.call(x, ...["k"])`, `t(...KEYS)` and `t.apply(x, KEYS)` with
|
|
4486
|
+
`const KEYS = ["k"]` -- each element of the const read as `KEYS[0]`,
|
|
4487
|
+
`KEYS[1]`... (up to `7.26.45` none of them was read, and nothing failed). Since
|
|
4488
|
+
`7.26.47` each of those is THAT element, so `t.apply(null, ["save", "Save it"])`
|
|
4489
|
+
asks for "save" and not for its default value (`7.26.46` read every element of
|
|
4490
|
+
the array at every position, and asked for both), and a const ALIAS of such an
|
|
4491
|
+
array (`const B = KEYS; t(...B)`), an import of one, and an
|
|
4492
|
+
`Object.freeze([...])` are read as it is (up to `7.26.46` they were spreads of
|
|
4493
|
+
what the source does not write).
|
|
4375
4494
|
An ARRAY given to it is i18next's list of fallback keys, and
|
|
4376
4495
|
each one is a key: `t([specific, "generic"])` asks for "generic". A `.bind()`
|
|
4377
4496
|
that binds a KEY makes a translator whose calls hand i18next its options or its
|
|
@@ -4424,6 +4543,12 @@ options). What is followed:
|
|
|
4424
4543
|
computed one, `NOTES[verdict]`, every value the object holds; also of a
|
|
4425
4544
|
COPY of one (since `7.26.32`): `{...BASE, title: "t"}`,
|
|
4426
4545
|
`Object.assign({}, BASE)`;
|
|
4546
|
+
- an element of a const array literal read by an index the source writes
|
|
4547
|
+
(`LABELS[1]`, `LABELS["1"]`): that element, nothing past the end or in a
|
|
4548
|
+
hole (since `7.26.47`; up to `7.26.46` every element of the array). An
|
|
4549
|
+
index past a spread, a computed one, and an array its scope writes into
|
|
4550
|
+
(`LABELS[0] = k`, `.push()`, `.reverse()`, `.sort()`, `delete`, ...: an
|
|
4551
|
+
element may be another one by then) read every element written out;
|
|
4427
4552
|
- the element of a const array literal that a `for...of` walks, or that the
|
|
4428
4553
|
first parameter of a callback of one of the methods above receives (in the
|
|
4429
4554
|
same forms, and since `7.26.42` also the callback of `Array.from(ROWS, cb)`,
|
|
@@ -4595,7 +4720,13 @@ member): an import under any name, a re-export from a file of the app
|
|
|
4595
4720
|
a const alias (`const show = yui_shell_show_info`), a map in a const
|
|
4596
4721
|
(`const API = {info: yui_shell_show_info}; API.info(...)`, imported too),
|
|
4597
4722
|
`.call(x, ...)` and `.apply(x, [...])` (also as computed members,
|
|
4598
|
-
`f["call"](x, ...)`, since `7.26.45
|
|
4723
|
+
`f["call"](x, ...)`, since `7.26.45`; by a const name or a template, `f[M](x,
|
|
4724
|
+
...)`, and with a spread or an `.apply()` of an array the source writes out,
|
|
4725
|
+
`f(shell, ...["k"])`, `f.apply(x, ARGS)` with `const ARGS = [shell, "k"]`,
|
|
4726
|
+
since `7.26.46` -- up to `7.26.45` such a spread failed the rule per call, and
|
|
4727
|
+
`f[M](...)` was not read; in `7.26.46` a const such as ARGS was read at every
|
|
4728
|
+
position as all of its elements, so this very example failed the rule per call
|
|
4729
|
+
with `shell`: each position is its own element since `7.26.47`); and a `.bind()` of it is read as the
|
|
4599
4730
|
call it prepares, at the positions it binds (since `7.26.43`):
|
|
4600
4731
|
`yui_shell_show_info.bind(null, shell, "k")` asks for "k", and a parameter
|
|
4601
4732
|
bound there fails the rule per call as it does when it is handed directly. Up
|
|
@@ -5068,7 +5199,14 @@ reading the page in another language:
|
|
|
5068
5199
|
that no const or import makes an alias of -- a parameter `translate`, a
|
|
5069
5200
|
`let` alias, `opts.translate(k)`, `i18next.getFixedT()` --, or one called
|
|
5070
5201
|
through what is no name of it: `(0, t)(k)`, `[t][0](k)`,
|
|
5071
|
-
`Reflect.apply(t, x, [k])`, `Function.prototype.call.call(t, x, k)
|
|
5202
|
+
`Reflect.apply(t, x, [k])`, `Function.prototype.call.call(t, x, k)`, or by
|
|
5203
|
+
a computed name the reader does not follow to ONE string (`t[m](x, k)` with
|
|
5204
|
+
`m` a parameter or a `let`, `t[c()? "call" : "apply"]`);
|
|
5205
|
+
- a key handed to a translator in a spread of what is no array the source
|
|
5206
|
+
writes out (`t(...args)`, `t.apply(x, args)` with `args` a parameter, a
|
|
5207
|
+
`let`, or a const whose array holds a spread or a hole; a const alias, an
|
|
5208
|
+
import or an `Object.freeze()` of an array written out is read, since
|
|
5209
|
+
`7.26.47`): from the spread on, no position is known;
|
|
5072
5210
|
- a translator handed to a FUNCTION (`{t: t}`, `yui_tabulator_lang(t)`,
|
|
5073
5211
|
`run(t)`) or to any method but those listed above (`keys.reduce(t)`,
|
|
5074
5212
|
`keys.sort(t)`, an alias of a method, `Reflect.apply()`): only those
|
|
@@ -5081,15 +5219,22 @@ reading the page in another language:
|
|
|
5081
5219
|
not, and so does one a `const` holds (below);
|
|
5082
5220
|
- a key function reached through a parameter (`apply(fn)` calling
|
|
5083
5221
|
`fn(shell, "k")`), a `let` given more than one function, a map in a `let`,
|
|
5084
|
-
a computed member
|
|
5085
|
-
|
|
5222
|
+
or a computed member whose name the reader does not follow to one string
|
|
5223
|
+
(`API[name](...)` with `name` a parameter or a `let`). An `.apply()` of an
|
|
5224
|
+
array the source does not write out, or a spread of one, is not invisible:
|
|
5225
|
+
it FAILS the rule per call, since no position from it on is known;
|
|
5086
5226
|
- a `data-i18n*` attribute written through an alias of `dataset`
|
|
5087
5227
|
(`const ds = el.dataset; ds.i18nTitle = k`), by `Object.assign()` into it,
|
|
5088
5228
|
or named by a `let`;
|
|
5089
5229
|
- what is written INTO a `const` table after its declaration
|
|
5090
|
-
(`TABLE.k = "k"`): the reader follows a
|
|
5091
|
-
marked `let` is followed into what is
|
|
5092
|
-
that is written into fails: above)
|
|
5230
|
+
(`TABLE.k = "k"`, `LIST[0] = "k"`, `LIST.push("k")`): the reader follows a
|
|
5231
|
+
const to its value, and only a marked `let` is followed into what is
|
|
5232
|
+
written into it (a published list that is written into fails: above). An
|
|
5233
|
+
array written into in its own scope is read by every element at any index
|
|
5234
|
+
(above); written through an alias (`const B = LIST; B.reverse()`), from a
|
|
5235
|
+
module that imports it, or by a function it is handed to (`shuffle(LIST)`),
|
|
5236
|
+
it is not seen, and an element
|
|
5237
|
+
read by its index is the one the source writes there;
|
|
5093
5238
|
- what a module of a package exports (gobj-js, i18next), and an exported
|
|
5094
5239
|
`let`;
|
|
5095
5240
|
- in the library's forwarder search, a key stored in a heap object or a DOM
|
|
@@ -5148,8 +5293,11 @@ reading the page in another language:
|
|
|
5148
5293
|
|
|
5149
5294
|
Since `7.26.45` the line said is the one of the READ, with the place the
|
|
5150
5295
|
count went past 24 (`src/main.js:30: the reader gave up on \`J16\` (past
|
|
5151
|
-
\`
|
|
5152
|
-
|
|
5296
|
+
\`K2\`, src/main.js:4), ...`): the first node the read reaches at step 25,
|
|
5297
|
+
the same whatever was read before (since `7.26.46`; in `7.26.45` it was the
|
|
5298
|
+
const read before, kept, when the count went past inside it -- `K10` with
|
|
5299
|
+
`t(K10)` above the read, `K2` without). The verdict does not depend on the
|
|
5300
|
+
order of the code either: a const, a property, an element and the returns of a
|
|
5153
5301
|
function are read once and keep the steps they took, so a later read of them
|
|
5154
5302
|
counts those steps too. Up to `7.26.44` a const kept what its FIRST read had
|
|
5155
5303
|
reached -- with `J0 = K10` and `J16` 28 consts away from the key, `t(J16);
|
|
@@ -5166,7 +5314,10 @@ validated, and nobody told. A file of the locales directory with a locale's
|
|
|
5166
5314
|
name that does not look like one (`app.js`, a helper that needs a browser to
|
|
5167
5315
|
load) is said and skipped, as before. The script runs the same when it is
|
|
5168
5316
|
reached through a symlinked package with `--preserve-symlinks-main` (also from
|
|
5169
|
-
`NODE_OPTIONS`): both sides of its "am I the script?" test are resolved.
|
|
5317
|
+
`NODE_OPTIONS`): both sides of its "am I the script?" test are resolved. A
|
|
5318
|
+
locale is IMPORTED, so its code runs: the script ends itself once what it wrote
|
|
5319
|
+
has left, and a timer a locale leaves running does not hold the build (since
|
|
5320
|
+
`7.26.46`; up to `7.26.45` it held it for ever, a failing run included).
|
|
5170
5321
|
|
|
5171
5322
|
Up to `7.26.24` each app carried its own copy, and the copies had drifted into
|
|
5172
5323
|
three families: only one read the codes of the schema editor, only the other
|