@yuneta/gobj-ui 7.26.10 → 7.26.12
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 +27 -7
- package/dist/gobj-ui.cjs.js +132 -66
- package/dist/gobj-ui.es.js +132 -66
- package/package.json +3 -2
- package/scripts/check-markup-strings.mjs +372 -0
- package/src/c_g6_nodes_tree.js +31 -8
- package/src/c_yui_form.js +2 -1
- package/src/c_yui_gclass.js +5 -5
- package/src/c_yui_json.js +1 -1
- package/src/c_yui_schema_editor.js +2 -2
- package/src/c_yui_shell.js +71 -2
- package/src/c_yui_treedb_graph.js +2 -1
- package/src/c_yui_treedb_topic_with_form.js +8 -4
- package/src/c_yui_window.js +2 -1
- package/src/c_yui_window_manager.js +14 -4
- package/src/gclass_head_text.wiring.test.js +63 -0
- package/src/overlay_marker_after_back.wiring.test.js +180 -11
- package/src/window_show.wiring.test.js +48 -0
- package/src/yui_text.js +16 -0
- package/src/yui_text.test.js +13 -1
package/README.md
CHANGED
|
@@ -13,12 +13,17 @@ Published as `@yuneta/gobj-ui`. Built on top of [`@yuneta/gobj-js`](https://gith
|
|
|
13
13
|
> routing contract (URL = source of truth, push/replace history, the
|
|
14
14
|
> position/preference/transient litmus).
|
|
15
15
|
>
|
|
16
|
-
> **Peer floors today** (`package.json`): `@yuneta/gobj-js` `^7.
|
|
16
|
+
> **Peer floors today** (`package.json`): `@yuneta/gobj-js` `^7.26.3`,
|
|
17
17
|
> `@antv/g6` `^5.1.0`, `bulma` `^1.0.4`, `i18next` `^26.3.6`, `maplibre-gl`
|
|
18
18
|
> `^6.11.2`, `tabulator-tables` `^6.5.3`, `tom-select` `^2.6.2`, `uplot`
|
|
19
19
|
> `^1.6.32`, `vanilla-jsoneditor` `^3.13.0`. The notices below say when and why
|
|
20
20
|
> each floor moved; the list above is what a consumer must meet now.
|
|
21
21
|
>
|
|
22
|
+
> **BREAKING (7.26.10):** the peer floor of `@yuneta/gobj-js` rose to
|
|
23
|
+
> `^7.26.3`. The library passes its markup through `html_markup()`, which first
|
|
24
|
+
> ships in that gobj-js. A consumer locked on an older gobj-js gets `ERESOLVE`:
|
|
25
|
+
> raise both in the same change. See the CHANGELOG entry.
|
|
26
|
+
>
|
|
22
27
|
> **BREAKING (7.23.172):** the peer floor of `@yuneta/gobj-js` rose to
|
|
23
28
|
> `^7.22.0`. The Developer window turns the runtime's trace bits on and off and
|
|
24
29
|
> never reads a message to decide what to show; it needs the trace API of that
|
|
@@ -3338,14 +3343,29 @@ text is in the yunetas `CLAUDE.md` ("JS GUI conventions"); in short:
|
|
|
3338
3343
|
longer run. The test-app runs in that mode. An app turns it on at startup,
|
|
3339
3344
|
before it builds anything, once its own code is migrated:
|
|
3340
3345
|
|
|
3341
|
-
1. Run the static check on the app's sources
|
|
3346
|
+
1. Run the static check on the app's sources, from the published package
|
|
3347
|
+
(7.26.11+ ships the script):
|
|
3342
3348
|
`node node_modules/@yuneta/gobj-ui/scripts/check-markup-strings.mjs src`
|
|
3343
|
-
|
|
3349
|
+
— usually from the app's `prebuild`. It imports `acorn`, which the APP
|
|
3350
|
+
must declare as a devDependency (npm does not install a dependency's
|
|
3351
|
+
devDependencies). It lists a markup string literal in a description
|
|
3344
3352
|
(`literal`, wrap it in `html_markup()`), markup built with values
|
|
3345
|
-
(`built`,
|
|
3346
|
-
|
|
3347
|
-
|
|
3348
|
-
|
|
3353
|
+
(`built`: a template, `String.raw`, a `+` chain, `.concat()`, a
|
|
3354
|
+
`[...].join()`, or a string method such as `.trim()` over one of those,
|
|
3355
|
+
whose STATIC head starts with `<` — empty pieces before it are skipped;
|
|
3356
|
+
build the element with `createElement2()` and pass the value as text),
|
|
3357
|
+
a markup string in a list
|
|
3358
|
+
of children (`in-list`, which is text since gobj-js 7.26.2) and a list of
|
|
3359
|
+
children whose first item is a markup string (`list-head`: such a list is
|
|
3360
|
+
read as one description). A ternary, `||`/`&&`/`??` and a comma
|
|
3361
|
+
sequence (its last item) are checked branch by branch; a tag is matched
|
|
3362
|
+
in any case. It CANNOT see: a variable or a function result that holds
|
|
3363
|
+
a string (a helper that returns markup); a template whose head is an
|
|
3364
|
+
expression that is not a static string (`` `${prefix}<b>` ``); a
|
|
3365
|
+
description built piece by piece (`push()` into the content list); a
|
|
3366
|
+
computed tag with an attrs slot that is not an object literal; markup
|
|
3367
|
+
given to `innerHTML` or to a widget (Tabulator, G6). Step 3 is the check
|
|
3368
|
+
for those. A path that does not exist exits with 2 and a message.
|
|
3349
3369
|
2. Call `set_strings_are_text(true)` before the first `createElement2()`.
|
|
3350
3370
|
3. Walk the app and read the console: each string that starts with `<` is
|
|
3351
3371
|
logged once (*"use html_markup() if it is markup"*). A logged string is
|
package/dist/gobj-ui.cjs.js
CHANGED
|
@@ -471,6 +471,59 @@ function resolve_route(item_index, route) {
|
|
|
471
471
|
};
|
|
472
472
|
}
|
|
473
473
|
//#endregion
|
|
474
|
+
//#region src/yui_text.js
|
|
475
|
+
/***********************************************************************
|
|
476
|
+
* yui_text.js
|
|
477
|
+
*
|
|
478
|
+
* DATA as text for createElement2().
|
|
479
|
+
*
|
|
480
|
+
* createElement2() takes a string content that starts with '<' for
|
|
481
|
+
* MARKUP and parses it (that is how a component passes an inline
|
|
482
|
+
* icon). So a value that came from outside -- a backend answer, a
|
|
483
|
+
* treedb node, a name somebody typed, a frame of the traffic -- must
|
|
484
|
+
* never go in as a bare string: "<img src=x onerror=...>" would run.
|
|
485
|
+
* It goes in as a Text node, which is always text.
|
|
486
|
+
*
|
|
487
|
+
* Trimmed like createElement2() trims a string, so the change of
|
|
488
|
+
* form does not change what is shown. A Text node under an
|
|
489
|
+
* `i18n`/`data-i18n` element is still re-translated by
|
|
490
|
+
* refresh_language(), which sets textContent.
|
|
491
|
+
*
|
|
492
|
+
* Copyright (c) 2026, ArtGins.
|
|
493
|
+
* All Rights Reserved.
|
|
494
|
+
***********************************************************************/
|
|
495
|
+
/************************************************************
|
|
496
|
+
* A Text node with `value` as its text ("" for null/undefined).
|
|
497
|
+
************************************************************/
|
|
498
|
+
function text_node(value) {
|
|
499
|
+
if (value === null || value === void 0) return document.createTextNode("");
|
|
500
|
+
return document.createTextNode(String(value).trim());
|
|
501
|
+
}
|
|
502
|
+
/************************************************************
|
|
503
|
+
* A Tabulator `titleFormatter` that shows the column title as text.
|
|
504
|
+
*
|
|
505
|
+
* Tabulator puts a STRING title in with innerHTML, so a title taken
|
|
506
|
+
* from a schema (`header`, which the schema editor writes) is markup
|
|
507
|
+
* unless the column carries a formatter that returns a Node.
|
|
508
|
+
************************************************************/
|
|
509
|
+
function text_title_formatter(cell) {
|
|
510
|
+
return text_node(cell.getValue());
|
|
511
|
+
}
|
|
512
|
+
/************************************************************
|
|
513
|
+
* A Tabulator `itemFormatter` for a `list` editor or header filter
|
|
514
|
+
* that shows each item's label as text.
|
|
515
|
+
*
|
|
516
|
+
* Tabulator appends what an itemFormatter returns only when it is an
|
|
517
|
+
* HTMLElement (a Text node would be innerHTML'd as "[object Text]"),
|
|
518
|
+
* and it puts a bare label in with innerHTML. A label taken from a
|
|
519
|
+
* schema (`enum_list`) is data, so it goes in a span, as text.
|
|
520
|
+
************************************************************/
|
|
521
|
+
function text_list_item_formatter(label) {
|
|
522
|
+
const span = document.createElement("span");
|
|
523
|
+
span.textContent = label === null || label === void 0 ? "" : String(label);
|
|
524
|
+
return span;
|
|
525
|
+
}
|
|
526
|
+
//#endregion
|
|
474
527
|
//#region src/route_map_model.js
|
|
475
528
|
/***********************************************************************
|
|
476
529
|
* route_map_model.js
|
|
@@ -919,6 +972,7 @@ var PRIVATE_DATA$22 = {
|
|
|
919
972
|
overlay_stack: [],
|
|
920
973
|
overlay_seq: 0,
|
|
921
974
|
expected_pops: 0,
|
|
975
|
+
expected_pop_hash: "",
|
|
922
976
|
pending_markers: [],
|
|
923
977
|
popstate_handler: null,
|
|
924
978
|
avatar_provider: null,
|
|
@@ -968,13 +1022,30 @@ function mt_start$20(gobj) {
|
|
|
968
1022
|
preinstantiate_eager_views(gobj);
|
|
969
1023
|
if ((0, _yuneta_gobj_js.gobj_read_attr)(gobj, "use_hash")) {
|
|
970
1024
|
priv.hash_handler = () => {
|
|
1025
|
+
let p = gobj.priv;
|
|
1026
|
+
let dropped = false;
|
|
1027
|
+
if (p && p.expected_pops > 0 && window.location.hash !== p.expected_pop_hash) {
|
|
1028
|
+
drop_expected_pops(gobj);
|
|
1029
|
+
dropped = true;
|
|
1030
|
+
}
|
|
971
1031
|
let route = hash_to_route(window.location.hash);
|
|
972
1032
|
if (!(0, _yuneta_gobj_js.empty_string)(route)) navigate_to(gobj, route);
|
|
1033
|
+
if (dropped) push_pending_markers(gobj);
|
|
973
1034
|
};
|
|
974
1035
|
window.addEventListener("hashchange", priv.hash_handler);
|
|
975
1036
|
priv.popstate_handler = (ev) => {
|
|
976
1037
|
let p = gobj.priv;
|
|
977
1038
|
if (!p) return;
|
|
1039
|
+
if (p.expected_pops > 0 && window.location.hash !== p.expected_pop_hash) {
|
|
1040
|
+
drop_expected_pops(gobj);
|
|
1041
|
+
on_traversal(ev);
|
|
1042
|
+
push_pending_markers(gobj);
|
|
1043
|
+
return;
|
|
1044
|
+
}
|
|
1045
|
+
on_traversal(ev);
|
|
1046
|
+
};
|
|
1047
|
+
let on_traversal = (ev) => {
|
|
1048
|
+
let p = gobj.priv;
|
|
978
1049
|
if (p.expected_pops > 0) {
|
|
979
1050
|
p.expected_pops--;
|
|
980
1051
|
if (p.expected_pops === 0) push_pending_markers(gobj);
|
|
@@ -982,6 +1053,7 @@ function mt_start$20(gobj) {
|
|
|
982
1053
|
}
|
|
983
1054
|
if (p.overlay_stack.length === 0) return;
|
|
984
1055
|
let top = p.overlay_stack[p.overlay_stack.length - 1];
|
|
1056
|
+
if (top.marker_pending) return;
|
|
985
1057
|
if (window.location.hash !== top.hash) return;
|
|
986
1058
|
let st = ev && ev.state;
|
|
987
1059
|
if (st && st.__yui_overlay__ === top.id) return;
|
|
@@ -1026,6 +1098,9 @@ function mt_stop$20(gobj) {
|
|
|
1026
1098
|
window.removeEventListener("popstate", priv.popstate_handler);
|
|
1027
1099
|
priv.popstate_handler = null;
|
|
1028
1100
|
}
|
|
1101
|
+
priv.expected_pops = 0;
|
|
1102
|
+
priv.expected_pop_hash = "";
|
|
1103
|
+
priv.pending_markers = [];
|
|
1029
1104
|
if (priv.keydown_handler) {
|
|
1030
1105
|
window.removeEventListener("keydown", priv.keydown_handler);
|
|
1031
1106
|
priv.keydown_handler = null;
|
|
@@ -1829,7 +1904,7 @@ function build_toolbar_action_item(gobj, it) {
|
|
|
1829
1904
|
class: "yui-toolbar-item-label",
|
|
1830
1905
|
i18n: it.name
|
|
1831
1906
|
},
|
|
1832
|
-
it.name
|
|
1907
|
+
text_node(it.name)
|
|
1833
1908
|
]);
|
|
1834
1909
|
let aria_key = it.aria_label || it.name || it.id || "";
|
|
1835
1910
|
let i18n_aria = it.aria_label || it.name;
|
|
@@ -2245,7 +2320,7 @@ function build_dropdown_row(gobj, sub, idx) {
|
|
|
2245
2320
|
class: "yui-toolbar-dropdown-label",
|
|
2246
2321
|
i18n: sub.name
|
|
2247
2322
|
},
|
|
2248
|
-
sub.name
|
|
2323
|
+
text_node(sub.name)
|
|
2249
2324
|
]);
|
|
2250
2325
|
children.push([
|
|
2251
2326
|
"span",
|
|
@@ -2433,6 +2508,7 @@ function push_overlay_history(gobj, close, opts) {
|
|
|
2433
2508
|
}
|
|
2434
2509
|
function push_overlay_marker(gobj, entry) {
|
|
2435
2510
|
let priv = gobj.priv;
|
|
2511
|
+
entry.below_hash = window.location.hash;
|
|
2436
2512
|
try {
|
|
2437
2513
|
window.history.pushState({ __yui_overlay__: entry.id }, "");
|
|
2438
2514
|
} catch (e) {
|
|
@@ -2443,6 +2519,13 @@ function push_overlay_marker(gobj, entry) {
|
|
|
2443
2519
|
}
|
|
2444
2520
|
return true;
|
|
2445
2521
|
}
|
|
2522
|
+
function drop_expected_pops(gobj) {
|
|
2523
|
+
let priv = gobj.priv;
|
|
2524
|
+
if (!priv || priv.expected_pops === 0) return;
|
|
2525
|
+
(0, _yuneta_gobj_js.log_warning)(`C_YUI_SHELL: ${priv.expected_pops} history.back() of ours did not land on '${priv.expected_pop_hash}' (now '${window.location.hash}'), dropped`);
|
|
2526
|
+
priv.expected_pops = 0;
|
|
2527
|
+
priv.expected_pop_hash = "";
|
|
2528
|
+
}
|
|
2446
2529
|
function push_pending_markers(gobj) {
|
|
2447
2530
|
let priv = gobj.priv;
|
|
2448
2531
|
let pending = priv.pending_markers.splice(0);
|
|
@@ -2464,6 +2547,7 @@ function overlay_dismissed(gobj, entry) {
|
|
|
2464
2547
|
let st = window.history.state;
|
|
2465
2548
|
if (st && st.__yui_overlay__ === entry.id) {
|
|
2466
2549
|
priv.expected_pops++;
|
|
2550
|
+
priv.expected_pop_hash = typeof entry.below_hash === "string" ? entry.below_hash : window.location.hash;
|
|
2467
2551
|
try {
|
|
2468
2552
|
window.history.back();
|
|
2469
2553
|
} catch (e) {
|
|
@@ -3056,45 +3140,6 @@ function yui_shell_close_dropdown(shell_gobj) {
|
|
|
3056
3140
|
close_toolbar_dropdown(shell_gobj);
|
|
3057
3141
|
}
|
|
3058
3142
|
//#endregion
|
|
3059
|
-
//#region src/yui_text.js
|
|
3060
|
-
/***********************************************************************
|
|
3061
|
-
* yui_text.js
|
|
3062
|
-
*
|
|
3063
|
-
* DATA as text for createElement2().
|
|
3064
|
-
*
|
|
3065
|
-
* createElement2() takes a string content that starts with '<' for
|
|
3066
|
-
* MARKUP and parses it (that is how a component passes an inline
|
|
3067
|
-
* icon). So a value that came from outside -- a backend answer, a
|
|
3068
|
-
* treedb node, a name somebody typed, a frame of the traffic -- must
|
|
3069
|
-
* never go in as a bare string: "<img src=x onerror=...>" would run.
|
|
3070
|
-
* It goes in as a Text node, which is always text.
|
|
3071
|
-
*
|
|
3072
|
-
* Trimmed like createElement2() trims a string, so the change of
|
|
3073
|
-
* form does not change what is shown. A Text node under an
|
|
3074
|
-
* `i18n`/`data-i18n` element is still re-translated by
|
|
3075
|
-
* refresh_language(), which sets textContent.
|
|
3076
|
-
*
|
|
3077
|
-
* Copyright (c) 2026, ArtGins.
|
|
3078
|
-
* All Rights Reserved.
|
|
3079
|
-
***********************************************************************/
|
|
3080
|
-
/************************************************************
|
|
3081
|
-
* A Text node with `value` as its text ("" for null/undefined).
|
|
3082
|
-
************************************************************/
|
|
3083
|
-
function text_node(value) {
|
|
3084
|
-
if (value === null || value === void 0) return document.createTextNode("");
|
|
3085
|
-
return document.createTextNode(String(value).trim());
|
|
3086
|
-
}
|
|
3087
|
-
/************************************************************
|
|
3088
|
-
* A Tabulator `titleFormatter` that shows the column title as text.
|
|
3089
|
-
*
|
|
3090
|
-
* Tabulator puts a STRING title in with innerHTML, so a title taken
|
|
3091
|
-
* from a schema (`header`, which the schema editor writes) is markup
|
|
3092
|
-
* unless the column carries a formatter that returns a Node.
|
|
3093
|
-
************************************************************/
|
|
3094
|
-
function text_title_formatter(cell) {
|
|
3095
|
-
return text_node(cell.getValue());
|
|
3096
|
-
}
|
|
3097
|
-
//#endregion
|
|
3098
3143
|
//#region src/shell_modals.js
|
|
3099
3144
|
/***********************************************************************
|
|
3100
3145
|
* shell_modals.js
|
|
@@ -3860,7 +3905,7 @@ function build_default_header(gobj) {
|
|
|
3860
3905
|
if (icon.charAt(0) === "<") items.push([
|
|
3861
3906
|
"span",
|
|
3862
3907
|
{ class: "icon" },
|
|
3863
|
-
icon
|
|
3908
|
+
(0, _yuneta_gobj_js.html_markup)(icon)
|
|
3864
3909
|
]);
|
|
3865
3910
|
else items.push([
|
|
3866
3911
|
"span",
|
|
@@ -4865,7 +4910,7 @@ function chip_lead(icon) {
|
|
|
4865
4910
|
if (icon.charAt(0) === "<") return [
|
|
4866
4911
|
"span",
|
|
4867
4912
|
{ class: "yui-dock-icon" },
|
|
4868
|
-
icon
|
|
4913
|
+
(0, _yuneta_gobj_js.html_markup)(icon)
|
|
4869
4914
|
];
|
|
4870
4915
|
return [
|
|
4871
4916
|
"span",
|
|
@@ -4874,9 +4919,6 @@ function chip_lead(icon) {
|
|
|
4874
4919
|
];
|
|
4875
4920
|
}
|
|
4876
4921
|
/************************************************************
|
|
4877
|
-
* Find a registry entry by its window gobj.
|
|
4878
|
-
************************************************************/
|
|
4879
|
-
/************************************************************
|
|
4880
4922
|
* The window an event is about. A kw is plain json (the machine
|
|
4881
4923
|
* trace dumps it), so the window travels in it as its FULL NAME,
|
|
4882
4924
|
* which the trace can print, and the gobj is the event's src --
|
|
@@ -4891,6 +4933,10 @@ function window_of(gobj, event, kw, src) {
|
|
|
4891
4933
|
warned_gobj_in_kw = true;
|
|
4892
4934
|
(0, _yuneta_gobj_js.log_warning)(`${(0, _yuneta_gobj_js.gobj_short_name)(gobj)}: ${event} carries the window gobj in its kw: send {window: gobj_full_name(window)} from the window`);
|
|
4893
4935
|
}
|
|
4936
|
+
if (w !== src) {
|
|
4937
|
+
(0, _yuneta_gobj_js.log_error)(`${(0, _yuneta_gobj_js.gobj_short_name)(gobj)}: ${event}: window '${(0, _yuneta_gobj_js.gobj_full_name)(w)}' is not the src of the event (${(0, _yuneta_gobj_js.is_gobj)(src) ? (0, _yuneta_gobj_js.gobj_full_name)(src) : String(src)})`);
|
|
4938
|
+
return null;
|
|
4939
|
+
}
|
|
4894
4940
|
return w;
|
|
4895
4941
|
}
|
|
4896
4942
|
if (!(0, _yuneta_gobj_js.is_gobj)(src) || (0, _yuneta_gobj_js.gobj_full_name)(src) !== w) {
|
|
@@ -4899,6 +4945,9 @@ function window_of(gobj, event, kw, src) {
|
|
|
4899
4945
|
}
|
|
4900
4946
|
return src;
|
|
4901
4947
|
}
|
|
4948
|
+
/************************************************************
|
|
4949
|
+
* Find a registry entry by its window gobj.
|
|
4950
|
+
************************************************************/
|
|
4902
4951
|
function find_entry(priv, win) {
|
|
4903
4952
|
for (let e of priv.windows) if (e.gobj === win) return e;
|
|
4904
4953
|
return null;
|
|
@@ -10054,7 +10103,7 @@ function template2columns(gobj, columns, template, sub_elements) {
|
|
|
10054
10103
|
break;
|
|
10055
10104
|
case "enum":
|
|
10056
10105
|
column.editor = "list";
|
|
10057
|
-
column.editorParams = {};
|
|
10106
|
+
column.editorParams = { itemFormatter: text_list_item_formatter };
|
|
10058
10107
|
switch (field_desc.real_type) {
|
|
10059
10108
|
case "string":
|
|
10060
10109
|
case "object":
|
|
@@ -15955,7 +16004,7 @@ function push_collapsed_row(ctx, value, segments, depth, key, rows) {
|
|
|
15955
16004
|
else if (err) children.push([
|
|
15956
16005
|
"span",
|
|
15957
16006
|
{ class: "JSON_STUB_ERR has-text-danger is-size-7 ml-2" },
|
|
15958
|
-
|
|
16007
|
+
text_node(err.error)
|
|
15959
16008
|
]);
|
|
15960
16009
|
let attrs = {
|
|
15961
16010
|
class: "JSON_ROW JSON_COLLAPSED" + (is_pending ? " is-pending" : ""),
|
|
@@ -18940,7 +18989,7 @@ function render_raw(gobj) {
|
|
|
18940
18989
|
if (dump.error) children.push([
|
|
18941
18990
|
"div",
|
|
18942
18991
|
{ class: "GCLASS_RAW_ERROR has-text-danger is-size-7 p-2" },
|
|
18943
|
-
dump.error
|
|
18992
|
+
text_node(dump.error)
|
|
18944
18993
|
]);
|
|
18945
18994
|
let $body = (0, _yuneta_gobj_js.createElement2)([
|
|
18946
18995
|
"div",
|
|
@@ -19023,7 +19072,7 @@ function build_head(gobj, model) {
|
|
|
19023
19072
|
let items = [[
|
|
19024
19073
|
"span",
|
|
19025
19074
|
{ class: "GCLASS_NAME" },
|
|
19026
|
-
model.id || (0, _yuneta_gobj_js.gobj_read_str_attr)(gobj, "gclass_name") || "?"
|
|
19075
|
+
text_node(model.id || (0, _yuneta_gobj_js.gobj_read_str_attr)(gobj, "gclass_name") || "?")
|
|
19027
19076
|
]];
|
|
19028
19077
|
if (model.instances !== null) items.push([
|
|
19029
19078
|
"span",
|
|
@@ -19054,7 +19103,7 @@ function build_head(gobj, model) {
|
|
|
19054
19103
|
title: (0, i18next.t)("current state"),
|
|
19055
19104
|
"data-i18n-title": "current state"
|
|
19056
19105
|
},
|
|
19057
|
-
current
|
|
19106
|
+
text_node(current)
|
|
19058
19107
|
]);
|
|
19059
19108
|
return [
|
|
19060
19109
|
"div",
|
|
@@ -19397,7 +19446,7 @@ function build_methods(model) {
|
|
|
19397
19446
|
model.methods.map((m) => [
|
|
19398
19447
|
"span",
|
|
19399
19448
|
row_attrs(m, { class: "GCLASS_CHIP GCLASS_METHOD" }),
|
|
19400
|
-
m
|
|
19449
|
+
text_node(m)
|
|
19401
19450
|
])
|
|
19402
19451
|
]);
|
|
19403
19452
|
if (model.internal_methods.length) {
|
|
@@ -19415,7 +19464,7 @@ function build_methods(model) {
|
|
|
19415
19464
|
model.internal_methods.map((m) => [
|
|
19416
19465
|
"span",
|
|
19417
19466
|
row_attrs(m, { class: "GCLASS_CHIP GCLASS_METHOD" }),
|
|
19418
|
-
m
|
|
19467
|
+
text_node(m)
|
|
19419
19468
|
])
|
|
19420
19469
|
]);
|
|
19421
19470
|
}
|
|
@@ -29195,7 +29244,10 @@ function create_tabulator(gobj) {
|
|
|
29195
29244
|
break;
|
|
29196
29245
|
case "enum":
|
|
29197
29246
|
colDef.editor = "list";
|
|
29198
|
-
colDef.editorParams = {
|
|
29247
|
+
colDef.editorParams = {
|
|
29248
|
+
values: field_desc.enum_list || [],
|
|
29249
|
+
itemFormatter: text_list_item_formatter
|
|
29250
|
+
};
|
|
29199
29251
|
break;
|
|
29200
29252
|
case "integer":
|
|
29201
29253
|
case "real":
|
|
@@ -29239,7 +29291,8 @@ function create_tabulator(gobj) {
|
|
|
29239
29291
|
colDef.headerFilter = "list";
|
|
29240
29292
|
colDef.headerFilterParams = {
|
|
29241
29293
|
values: field_desc.enum_list || [],
|
|
29242
|
-
clearable: true
|
|
29294
|
+
clearable: true,
|
|
29295
|
+
itemFormatter: text_list_item_formatter
|
|
29243
29296
|
};
|
|
29244
29297
|
break;
|
|
29245
29298
|
case "fkey":
|
|
@@ -29649,7 +29702,7 @@ function icon_formatter(cell) {
|
|
|
29649
29702
|
class: "ICON_CELL_UNKNOWN is-size-7 yui-text-quiet",
|
|
29650
29703
|
title: name
|
|
29651
29704
|
},
|
|
29652
|
-
name
|
|
29705
|
+
text_node(name)
|
|
29653
29706
|
]);
|
|
29654
29707
|
return (0, _yuneta_gobj_js.createElement2)(["span", {
|
|
29655
29708
|
class: `ICON_CELL ${name}`,
|
|
@@ -60581,14 +60634,14 @@ var YuiToolbar = class extends _antv_g6.Toolbar {
|
|
|
60581
60634
|
async getDOMContent() {
|
|
60582
60635
|
return (await this.options.getItems()).map((item) => {
|
|
60583
60636
|
if (item.separator) return `<div class="g6-toolbar-sep" aria-hidden="true"></div>`;
|
|
60584
|
-
const extra_class = item.className ? ` ${item.className}` : "";
|
|
60585
|
-
const title = item.title ?? "";
|
|
60586
|
-
if (item.readout) return `<div class="g6-toolbar-readout${extra_class}" title="${title}" aria-label="${title}">${item.text ?? ""}</div>`;
|
|
60637
|
+
const extra_class = item.className ? ` ${(0, _yuneta_gobj_js.escapeHtml)(String(item.className))}` : "";
|
|
60638
|
+
const title = (0, _yuneta_gobj_js.escapeHtml)(String(item.title ?? ""));
|
|
60639
|
+
if (item.readout) return `<div class="g6-toolbar-readout${extra_class}" title="${title}" aria-label="${title}">${(0, _yuneta_gobj_js.escapeHtml)(String(item.text ?? ""))}</div>`;
|
|
60587
60640
|
const disabled = item.disabled ? " disabled" : "";
|
|
60588
60641
|
const is_text = item.text !== void 0;
|
|
60589
60642
|
const kind_class = is_text ? " g6-toolbar-item-text" : "";
|
|
60590
|
-
const body = is_text ? `<span class="g6-toolbar-text">${item.text}</span>` : `<svg aria-hidden="true" focusable="false"><use xlink:href="#${item.id}"></use></svg>`;
|
|
60591
|
-
return `<div class="g6-toolbar-item${kind_class}${extra_class}" value="${item.value}" title="${title}" aria-label="${title}"${disabled}>${body}</div>`;
|
|
60643
|
+
const body = is_text ? `<span class="g6-toolbar-text">${(0, _yuneta_gobj_js.escapeHtml)(String(item.text))}</span>` : `<svg aria-hidden="true" focusable="false"><use xlink:href="#${(0, _yuneta_gobj_js.escapeHtml)(String(item.id))}"></use></svg>`;
|
|
60644
|
+
return `<div class="g6-toolbar-item${kind_class}${extra_class}" value="${(0, _yuneta_gobj_js.escapeHtml)(String(item.value))}" title="${title}" aria-label="${title}"${disabled}>${body}</div>`;
|
|
60592
60645
|
}).join("");
|
|
60593
60646
|
}
|
|
60594
60647
|
};
|
|
@@ -61817,10 +61870,23 @@ function topic_defaults_of(gobj, topic_name) {
|
|
|
61817
61870
|
* It is written into a card's html (see yui_data_color.js): a
|
|
61818
61871
|
* refused value logs, and the node wears the topic's colour.
|
|
61819
61872
|
************************************************************/
|
|
61873
|
+
var refused_colors_logged = /* @__PURE__ */ new Set();
|
|
61874
|
+
var REFUSED_COLORS_LOG_MAX = 200;
|
|
61875
|
+
var refused_colors_capped = false;
|
|
61820
61876
|
function data_color(gobj, value) {
|
|
61821
61877
|
if (value === void 0 || value === null || value === "") return null;
|
|
61822
61878
|
let color = css_color_or_null(value);
|
|
61823
|
-
if (!color)
|
|
61879
|
+
if (!color) {
|
|
61880
|
+
let key = `${(0, _yuneta_gobj_js.gobj_short_name)(gobj)}\u0000${String(value)}`;
|
|
61881
|
+
if (refused_colors_logged.has(key)) return color;
|
|
61882
|
+
if (refused_colors_logged.size < REFUSED_COLORS_LOG_MAX) {
|
|
61883
|
+
refused_colors_logged.add(key);
|
|
61884
|
+
(0, _yuneta_gobj_js.log_warning)(`${(0, _yuneta_gobj_js.gobj_short_name)(gobj)}: colour refused, not a css colour: ${JSON.stringify(value)}`);
|
|
61885
|
+
} else if (!refused_colors_capped) {
|
|
61886
|
+
refused_colors_capped = true;
|
|
61887
|
+
(0, _yuneta_gobj_js.log_warning)(`${(0, _yuneta_gobj_js.gobj_short_name)(gobj)}: ${REFUSED_COLORS_LOG_MAX} refused colours logged; further refused colours are not logged`);
|
|
61888
|
+
}
|
|
61889
|
+
}
|
|
61824
61890
|
return color;
|
|
61825
61891
|
}
|
|
61826
61892
|
/************************************************************
|
|
@@ -66304,7 +66370,7 @@ function build_context_menu_items(gobj, e) {
|
|
|
66304
66370
|
************************************************************/
|
|
66305
66371
|
function ctx_item(icon_id, label, value) {
|
|
66306
66372
|
return {
|
|
66307
|
-
name: `<svg style="width:1em;height:1em;vertical-align:-0.125em;margin-right:8px;pointer-events:none;fill:currentColor"><use href="#${icon_id}"></use></svg>${label}`,
|
|
66373
|
+
name: `<svg style="width:1em;height:1em;vertical-align:-0.125em;margin-right:8px;pointer-events:none;fill:currentColor"><use href="#${icon_id}"></use></svg>${(0, _yuneta_gobj_js.escapeHtml)(String(label))}`,
|
|
66308
66374
|
value
|
|
66309
66375
|
};
|
|
66310
66376
|
}
|
|
@@ -70799,7 +70865,7 @@ function refresh_legend(gobj) {
|
|
|
70799
70865
|
class: "GRAPH_LEGEND_NAME",
|
|
70800
70866
|
style: (is_main ? LEGEND_MAIN_NAME_STYLE : LEGEND_NAME_STYLE) + (hidden ? " text-decoration:line-through; opacity:.6;" : "")
|
|
70801
70867
|
},
|
|
70802
|
-
topic_name
|
|
70868
|
+
text_node(topic_name)
|
|
70803
70869
|
], [
|
|
70804
70870
|
"span",
|
|
70805
70871
|
{
|
|
@@ -75767,7 +75833,7 @@ function select_input(name, value, options) {
|
|
|
75767
75833
|
value: `${option}`,
|
|
75768
75834
|
selected: `${option}` === `${value}` ? "selected" : void 0
|
|
75769
75835
|
}),
|
|
75770
|
-
`${option}`
|
|
75836
|
+
text_node(`${option}`)
|
|
75771
75837
|
];
|
|
75772
75838
|
});
|
|
75773
75839
|
return [
|
|
@@ -75789,7 +75855,7 @@ function textarea_input(name, value, rows, placeholder) {
|
|
|
75789
75855
|
rows: `${rows || 3}`,
|
|
75790
75856
|
placeholder: placeholder || ""
|
|
75791
75857
|
},
|
|
75792
|
-
value === void 0 || value === null ? "" : `${value}`
|
|
75858
|
+
text_node(value === void 0 || value === null ? "" : `${value}`)
|
|
75793
75859
|
];
|
|
75794
75860
|
}
|
|
75795
75861
|
/***************************************************************
|