@yuneta/gobj-ui 7.10.3 → 7.10.4
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 +39 -0
- package/dist/gobj-ui.cjs.js +3 -5
- package/dist/gobj-ui.es.js +3 -5
- package/package.json +1 -1
- package/src/c_yui_map.js +17 -3
package/README.md
CHANGED
|
@@ -526,6 +526,45 @@ because the link can stay up and an answer still never land. A refresh
|
|
|
526
526
|
re-pulls the page the reader is on rather than throwing them back to the
|
|
527
527
|
first.
|
|
528
528
|
|
|
529
|
+
### What a delete takes with it
|
|
530
|
+
|
|
531
|
+
A treedb delete is not one thing, and these views delete with **`force`**.
|
|
532
|
+
`force` on a node does not only remove it: its children are **UNLINKED** —
|
|
533
|
+
they survive, loose — and it is cleaned off its parents. So "delete this row"
|
|
534
|
+
can mean "detach eleven records from their only parent", and the question that
|
|
535
|
+
used to be asked, `are you sure`, said none of it.
|
|
536
|
+
|
|
537
|
+
The confirmation names what is going (the record's key, or how many) and adds
|
|
538
|
+
a line per thing at stake, **each only when there is something at stake** — a
|
|
539
|
+
loose record must not be dressed up as a dangerous one:
|
|
540
|
+
|
|
541
|
+
- *N children will be UNLINKED, not deleted*
|
|
542
|
+
- *It will be detached from M parents*
|
|
543
|
+
|
|
544
|
+
Counted off the record the table already has (`list_dict` fills the hook and
|
|
545
|
+
fkey columns), so asking costs no round trip. The counting is
|
|
546
|
+
`delete_impact.js`, pure and tested, because the shapes are the fiddly part: a
|
|
547
|
+
hook or fkey value arrives as a list of refs, a dict keyed by id, or a single
|
|
548
|
+
ref string — and a column can be BOTH hook and fkey, which counts on both
|
|
549
|
+
sides, because the delete does both things.
|
|
550
|
+
|
|
551
|
+
In the graph the node-delete popover carries the same two lines, and the
|
|
552
|
+
**unlink** popover carries the reassurance that is its whole point: *neither
|
|
553
|
+
record is deleted*. Next to a delete button painted the same red, that is not
|
|
554
|
+
obvious.
|
|
555
|
+
|
|
556
|
+
Three things this cost, worth knowing before composing any message from keys:
|
|
557
|
+
|
|
558
|
+
- `yui_shell_confirm_*` renders its message **as an i18n key**, so a composed
|
|
559
|
+
sentence can never be one. Pass DOM instead — the helper takes it.
|
|
560
|
+
- `createElement2` **trims text nodes**, so a `["span", {}, " "]` separator
|
|
561
|
+
vanishes and the question reads "BorrarDeveloper". Space with CSS.
|
|
562
|
+
- a **counted** word carries no `i18n` attribute: `yui_shell_show_modal` calls
|
|
563
|
+
`refresh_language()` on the dialog's content, which re-translates from the
|
|
564
|
+
key alone — without the count — and puts the plural back over the singular.
|
|
565
|
+
Nothing is lost, because a dialog with a backdrop never sees a language
|
|
566
|
+
change.
|
|
567
|
+
|
|
529
568
|
### Editing a topic table in place
|
|
530
569
|
|
|
531
570
|
A writable scalar is editable in the table, in edition mode
|
package/dist/gobj-ui.cjs.js
CHANGED
|
@@ -8873,11 +8873,9 @@ function ac_map_on_load(gobj, event, kw, src) {
|
|
|
8873
8873
|
function ac_refresh$6(gobj, event, kw, src) {
|
|
8874
8874
|
let priv = gobj.priv;
|
|
8875
8875
|
let devices = (0, _yuneta_gobj_js.gobj_read_attr)(gobj, "devices");
|
|
8876
|
-
|
|
8877
|
-
if (
|
|
8878
|
-
|
|
8879
|
-
map.getSource("devices").setData(geojson_data);
|
|
8880
|
-
}
|
|
8876
|
+
const source = priv.xmap.getSource("devices");
|
|
8877
|
+
if (!source) return 0;
|
|
8878
|
+
source.setData(devices2geojson(gobj, devices));
|
|
8881
8879
|
return 0;
|
|
8882
8880
|
}
|
|
8883
8881
|
/************************************************************
|
package/dist/gobj-ui.es.js
CHANGED
|
@@ -8868,11 +8868,9 @@ function ac_map_on_load(gobj, event, kw, src) {
|
|
|
8868
8868
|
function ac_refresh$6(gobj, event, kw, src) {
|
|
8869
8869
|
let priv = gobj.priv;
|
|
8870
8870
|
let devices = gobj_read_attr(gobj, "devices");
|
|
8871
|
-
|
|
8872
|
-
if (
|
|
8873
|
-
|
|
8874
|
-
map.getSource("devices").setData(geojson_data);
|
|
8875
|
-
}
|
|
8871
|
+
const source = priv.xmap.getSource("devices");
|
|
8872
|
+
if (!source) return 0;
|
|
8873
|
+
source.setData(devices2geojson(gobj, devices));
|
|
8876
8874
|
return 0;
|
|
8877
8875
|
}
|
|
8878
8876
|
/************************************************************
|
package/package.json
CHANGED
package/src/c_yui_map.js
CHANGED
|
@@ -782,10 +782,24 @@ function ac_refresh(gobj, event, kw, src)
|
|
|
782
782
|
let devices = gobj_read_attr(gobj, "devices");
|
|
783
783
|
|
|
784
784
|
let map = priv.xmap;
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
785
|
+
|
|
786
|
+
/*
|
|
787
|
+
* Ask for the source, do not infer it from the style. 'devices' is added
|
|
788
|
+
* by load_devices() on the map 'load' event, which is a LATER milestone:
|
|
789
|
+
* isStyleLoaded() is already true one render frame before 'load' fires,
|
|
790
|
+
* and getSource() is undefined in that frame. Nothing is lost by
|
|
791
|
+
* skipping, load_devices() reads the same attr.
|
|
792
|
+
*
|
|
793
|
+
* Testing the style was also wrong the other way: it goes back to false
|
|
794
|
+
* while new tiles load, so every refresh during a pan or a zoom was
|
|
795
|
+
* silently dropped and the devices stopped moving.
|
|
796
|
+
*/
|
|
797
|
+
const source = map.getSource('devices');
|
|
798
|
+
if(!source) {
|
|
799
|
+
return 0;
|
|
788
800
|
}
|
|
801
|
+
|
|
802
|
+
source.setData(devices2geojson(gobj, devices));
|
|
789
803
|
return 0;
|
|
790
804
|
}
|
|
791
805
|
|