@yuneta/gobj-ui 7.27.32 → 7.27.34
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 +43 -5
- package/dist/gobj-ui.cjs.js +140 -37
- package/dist/gobj-ui.es.js +140 -37
- package/package.json +2 -1
- package/src/c_yui_form.js +3 -2
- package/src/c_yui_fsm_graph.js +2 -1
- package/src/c_yui_gobj_tree_js.js +65 -15
- package/src/c_yui_json_graph.js +5 -4
- package/src/c_yui_nav.js +5 -11
- package/src/c_yui_schema_editor.js +2 -1
- package/src/c_yui_shell.js +3 -2
- package/src/c_yui_treedb_graph.js +2 -1
- package/src/c_yui_treedb_schema.js +5 -1
- package/src/c_yui_treedb_topic_with_form.js +5 -4
- package/src/c_yui_treedb_topics.js +4 -3
- package/src/g6_patches_first_graph.wiring.test.js +179 -0
- package/src/gobj_tree_remote.wiring.test.js +157 -3
- package/src/selector_from_data.wiring.test.js +296 -0
- package/src/yui_selector.js +79 -0
package/dist/gobj-ui.es.js
CHANGED
|
@@ -1097,6 +1097,72 @@ function build_nav_map(input) {
|
|
|
1097
1097
|
};
|
|
1098
1098
|
}
|
|
1099
1099
|
//#endregion
|
|
1100
|
+
//#region src/yui_selector.js
|
|
1101
|
+
/***********************************************************************
|
|
1102
|
+
* yui_selector.js
|
|
1103
|
+
*
|
|
1104
|
+
* A NAME IS DATA, NOT A SELECTOR.
|
|
1105
|
+
*
|
|
1106
|
+
* A gobj name, a topic, a route, a key: any of them may hold a
|
|
1107
|
+
* character that means something to CSS. Pasted into a selector,
|
|
1108
|
+
* it changes what the selector says or breaks it:
|
|
1109
|
+
*
|
|
1110
|
+
* - `~ + > space` are combinators: `#a~b` is "a b after an #a",
|
|
1111
|
+
* and the lookup answers null;
|
|
1112
|
+
* - `.` `#` `:` `[` start another simple selector: `#a.b` is the
|
|
1113
|
+
* element #a with the class b;
|
|
1114
|
+
* - `%` `^` `"` `\` and the rest make it INVALID: querySelector
|
|
1115
|
+
* THROWS a SyntaxError, out of whatever action was running.
|
|
1116
|
+
*
|
|
1117
|
+
* REV-CLOUD V40.3.1: the gobj tree found its canvas with
|
|
1118
|
+
* `querySelector("#" + id)`, and gui_agent named the window
|
|
1119
|
+
* `node~key` -- every open logged "no canvas mount" and the
|
|
1120
|
+
* canvas never resized; a `^` in the key (`%5E`) threw out of
|
|
1121
|
+
* mt_start and left an orphan window behind it.
|
|
1122
|
+
*
|
|
1123
|
+
* So data reaches a selector in one of two ways only:
|
|
1124
|
+
*
|
|
1125
|
+
* find_by_id($root, id) the element below $root whose id is
|
|
1126
|
+
* `id` -- no selector is built at all.
|
|
1127
|
+
* It works in a tree that is not in the
|
|
1128
|
+
* document yet, where getElementById()
|
|
1129
|
+
* answers null.
|
|
1130
|
+
*
|
|
1131
|
+
* css_string(value) the value written inside a DOUBLE
|
|
1132
|
+
* quoted CSS string, for an attribute
|
|
1133
|
+
* selector:
|
|
1134
|
+
* '[data-x="' + css_string(v) + '"]'
|
|
1135
|
+
*
|
|
1136
|
+
* `CSS.escape()` is not used: it does not exist in node, where the
|
|
1137
|
+
* wiring tests run, and inside a quoted string only the quote, the
|
|
1138
|
+
* backslash and the control characters have to be escaped.
|
|
1139
|
+
*
|
|
1140
|
+
* Copyright (c) 2026, ArtGins.
|
|
1141
|
+
* All Rights Reserved.
|
|
1142
|
+
***********************************************************************/
|
|
1143
|
+
/************************************************************
|
|
1144
|
+
* The element below `$root` (not `$root` itself, as with
|
|
1145
|
+
* querySelector) whose id is exactly `id`, or null.
|
|
1146
|
+
************************************************************/
|
|
1147
|
+
function find_by_id($root, id) {
|
|
1148
|
+
if (!$root || typeof $root.querySelectorAll !== "function") return null;
|
|
1149
|
+
if (id === null || id === void 0 || id === "") return null;
|
|
1150
|
+
let wanted = String(id);
|
|
1151
|
+
for (let $el of $root.querySelectorAll("[id]")) if ($el.id === wanted) return $el;
|
|
1152
|
+
return null;
|
|
1153
|
+
}
|
|
1154
|
+
/************************************************************
|
|
1155
|
+
* `value` as the body of a double-quoted CSS string.
|
|
1156
|
+
*
|
|
1157
|
+
* The quote and the backslash take a backslash; a control
|
|
1158
|
+
* character (a newline ends a CSS string, it is a parse
|
|
1159
|
+
* error inside one) is written as its hex escape, which a
|
|
1160
|
+
* space ends so the next character is never read as hex.
|
|
1161
|
+
************************************************************/
|
|
1162
|
+
function css_string(value) {
|
|
1163
|
+
return String(value).replace(/[\\"]/g, "\\$&").replace(/[\u0000-\u001f\u007f]/g, (c) => "\\" + c.charCodeAt(0).toString(16) + " ");
|
|
1164
|
+
}
|
|
1165
|
+
//#endregion
|
|
1100
1166
|
//#region src/shell_section_index.js
|
|
1101
1167
|
/***********************************************************************
|
|
1102
1168
|
* shell_section_index.js
|
|
@@ -4179,7 +4245,7 @@ function yui_shell_set_connection_state(shell_gobj, connected) {
|
|
|
4179
4245
|
function yui_shell_set_toolbar_item_icon(shell_gobj, item_id, icon_class) {
|
|
4180
4246
|
let $container = gobj_read_attr(shell_gobj, "$container");
|
|
4181
4247
|
if (!$container || empty_string(item_id) || empty_string(icon_class)) return;
|
|
4182
|
-
let $i = $container.querySelector(`[data-toolbar-item-id="${item_id}"] .icon i`);
|
|
4248
|
+
let $i = $container.querySelector(`[data-toolbar-item-id="${css_string(item_id)}"] .icon i`);
|
|
4183
4249
|
if ($i) $i.className = icon_class;
|
|
4184
4250
|
}
|
|
4185
4251
|
/************************************************************
|
|
@@ -4213,7 +4279,7 @@ function yui_shell_set_toolbar_item_badge(shell_gobj, item_id, value, tone) {
|
|
|
4213
4279
|
if (!shell_gobj || !is_gobj(shell_gobj) || empty_string(item_id)) return;
|
|
4214
4280
|
let $container = gobj_read_attr(shell_gobj, "$container");
|
|
4215
4281
|
if (!$container) return;
|
|
4216
|
-
let $badge = $container.querySelector(`[data-toolbar-item-id="${item_id}"] .yui-toolbar-badge`);
|
|
4282
|
+
let $badge = $container.querySelector(`[data-toolbar-item-id="${css_string(item_id)}"] .yui-toolbar-badge`);
|
|
4217
4283
|
if (!$badge) return;
|
|
4218
4284
|
let before = $badge.hasAttribute("hidden") ? "" : $badge.textContent;
|
|
4219
4285
|
paint_badge($badge, value, tone);
|
|
@@ -12578,7 +12644,7 @@ function apply_form_mode(gobj, $form) {
|
|
|
12578
12644
|
let mode = gobj_read_str_attr(gobj, "form_mode");
|
|
12579
12645
|
if (empty_string(mode)) return;
|
|
12580
12646
|
let pkey = gobj_read_str_attr(gobj, "pkey");
|
|
12581
|
-
let $input = $form.querySelector(`[name="${pkey}"]`);
|
|
12647
|
+
let $input = $form.querySelector(`[name="${css_string(pkey)}"]`);
|
|
12582
12648
|
if (!$input) {
|
|
12583
12649
|
log_error(sprintf("%s: form_mode '%s' but form has no pkey field '%s'", gobj_short_name(gobj), mode, pkey));
|
|
12584
12650
|
return;
|
|
@@ -13646,7 +13712,7 @@ function template2columns(gobj, columns, template, sub_elements) {
|
|
|
13646
13712
|
hozAlign: "center",
|
|
13647
13713
|
cellClick: function(evt, cell) {
|
|
13648
13714
|
evt.stopPropagation();
|
|
13649
|
-
let $extend = cell.getRow().getElement().querySelector(`[name="${field_desc.name}"]`);
|
|
13715
|
+
let $extend = cell.getRow().getElement().querySelector(`[name="${css_string(field_desc.name)}"]`);
|
|
13650
13716
|
if (!$extend) {
|
|
13651
13717
|
log_error(`${gobj_short_name(gobj)}: nested table '${field_desc.name}' not found in its row`);
|
|
13652
13718
|
return;
|
|
@@ -18104,7 +18170,7 @@ function build_ui$13(gobj) {
|
|
|
18104
18170
|
]]
|
|
18105
18171
|
]);
|
|
18106
18172
|
gobj_write_attr(gobj, "$container", $container);
|
|
18107
|
-
let $mount = $container
|
|
18173
|
+
let $mount = find_by_id($container, priv.canvas_id);
|
|
18108
18174
|
if ($mount) {
|
|
18109
18175
|
priv.fold_listener = function(evt) {
|
|
18110
18176
|
let $handle = evt.target && evt.target.closest ? evt.target.closest("[data-fold-path]") : null;
|
|
@@ -18133,7 +18199,7 @@ function destroy_ui$8(gobj) {
|
|
|
18133
18199
|
let priv = gobj.priv;
|
|
18134
18200
|
let $container = gobj_read_attr(gobj, "$container");
|
|
18135
18201
|
if (priv.fold_listener) {
|
|
18136
|
-
let $mount = $container
|
|
18202
|
+
let $mount = find_by_id($container, priv.canvas_id);
|
|
18137
18203
|
if ($mount) for (let type of FOLD_SWALLOWED_EVENTS$1) $mount.removeEventListener(type, priv.fold_listener, true);
|
|
18138
18204
|
priv.fold_listener = null;
|
|
18139
18205
|
}
|
|
@@ -18274,7 +18340,7 @@ function make_toolbar$5(gobj) {
|
|
|
18274
18340
|
function canvas_mount$2(gobj) {
|
|
18275
18341
|
let $container = gobj_read_attr(gobj, "$container");
|
|
18276
18342
|
if (!$container) return null;
|
|
18277
|
-
return $container
|
|
18343
|
+
return find_by_id($container, gobj.priv.canvas_id);
|
|
18278
18344
|
}
|
|
18279
18345
|
/************************************************************
|
|
18280
18346
|
* Build a G6 graph instance
|
|
@@ -19145,7 +19211,7 @@ function paint_anchor_mark$1(gobj) {
|
|
|
19145
19211
|
if (!$container) return;
|
|
19146
19212
|
for (let $card of $container.querySelectorAll(".JSON_CARD_ANCHORED")) $card.classList.remove("JSON_CARD_ANCHORED");
|
|
19147
19213
|
if (priv.anchor_state !== "on" || !priv.anchor_path) return;
|
|
19148
|
-
let $it = $container.querySelector(".JSON_CARD[data-json-path=\"" +
|
|
19214
|
+
let $it = $container.querySelector(".JSON_CARD[data-json-path=\"" + css_string(priv.anchor_path) + "\"]");
|
|
19149
19215
|
if ($it) $it.classList.add("JSON_CARD_ANCHORED");
|
|
19150
19216
|
}
|
|
19151
19217
|
/************************************************************
|
|
@@ -22611,7 +22677,7 @@ function make_toolbar$3(gobj) {
|
|
|
22611
22677
|
function canvas_mount$1(gobj) {
|
|
22612
22678
|
let $container = gobj_read_attr(gobj, "$container");
|
|
22613
22679
|
if (!$container) return null;
|
|
22614
|
-
return $container
|
|
22680
|
+
return find_by_id($container, gobj_read_str_attr(gobj, "canvas_id"));
|
|
22615
22681
|
}
|
|
22616
22682
|
/************************************************************
|
|
22617
22683
|
* Build the G6 graph instance.
|
|
@@ -52243,12 +52309,13 @@ function yui_graph_minimap_repaint(plugin) {
|
|
|
52243
52309
|
* it WANTS and the host answers with the data:
|
|
52244
52310
|
*
|
|
52245
52311
|
* out EV_TREE_WANTED {} Refresh pressed
|
|
52246
|
-
* in EV_LOAD_TREE {tree}
|
|
52247
|
-
* out EV_TRACE_INFO_WANTED {gclass}
|
|
52312
|
+
* in EV_LOAD_TREE {tree, set_id} the `view-gobj-tree` answer
|
|
52313
|
+
* out EV_TRACE_INFO_WANTED {gclass, set_id} a card was opened
|
|
52248
52314
|
* in EV_TRACE_INFO {gclass, gclass_levels, global_levels,
|
|
52249
|
-
* gclass_on, global_on, error}
|
|
52315
|
+
* gclass_on, global_on, error, set_id}
|
|
52250
52316
|
* out EV_SET_TRACE_LEVEL {scope: "gobj"|"gclass"|"global",
|
|
52251
|
-
* gobj, gclass, levels: [...], set
|
|
52317
|
+
* gobj, gclass, levels: [...], set,
|
|
52318
|
+
* set_id}
|
|
52252
52319
|
* out EV_GCLASS_WANTED {gclass} the gclass button
|
|
52253
52320
|
* in EV_GCLASS_DESCRIPTION {gclass, description}
|
|
52254
52321
|
*
|
|
@@ -52258,6 +52325,14 @@ function yui_graph_minimap_repaint(plugin) {
|
|
|
52258
52325
|
* trace info of `gclass` again: what the reader is on stays
|
|
52259
52326
|
* open.
|
|
52260
52327
|
*
|
|
52328
|
+
* `set_id` (7.27.33) numbers each set. A host that echoes
|
|
52329
|
+
* it says WHICH set an answer follows: the set_id of the
|
|
52330
|
+
* set in the two reads made after it (and in the answer of
|
|
52331
|
+
* a WANTED that carried one), null in any other answer. A
|
|
52332
|
+
* read asked BEFORE a set and answered after it then no
|
|
52333
|
+
* longer unlocks what the set locked. A host that leaves
|
|
52334
|
+
* it out is matched by gclass, as before.
|
|
52335
|
+
*
|
|
52261
52336
|
* TRACES, in "remote": three scopes, each where it belongs.
|
|
52262
52337
|
* The kernel's levels (`machine`, `create_delete`...; the
|
|
52263
52338
|
* table gobj.c calls "global") are valid in all three, a
|
|
@@ -52472,6 +52547,9 @@ var PRIVATE_DATA$9 = {
|
|
|
52472
52547
|
viewer_awaits: "",
|
|
52473
52548
|
viewer_stale: "",
|
|
52474
52549
|
set_in_flight: null,
|
|
52550
|
+
set_serial: 0,
|
|
52551
|
+
pending_set_id: 0,
|
|
52552
|
+
viewer_awaits_set: 0,
|
|
52475
52553
|
view_refused: false
|
|
52476
52554
|
};
|
|
52477
52555
|
var __gclass__$9 = null;
|
|
@@ -53203,7 +53281,7 @@ function make_toolbar$1(gobj) {
|
|
|
53203
53281
|
function canvas_mount(gobj) {
|
|
53204
53282
|
let $container = gobj_read_attr(gobj, "$container");
|
|
53205
53283
|
if (!$container) return null;
|
|
53206
|
-
return $container
|
|
53284
|
+
return find_by_id($container, gobj.priv.canvas_id);
|
|
53207
53285
|
}
|
|
53208
53286
|
/************************************************************
|
|
53209
53287
|
* Build a G6 graph instance
|
|
@@ -54677,7 +54755,7 @@ function paint_anchor_mark(gobj) {
|
|
|
54677
54755
|
if (!$container) return;
|
|
54678
54756
|
for (let $card of $container.querySelectorAll(".GOBJ_CARD_ANCHORED")) $card.classList.remove("GOBJ_CARD_ANCHORED");
|
|
54679
54757
|
if (priv.anchor_state !== "on" || !priv.anchor_name) return;
|
|
54680
|
-
let $it = $container.querySelector(".GOBJ_CARD[data-gobj-name=\"" +
|
|
54758
|
+
let $it = $container.querySelector(".GOBJ_CARD[data-gobj-name=\"" + css_string(priv.anchor_name) + "\"]");
|
|
54681
54759
|
if ($it) $it.classList.add("GOBJ_CARD_ANCHORED");
|
|
54682
54760
|
}
|
|
54683
54761
|
/************************************************************
|
|
@@ -54917,7 +54995,7 @@ function ac_load_tree(gobj, event, kw, src) {
|
|
|
54917
54995
|
}
|
|
54918
54996
|
let first = !priv.remote_root;
|
|
54919
54997
|
priv.remote_root = root;
|
|
54920
|
-
priv.trace_pending = false;
|
|
54998
|
+
if (answers_set(kw, priv.pending_set_id)) priv.trace_pending = false;
|
|
54921
54999
|
reload_keeping_popover(gobj, first ? {} : { preserve_view: true });
|
|
54922
55000
|
return 0;
|
|
54923
55001
|
}
|
|
@@ -54939,24 +55017,29 @@ function ac_trace_info(gobj, event, kw, src) {
|
|
|
54939
55017
|
global_on: list(kw.global_on),
|
|
54940
55018
|
error: kw.error || ""
|
|
54941
55019
|
};
|
|
54942
|
-
priv.trace_pending = false;
|
|
54943
|
-
if (priv.set_in_flight && priv.set_in_flight.gclass === kw.gclass) priv.set_in_flight = null;
|
|
55020
|
+
if (answers_set(kw, priv.pending_set_id)) priv.trace_pending = false;
|
|
55021
|
+
if (priv.set_in_flight && priv.set_in_flight.gclass === kw.gclass && answers_set(kw, priv.set_in_flight.set_id)) priv.set_in_flight = null;
|
|
54944
55022
|
let d = priv.popover_node;
|
|
54945
55023
|
let root = priv.remote_root;
|
|
54946
55024
|
if (priv.popover_mode === "node" && d && d.gclass === kw.gclass || priv.popover_mode === "yuno" && root && root.gclass === kw.gclass) render_current_popover(gobj);
|
|
54947
55025
|
let viewer = gclass_viewer_gobj(gobj);
|
|
54948
55026
|
if (viewer) {
|
|
54949
55027
|
let shown = gobj_read_str_attr(viewer, "gclass_name");
|
|
54950
|
-
if (priv.viewer_awaits === kw.gclass) {
|
|
55028
|
+
if (priv.viewer_awaits === kw.gclass && answers_set(kw, priv.viewer_awaits_set)) {
|
|
54951
55029
|
priv.viewer_awaits = "";
|
|
54952
55030
|
if (priv.viewer_stale === shown && shown !== kw.gclass) {
|
|
55031
|
+
let set_id = priv.viewer_awaits_set;
|
|
54953
55032
|
priv.viewer_stale = "";
|
|
54954
55033
|
priv.viewer_awaits = shown;
|
|
54955
55034
|
priv.set_in_flight = {
|
|
54956
55035
|
gclass: shown,
|
|
54957
|
-
scope: "gclass"
|
|
55036
|
+
scope: "gclass",
|
|
55037
|
+
set_id
|
|
54958
55038
|
};
|
|
54959
|
-
gobj_publish_event(gobj, "EV_TRACE_INFO_WANTED", {
|
|
55039
|
+
gobj_publish_event(gobj, "EV_TRACE_INFO_WANTED", {
|
|
55040
|
+
gclass: shown,
|
|
55041
|
+
set_id
|
|
55042
|
+
});
|
|
54960
55043
|
}
|
|
54961
55044
|
}
|
|
54962
55045
|
if (shown === kw.gclass) gobj_send_event(viewer, "EV_SET_TRACES", viewer_traces(gobj, shown), gobj);
|
|
@@ -54964,6 +55047,22 @@ function ac_trace_info(gobj, event, kw, src) {
|
|
|
54964
55047
|
return 0;
|
|
54965
55048
|
}
|
|
54966
55049
|
/************************************************************
|
|
55050
|
+
* Is this answer (EV_LOAD_TREE, EV_TRACE_INFO) the one that
|
|
55051
|
+
* follows the set `set_id`?
|
|
55052
|
+
*
|
|
55053
|
+
* A host that echoes `set_id` says so itself: null for a read
|
|
55054
|
+
* that is no set's, which is a read asked BEFORE the set when
|
|
55055
|
+
* it arrives after it (REV-CLOUD V40.2: the card's own read,
|
|
55056
|
+
* answered after a tick, unlocked the block and showed the
|
|
55057
|
+
* levels before the set, enabled, for one round trip). A host
|
|
55058
|
+
* that leaves it out (before 7.27.33) cannot say: any answer
|
|
55059
|
+
* will do, and the caller matches by gclass.
|
|
55060
|
+
************************************************************/
|
|
55061
|
+
function answers_set(kw, set_id) {
|
|
55062
|
+
if (!kw || kw.set_id === void 0) return true;
|
|
55063
|
+
return !!set_id && kw.set_id === set_id;
|
|
55064
|
+
}
|
|
55065
|
+
/************************************************************
|
|
54967
55066
|
* The gclass viewer this view opened, while it is open.
|
|
54968
55067
|
************************************************************/
|
|
54969
55068
|
function gclass_viewer_gobj(gobj) {
|
|
@@ -55059,29 +55158,35 @@ function ac_set_gclass_trace(gobj, event, kw, src) {
|
|
|
55059
55158
|
}
|
|
55060
55159
|
function set_trace_levels(gobj, target, scope, levels, set) {
|
|
55061
55160
|
let priv = gobj.priv;
|
|
55161
|
+
let set_id = ++priv.set_serial;
|
|
55062
55162
|
priv.trace_pending = true;
|
|
55163
|
+
priv.pending_set_id = set_id;
|
|
55063
55164
|
render_current_popover(gobj);
|
|
55064
55165
|
priv.set_in_flight = {
|
|
55065
55166
|
gclass: target.gclass,
|
|
55066
|
-
scope
|
|
55167
|
+
scope,
|
|
55168
|
+
set_id
|
|
55067
55169
|
};
|
|
55068
55170
|
let viewer = gclass_viewer_gobj(gobj);
|
|
55069
55171
|
if (viewer) {
|
|
55070
55172
|
let shown = gobj_read_str_attr(viewer, "gclass_name");
|
|
55071
55173
|
if (lock_viewer_for_set(gobj, shown, priv.set_in_flight)) gobj_send_event(viewer, "EV_SET_TRACES", viewer_traces(gobj, shown), gobj);
|
|
55174
|
+
else if (priv.viewer_awaits && priv.viewer_awaits === target.gclass) priv.viewer_awaits_set = set_id;
|
|
55072
55175
|
}
|
|
55073
55176
|
gobj_publish_event(gobj, "EV_SET_TRACE_LEVEL", {
|
|
55074
55177
|
scope,
|
|
55075
55178
|
gobj: target.full_name || "",
|
|
55076
55179
|
gclass: target.gclass,
|
|
55077
55180
|
levels,
|
|
55078
|
-
set
|
|
55181
|
+
set,
|
|
55182
|
+
set_id
|
|
55079
55183
|
});
|
|
55080
55184
|
}
|
|
55081
55185
|
function lock_viewer_for_set(gobj, shown, set) {
|
|
55082
55186
|
let priv = gobj.priv;
|
|
55083
55187
|
if (!(shown === set.gclass || set.scope === "global")) return false;
|
|
55084
55188
|
priv.viewer_awaits = set.gclass;
|
|
55189
|
+
priv.viewer_awaits_set = set.set_id;
|
|
55085
55190
|
priv.viewer_stale = shown !== set.gclass ? shown : "";
|
|
55086
55191
|
return true;
|
|
55087
55192
|
}
|
|
@@ -55932,7 +56037,7 @@ function apply_active_route(gobj) {
|
|
|
55932
56037
|
let $c = gobj_read_attr(gobj, "$container");
|
|
55933
56038
|
let route = gobj_read_attr(gobj, "active_route") || "";
|
|
55934
56039
|
if (!$c || empty_string(route)) return;
|
|
55935
|
-
let $a = $c.querySelector(`a[data-route="${
|
|
56040
|
+
let $a = $c.querySelector(`a[data-route="${css_string(route)}"]`);
|
|
55936
56041
|
if ($a) {
|
|
55937
56042
|
let $li = $a.closest("li");
|
|
55938
56043
|
if ($li) $li.classList.add("is-active");
|
|
@@ -56560,7 +56665,7 @@ function ac_set_item_badge(gobj, event, kw, src) {
|
|
|
56560
56665
|
gobj_write_attr(gobj, "badges", badges);
|
|
56561
56666
|
let $c = gobj_read_attr(gobj, "$container");
|
|
56562
56667
|
if (!$c) return 0;
|
|
56563
|
-
let $badges = $c.querySelectorAll(`[data-item-id="${
|
|
56668
|
+
let $badges = $c.querySelectorAll(`[data-item-id="${css_string(item_id)}"] .NAV_ITEM_BADGE`);
|
|
56564
56669
|
for (let $badge of $badges) paint_badge($badge, badge, tone);
|
|
56565
56670
|
return 0;
|
|
56566
56671
|
}
|
|
@@ -56584,7 +56689,7 @@ function ac_route_changed(gobj, event, kw, src) {
|
|
|
56584
56689
|
id_to_mark = parent_item ? parent_item.id : item && item.id;
|
|
56585
56690
|
} else id_to_mark = item && item.id;
|
|
56586
56691
|
if (!id_to_mark) return 0;
|
|
56587
|
-
let $a = $c.querySelector(`[data-item-id="${
|
|
56692
|
+
let $a = $c.querySelector(`[data-item-id="${css_string(id_to_mark)}"]`);
|
|
56588
56693
|
if ($a) {
|
|
56589
56694
|
let $li = $a.closest("li");
|
|
56590
56695
|
if ($li) $li.classList.add("is-active");
|
|
@@ -56595,7 +56700,7 @@ function ac_route_changed(gobj, event, kw, src) {
|
|
|
56595
56700
|
$c.querySelectorAll(".yui-accordion-head").forEach(($hd) => {
|
|
56596
56701
|
let $body = $hd.nextElementSibling;
|
|
56597
56702
|
if (!$body || !$body.classList.contains("yui-accordion-body")) return;
|
|
56598
|
-
let contains_active = !!$body.querySelector(`[data-item-id="${
|
|
56703
|
+
let contains_active = !!$body.querySelector(`[data-item-id="${css_string(active_leaf_id)}"]`);
|
|
56599
56704
|
$body.classList.toggle("is-hidden", !contains_active);
|
|
56600
56705
|
$hd.classList.toggle("is-open", contains_active);
|
|
56601
56706
|
$hd.setAttribute("aria-expanded", contains_active ? "true" : "false");
|
|
@@ -56603,9 +56708,6 @@ function ac_route_changed(gobj, event, kw, src) {
|
|
|
56603
56708
|
}
|
|
56604
56709
|
return 0;
|
|
56605
56710
|
}
|
|
56606
|
-
function css_escape(s) {
|
|
56607
|
-
return String(s).replace(/\\/g, "\\\\").replace(/"/g, "\\\"");
|
|
56608
|
-
}
|
|
56609
56711
|
/***************************************************************
|
|
56610
56712
|
* FSM
|
|
56611
56713
|
***************************************************************/
|
|
@@ -59485,7 +59587,7 @@ function ac_show$5(gobj, event, kw, src) {
|
|
|
59485
59587
|
}
|
|
59486
59588
|
let $container = gobj_read_attr(gobj, "$container");
|
|
59487
59589
|
let $current_item = gobj_read_attr(gobj, "$current_item");
|
|
59488
|
-
let $a = $container.querySelector(`a[href="${href}"]`);
|
|
59590
|
+
let $a = $container.querySelector(`a[href="${css_string(href)}"]`);
|
|
59489
59591
|
if ($a) {
|
|
59490
59592
|
if ($current_item && $current_item !== $a.parentNode) {
|
|
59491
59593
|
$current_item.classList.remove("is-active");
|
|
@@ -61520,7 +61622,7 @@ function build_ui$5(gobj) {
|
|
|
61520
61622
|
[yui_toolbar_icon("yi-magnifying-glass")]
|
|
61521
61623
|
]]
|
|
61522
61624
|
]);
|
|
61523
|
-
let $search_input = $search_box
|
|
61625
|
+
let $search_input = find_by_id($search_box, search_id);
|
|
61524
61626
|
attach_clear($search_box, $search_input);
|
|
61525
61627
|
if ($search_input) $search_input.addEventListener("input", (event) => {
|
|
61526
61628
|
gobj_send_event(gobj, "EV_SEARCH", { text: event.target.value.trim() }, gobj);
|
|
@@ -61680,7 +61782,7 @@ function build_ui$5(gobj) {
|
|
|
61680
61782
|
});
|
|
61681
61783
|
gobj_write_attr(gobj, "selection_bar", bar);
|
|
61682
61784
|
bar.$el.style.flex = "none";
|
|
61683
|
-
$container.insertBefore(bar.$el, $container
|
|
61785
|
+
$container.insertBefore(bar.$el, find_by_id($container, table_id));
|
|
61684
61786
|
}
|
|
61685
61787
|
let $parent_filter = createElement2([
|
|
61686
61788
|
"div",
|
|
@@ -61725,7 +61827,7 @@ function build_ui$5(gobj) {
|
|
|
61725
61827
|
]
|
|
61726
61828
|
]);
|
|
61727
61829
|
gobj.priv.$parent_filter = $parent_filter;
|
|
61728
|
-
$container.insertBefore($parent_filter, $container
|
|
61830
|
+
$container.insertBefore($parent_filter, find_by_id($container, table_id));
|
|
61729
61831
|
let $toolbar_slot = $container.querySelector(".toolbar_tabulator_table");
|
|
61730
61832
|
if ($table_toolbar instanceof Element) $toolbar_slot.appendChild($table_toolbar);
|
|
61731
61833
|
else $toolbar_slot.appendChild(createElement2(["div", {}]));
|
|
@@ -62172,7 +62274,7 @@ function create_tabulator(gobj) {
|
|
|
62172
62274
|
autoResize: false
|
|
62173
62275
|
});
|
|
62174
62276
|
let $view_container = gobj_read_attr(gobj, "$container");
|
|
62175
|
-
let $table_el = $view_container ? $view_container
|
|
62277
|
+
let $table_el = $view_container ? find_by_id($view_container, table_id) : null;
|
|
62176
62278
|
if (!$table_el) {
|
|
62177
62279
|
log_error(`${gobj_short_name(gobj)}: table element '#${table_id}' not found in $container`);
|
|
62178
62280
|
return;
|
|
@@ -75873,7 +75975,7 @@ function mt_create$3(gobj) {
|
|
|
75873
75975
|
if (gobj_read_bool_attr(gobj, "readonly") && priv.operation_mode === "edition") gobj_write_str_attr(gobj, "operation_mode", "reading");
|
|
75874
75976
|
let canvas_id = clean_name(gobj_name(gobj)) + "-canvas";
|
|
75875
75977
|
gobj_write_attr(gobj, "canvas_id", canvas_id);
|
|
75876
|
-
let $container_canvas = build_ui$3(gobj)
|
|
75978
|
+
let $container_canvas = find_by_id(build_ui$3(gobj), priv.canvas_id);
|
|
75877
75979
|
priv.gobj_nodes_tree = gobj_create_service(`${gobj_name(gobj)}-g6`, "C_G6_NODES_TREE", {
|
|
75878
75980
|
$container: $container_canvas,
|
|
75879
75981
|
subscriber: gobj,
|
|
@@ -78581,6 +78683,7 @@ var __gclass__$2 = null;
|
|
|
78581
78683
|
* Framework Methods
|
|
78582
78684
|
******************************/
|
|
78583
78685
|
function mt_create$2(gobj) {
|
|
78686
|
+
ensure_drag_canvas_patch();
|
|
78584
78687
|
ensure_pinch_zoom_patch();
|
|
78585
78688
|
build_ui$2(gobj);
|
|
78586
78689
|
let subscriber = gobj_read_pointer_attr(gobj, "subscriber");
|
|
@@ -82924,7 +83027,7 @@ function form_changes(initial, values) {
|
|
|
82924
83027
|
function apply_form_changes(gobj, $form, changes) {
|
|
82925
83028
|
for (let name of Object.keys(changes)) {
|
|
82926
83029
|
if (name === "flag") continue;
|
|
82927
|
-
let $control = $form.querySelector(`[data-name="${name}"]`);
|
|
83030
|
+
let $control = $form.querySelector(`[data-name="${css_string(name)}"]`);
|
|
82928
83031
|
if (!$control) {
|
|
82929
83032
|
log_warning(`${gobj_short_name(gobj)}: a change of '${name}' has no field in the form opened again: not put back`);
|
|
82930
83033
|
continue;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yuneta/gobj-ui",
|
|
3
|
-
"version": "7.27.
|
|
3
|
+
"version": "7.27.34",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/gobj-ui.cjs.js",
|
|
6
6
|
"module": "dist/gobj-ui.es.js",
|
|
@@ -44,6 +44,7 @@
|
|
|
44
44
|
"@rollup/plugin-terser": "^1.0.2",
|
|
45
45
|
"@vitest/coverage-v8": "^5.0.5",
|
|
46
46
|
"@yuneta/gobj-js": "^7.27.0",
|
|
47
|
+
"jsdom": "^30.1.3",
|
|
47
48
|
"vite": "^8.3.5",
|
|
48
49
|
"vitest": "^5.0.5"
|
|
49
50
|
},
|
package/src/c_yui_form.js
CHANGED
|
@@ -102,6 +102,7 @@ import {
|
|
|
102
102
|
import {form_time_cell_editor} from "./form_time_cell_editor.js";
|
|
103
103
|
import {yui_tabulator_keep_edit_on_redraw, yui_tabulator_close_editor} from "./yui_tabulator_edit.js";
|
|
104
104
|
import {safe_locale} from "./yui_date_text.js";
|
|
105
|
+
import {css_string} from "./yui_selector.js";
|
|
105
106
|
import {parse_json_field, json_editor_value} from "./form_json_field.js";
|
|
106
107
|
import {
|
|
107
108
|
json_editor_menu_items,
|
|
@@ -1369,7 +1370,7 @@ function apply_form_mode(gobj, $form)
|
|
|
1369
1370
|
}
|
|
1370
1371
|
|
|
1371
1372
|
let pkey = gobj_read_str_attr(gobj, "pkey");
|
|
1372
|
-
let $input = $form.querySelector(`[name="${pkey}"]`);
|
|
1373
|
+
let $input = $form.querySelector(`[name="${css_string(pkey)}"]`);
|
|
1373
1374
|
if(!$input) {
|
|
1374
1375
|
log_error(sprintf("%s: form_mode '%s' but form has no pkey field '%s'",
|
|
1375
1376
|
gobj_short_name(gobj), mode, pkey
|
|
@@ -2720,7 +2721,7 @@ function template2columns(gobj, columns, template, sub_elements)
|
|
|
2720
2721
|
cellClick: function(evt, cell) {
|
|
2721
2722
|
evt.stopPropagation();
|
|
2722
2723
|
let $row = cell.getRow().getElement();
|
|
2723
|
-
let $extend = $row.querySelector(`[name="${field_desc.name}"]`);
|
|
2724
|
+
let $extend = $row.querySelector(`[name="${css_string(field_desc.name)}"]`);
|
|
2724
2725
|
if(!$extend) {
|
|
2725
2726
|
log_error(`${gobj_short_name(gobj)}: nested table '${field_desc.name}' not found in its row`);
|
|
2726
2727
|
return;
|
package/src/c_yui_fsm_graph.js
CHANGED
|
@@ -72,6 +72,7 @@ import {yui_is_dark, yui_theme_now, yui_watch_theme} from "./yui_theme.js";
|
|
|
72
72
|
import {ensure_drag_canvas_patch} from "./g6_drag_canvas_touch.js";
|
|
73
73
|
import {ensure_pinch_zoom_patch} from "./g6_touch_gestures.js";
|
|
74
74
|
import {keep_canvas_tab_order} from "./g6_canvas_tab_order.js";
|
|
75
|
+
import {find_by_id} from "./yui_selector.js";
|
|
75
76
|
|
|
76
77
|
import {t} from "i18next";
|
|
77
78
|
|
|
@@ -360,7 +361,7 @@ function canvas_mount(gobj)
|
|
|
360
361
|
if(!$container) {
|
|
361
362
|
return null;
|
|
362
363
|
}
|
|
363
|
-
return $container
|
|
364
|
+
return find_by_id($container, gobj_read_str_attr(gobj, "canvas_id"));
|
|
364
365
|
}
|
|
365
366
|
|
|
366
367
|
/************************************************************
|