@yuneta/gobj-ui 7.26.6 → 7.26.7
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 +74 -25
- package/dist/gobj-ui.cjs.js +635 -242
- package/dist/gobj-ui.es.js +635 -242
- package/index.js +5 -1
- package/package.json +2 -2
- package/src/c_g6_nodes_tree.js +41 -0
- package/src/c_yui_form.js +140 -83
- package/src/c_yui_gclass.js +6 -2
- package/src/c_yui_gobj_tree_js.js +15 -4
- package/src/c_yui_json_graph.js +40 -13
- package/src/c_yui_map.js +115 -75
- package/src/c_yui_nav.js +53 -14
- package/src/c_yui_pager.js +14 -9
- package/src/c_yui_period.js +16 -6
- package/src/c_yui_shell.js +89 -31
- package/src/c_yui_treedb_topic_with_form.js +33 -44
- package/src/c_yui_uplot.js +1 -1
- package/src/c_yui_window.js +70 -24
- package/src/c_yui_window_manager.js +7 -3
- package/src/c_yui_wizard.js +23 -8
- package/src/delete_impact.js +5 -3
- package/src/form_json_field.js +116 -0
- package/src/form_json_field.test.js +43 -0
- package/src/form_json_field.wiring.test.js +137 -0
- package/src/schema_to_c.js +17 -1
- package/src/schema_to_c.test.js +7 -0
- package/src/shell_route_map.js +6 -0
- package/src/treedb_topics_transport.wiring.test.js +9 -1
- package/src/window_veto_back.wiring.test.js +101 -0
- package/src/wizard_chrome.wiring.test.js +87 -0
- package/src/yui_dev.js +10 -3
- package/src/yui_table_filter_clear.js +44 -44
- package/vite-plugin-yuneta-html.js +28 -6
package/dist/gobj-ui.cjs.js
CHANGED
|
@@ -1049,6 +1049,7 @@ function mt_stop$20(gobj) {
|
|
|
1049
1049
|
st.items = {};
|
|
1050
1050
|
st.active_route = null;
|
|
1051
1051
|
}
|
|
1052
|
+
(0, _yuneta_gobj_js.gobj_stop_children)(gobj);
|
|
1052
1053
|
}
|
|
1053
1054
|
/***************************************************************
|
|
1054
1055
|
* Framework Method: Destroy
|
|
@@ -1841,7 +1842,7 @@ function build_toolbar_action_item(gobj, it) {
|
|
|
1841
1842
|
btn_attrs["aria-haspopup"] = "menu";
|
|
1842
1843
|
btn_attrs["aria-expanded"] = "false";
|
|
1843
1844
|
}
|
|
1844
|
-
let tip = it.tooltip ||
|
|
1845
|
+
let tip = it.tooltip || i18n_aria;
|
|
1845
1846
|
if (tip) {
|
|
1846
1847
|
btn_attrs.title = tip;
|
|
1847
1848
|
btn_attrs["data-i18n-title"] = tip;
|
|
@@ -1894,6 +1895,11 @@ function build_toolbar_brand_item(gobj, it) {
|
|
|
1894
1895
|
Object.assign(attrs, link);
|
|
1895
1896
|
} else if (action_type === "") tag = "div";
|
|
1896
1897
|
else attrs.type = "button";
|
|
1898
|
+
let tip = it.tooltip || i18n_aria;
|
|
1899
|
+
if (tag !== "div" && tip) {
|
|
1900
|
+
attrs.title = tip;
|
|
1901
|
+
attrs["data-i18n-title"] = tip;
|
|
1902
|
+
}
|
|
1897
1903
|
let $item = (0, _yuneta_gobj_js.createElement2)([
|
|
1898
1904
|
tag,
|
|
1899
1905
|
attrs,
|
|
@@ -1938,7 +1944,7 @@ function build_toolbar_avatar_item(gobj, it) {
|
|
|
1938
1944
|
attrs["aria-haspopup"] = "menu";
|
|
1939
1945
|
attrs["aria-expanded"] = "false";
|
|
1940
1946
|
}
|
|
1941
|
-
let tip = it.tooltip ||
|
|
1947
|
+
let tip = it.tooltip || i18n_aria;
|
|
1942
1948
|
if (tip) {
|
|
1943
1949
|
attrs.title = tip;
|
|
1944
1950
|
attrs["data-i18n-title"] = tip;
|
|
@@ -2010,7 +2016,7 @@ function build_toolbar_connection_item(gobj, it) {
|
|
|
2010
2016
|
"aria-label": aria_key,
|
|
2011
2017
|
"data-i18n-aria-label": i18n_aria
|
|
2012
2018
|
};
|
|
2013
|
-
let tip = it.tooltip ||
|
|
2019
|
+
let tip = it.tooltip || i18n_aria;
|
|
2014
2020
|
if (tip) {
|
|
2015
2021
|
attrs.title = tip;
|
|
2016
2022
|
attrs["data-i18n-title"] = tip;
|
|
@@ -2143,6 +2149,11 @@ function open_toolbar_dropdown(gobj, item, action, $trigger) {
|
|
|
2143
2149
|
$panel.style.right = "auto";
|
|
2144
2150
|
$panel.style.left = `${Math.round(left)}px`;
|
|
2145
2151
|
}
|
|
2152
|
+
let max_h = window.innerHeight - Math.max(0, pos.top) - margin;
|
|
2153
|
+
if (max_h > 0) {
|
|
2154
|
+
$panel.style.maxHeight = `${Math.round(max_h)}px`;
|
|
2155
|
+
$panel.style.overflowY = "auto";
|
|
2156
|
+
}
|
|
2146
2157
|
yui_shell_translate(gobj, $panel);
|
|
2147
2158
|
let backdrop = (ev) => {
|
|
2148
2159
|
if ($panel.contains(ev.target)) return;
|
|
@@ -2150,7 +2161,10 @@ function open_toolbar_dropdown(gobj, item, action, $trigger) {
|
|
|
2150
2161
|
close_toolbar_dropdown(gobj);
|
|
2151
2162
|
};
|
|
2152
2163
|
document.addEventListener("mousedown", backdrop, true);
|
|
2153
|
-
let dismiss = () =>
|
|
2164
|
+
let dismiss = (ev) => {
|
|
2165
|
+
if (ev && ev.type === "scroll" && ev.target && ev.target !== document && $panel.contains(ev.target)) return;
|
|
2166
|
+
close_toolbar_dropdown(gobj);
|
|
2167
|
+
};
|
|
2154
2168
|
document.addEventListener("scroll", dismiss, {
|
|
2155
2169
|
capture: true,
|
|
2156
2170
|
passive: true
|
|
@@ -2249,7 +2263,11 @@ function build_dropdown_row(gobj, sub, idx) {
|
|
|
2249
2263
|
"data-dropdown-item-id": sub.id || "",
|
|
2250
2264
|
"aria-label": aria_key
|
|
2251
2265
|
};
|
|
2252
|
-
if (i18n_aria)
|
|
2266
|
+
if (i18n_aria) {
|
|
2267
|
+
attrs["data-i18n-aria-label"] = i18n_aria;
|
|
2268
|
+
attrs.title = i18n_aria;
|
|
2269
|
+
attrs["data-i18n-title"] = i18n_aria;
|
|
2270
|
+
}
|
|
2253
2271
|
let $btn = (0, _yuneta_gobj_js.createElement2)([
|
|
2254
2272
|
"button",
|
|
2255
2273
|
attrs,
|
|
@@ -2311,7 +2329,10 @@ function drawers(gobj, menu_id) {
|
|
|
2311
2329
|
************************************************************/
|
|
2312
2330
|
function push_escape(gobj, layer, handler) {
|
|
2313
2331
|
let priv = gobj.priv;
|
|
2314
|
-
if (!priv || !priv.escape_stack)
|
|
2332
|
+
if (!priv || !priv.escape_stack) {
|
|
2333
|
+
(0, _yuneta_gobj_js.log_warning)(`C_YUI_SHELL: push_escape('${layer}') on a shell that is gone: Escape will not close it`);
|
|
2334
|
+
return;
|
|
2335
|
+
}
|
|
2315
2336
|
priv.escape_stack.push({
|
|
2316
2337
|
layer,
|
|
2317
2338
|
handler
|
|
@@ -2367,9 +2388,10 @@ function pop_escape(gobj, handler) {
|
|
|
2367
2388
|
function drain_overlays(gobj) {
|
|
2368
2389
|
let priv = gobj.priv;
|
|
2369
2390
|
if (!priv || !priv.overlay_stack) return;
|
|
2391
|
+
let entries = priv.overlay_stack.splice(0);
|
|
2370
2392
|
let kept = [];
|
|
2371
|
-
while (
|
|
2372
|
-
let entry =
|
|
2393
|
+
while (entries.length > 0) {
|
|
2394
|
+
let entry = entries.pop();
|
|
2373
2395
|
if (entry.keep_on_navigate) {
|
|
2374
2396
|
kept.unshift(entry);
|
|
2375
2397
|
continue;
|
|
@@ -2380,7 +2402,7 @@ function drain_overlays(gobj) {
|
|
|
2380
2402
|
(0, _yuneta_gobj_js.log_warning)(`C_YUI_SHELL: overlay close on navigation failed: ${e}`);
|
|
2381
2403
|
}
|
|
2382
2404
|
}
|
|
2383
|
-
|
|
2405
|
+
priv.overlay_stack.unshift(...kept);
|
|
2384
2406
|
}
|
|
2385
2407
|
function retag_overlay_hash(gobj, st, hash) {
|
|
2386
2408
|
let priv = gobj.priv;
|
|
@@ -2519,7 +2541,10 @@ function update_secondary_nav_visibility(gobj, entry) {
|
|
|
2519
2541
|
************************************************************/
|
|
2520
2542
|
function ac_nav_clicked(gobj, event, kw, src) {
|
|
2521
2543
|
let route = kw && kw.route || "";
|
|
2522
|
-
if ((0, _yuneta_gobj_js.empty_string)(route))
|
|
2544
|
+
if ((0, _yuneta_gobj_js.empty_string)(route)) {
|
|
2545
|
+
(0, _yuneta_gobj_js.log_warning)(`C_YUI_SHELL: ${event} with no route, from ${(0, _yuneta_gobj_js.gobj_short_name)(src)}`);
|
|
2546
|
+
return -1;
|
|
2547
|
+
}
|
|
2523
2548
|
route = remembered_position(gobj, route);
|
|
2524
2549
|
if ((0, _yuneta_gobj_js.gobj_read_attr)(gobj, "use_hash") && !route_restores_url(gobj, route)) {
|
|
2525
2550
|
let target_hash = route_to_hash(route);
|
|
@@ -2557,17 +2582,19 @@ function ac_nav_item_close(gobj, event, kw, src) {
|
|
|
2557
2582
|
* FSM
|
|
2558
2583
|
***************************************************************/
|
|
2559
2584
|
/***************************************************************
|
|
2560
|
-
* EV_CONNECTION_STATE
|
|
2561
|
-
*
|
|
2562
|
-
* to EVERY event of its shell with one attr
|
|
2563
|
-
* ask for
|
|
2564
|
-
*
|
|
2565
|
-
* and adding
|
|
2566
|
-
*
|
|
2567
|
-
*
|
|
2585
|
+
* EV_CONNECTION_STATE and EV_ICONS_CHANGED are OPTIONAL facts: a
|
|
2586
|
+
* view that needs one subscribes to it by name. An app that
|
|
2587
|
+
* subscribed to EVERY event of its shell with one attr
|
|
2588
|
+
* (`subscriber`) did not ask for them and does not declare them --
|
|
2589
|
+
* published to it anyway, each would be an FSM error in the app
|
|
2590
|
+
* every time it fires, and adding one to the shell a breaking
|
|
2591
|
+
* change for every such app (7.26.6 did exactly that with
|
|
2592
|
+
* EV_ICONS_CHANGED). So they reach only the subscribers that
|
|
2593
|
+
* declare them. Every other event of the shell goes out as before.
|
|
2568
2594
|
***************************************************************/
|
|
2595
|
+
var OPTIONAL_EVENTS = /* @__PURE__ */ new Set(["EV_CONNECTION_STATE", "EV_ICONS_CHANGED"]);
|
|
2569
2596
|
function mt_publication_pre_filter(gobj, subs, event, kw) {
|
|
2570
|
-
if (event
|
|
2597
|
+
if (!OPTIONAL_EVENTS.has(event)) return 1;
|
|
2571
2598
|
let subscriber = subs && subs.subscriber;
|
|
2572
2599
|
if (!subscriber || !(0, _yuneta_gobj_js.gobj_has_event)(subscriber, event, 0)) return 0;
|
|
2573
2600
|
return 1;
|
|
@@ -2899,7 +2926,7 @@ function yui_shell_set_translator(shell_gobj, t) {
|
|
|
2899
2926
|
*
|
|
2900
2927
|
* The division of labour, unchanged: LIBRARY-built DOM is
|
|
2901
2928
|
* translated through here; APP view gclasses translate their own
|
|
2902
|
-
* DOM (they own a `t` — see
|
|
2929
|
+
* DOM (they own a `t` — see build_view_gobj).
|
|
2903
2930
|
*
|
|
2904
2931
|
* Silent no-op with no shell or no translator: an app that never
|
|
2905
2932
|
* registered one keeps the previous behaviour instead of losing
|
|
@@ -3576,7 +3603,7 @@ function yui_shell_confirm_yesnocancel(shell, message, opts) {
|
|
|
3576
3603
|
*
|
|
3577
3604
|
* Window - position fixed
|
|
3578
3605
|
*
|
|
3579
|
-
* Copyright (c) 2025, ArtGins.
|
|
3606
|
+
* Copyright (c) 2025-2026, ArtGins.
|
|
3580
3607
|
* All Rights Reserved.
|
|
3581
3608
|
***********************************************************************/
|
|
3582
3609
|
/***************************************************************
|
|
@@ -3659,15 +3686,7 @@ function mt_create$21(gobj) {
|
|
|
3659
3686
|
title_prefix: (0, _yuneta_gobj_js.gobj_read_str_attr)(gobj, "title_prefix") || "",
|
|
3660
3687
|
icon: (0, _yuneta_gobj_js.gobj_read_attr)(gobj, "icon") || ""
|
|
3661
3688
|
}, gobj);
|
|
3662
|
-
} else if ((0, _yuneta_gobj_js.gobj_read_bool_attr)(gobj, "back_dismissable"))
|
|
3663
|
-
let shell = yui_shell_of(gobj);
|
|
3664
|
-
if (shell) {
|
|
3665
|
-
let overlay = yui_shell_register_overlay(shell, function() {
|
|
3666
|
-
close_window(gobj);
|
|
3667
|
-
}, { keep_on_navigate: (0, _yuneta_gobj_js.gobj_read_bool_attr)(gobj, "keep_on_navigate") });
|
|
3668
|
-
(0, _yuneta_gobj_js.gobj_write_attr)(gobj, "back_overlay", overlay);
|
|
3669
|
-
}
|
|
3670
|
-
}
|
|
3689
|
+
} else if ((0, _yuneta_gobj_js.gobj_read_bool_attr)(gobj, "back_dismissable")) register_back_overlay(gobj);
|
|
3671
3690
|
let on_win_resize = function() {
|
|
3672
3691
|
handleResize(gobj);
|
|
3673
3692
|
};
|
|
@@ -3787,7 +3806,7 @@ function build_default_header(gobj) {
|
|
|
3787
3806
|
if (!(0, _yuneta_gobj_js.empty_string)(prefix)) items.push([
|
|
3788
3807
|
"span",
|
|
3789
3808
|
{ class: "WINDOW_TITLE_PREFIX has-text-weight-semibold" },
|
|
3790
|
-
prefix
|
|
3809
|
+
document.createTextNode(String(prefix))
|
|
3791
3810
|
]);
|
|
3792
3811
|
if (!(0, _yuneta_gobj_js.empty_string)(title)) items.push([
|
|
3793
3812
|
"span",
|
|
@@ -3830,7 +3849,9 @@ function resolve_manager(gobj) {
|
|
|
3830
3849
|
let m = (0, _yuneta_gobj_js.gobj_read_pointer_attr)(gobj, "manager");
|
|
3831
3850
|
if (!m) return null;
|
|
3832
3851
|
if (typeof m === "string") {
|
|
3833
|
-
|
|
3852
|
+
let name = m;
|
|
3853
|
+
m = (0, _yuneta_gobj_js.gobj_find_service)(name, false) || null;
|
|
3854
|
+
if (!m) (0, _yuneta_gobj_js.log_warning)(`${GCLASS_NAME$21}: window manager '${name}' not found: no dock, no minimize`);
|
|
3834
3855
|
(0, _yuneta_gobj_js.gobj_write_attr)(gobj, "manager", m);
|
|
3835
3856
|
}
|
|
3836
3857
|
return m;
|
|
@@ -3940,6 +3961,8 @@ function build_ui$18(gobj) {
|
|
|
3940
3961
|
{
|
|
3941
3962
|
class: "WINDOW_MIN yui-wc wc-min",
|
|
3942
3963
|
type: "button",
|
|
3964
|
+
title: (0, i18next.t)("minimize"),
|
|
3965
|
+
"data-i18n-title": "minimize",
|
|
3943
3966
|
"aria-label": (0, i18next.t)("minimize"),
|
|
3944
3967
|
"data-i18n-aria-label": "minimize",
|
|
3945
3968
|
style: (0, _yuneta_gobj_js.gobj_read_bool_attr)(gobj, "showMin") && (0, _yuneta_gobj_js.gobj_read_pointer_attr)(gobj, "manager") ? "" : "display:none;"
|
|
@@ -3955,6 +3978,8 @@ function build_ui$18(gobj) {
|
|
|
3955
3978
|
{
|
|
3956
3979
|
class: "WINDOW_MAX yui-wc wc-max",
|
|
3957
3980
|
type: "button",
|
|
3981
|
+
title: (0, i18next.t)("maximize"),
|
|
3982
|
+
"data-i18n-title": "maximize",
|
|
3958
3983
|
"aria-label": (0, i18next.t)("maximize"),
|
|
3959
3984
|
"data-i18n-aria-label": "maximize",
|
|
3960
3985
|
style: (0, _yuneta_gobj_js.gobj_read_bool_attr)(gobj, "showMax") ? "" : "display:none;"
|
|
@@ -3970,13 +3995,15 @@ function build_ui$18(gobj) {
|
|
|
3970
3995
|
{
|
|
3971
3996
|
class: "WINDOW_CLOSE yui-wc wc-close",
|
|
3972
3997
|
type: "button",
|
|
3998
|
+
title: (0, i18next.t)("close"),
|
|
3999
|
+
"data-i18n-title": "close",
|
|
3973
4000
|
"aria-label": (0, i18next.t)("close"),
|
|
3974
4001
|
"data-i18n-aria-label": "close"
|
|
3975
4002
|
},
|
|
3976
4003
|
WC_CLOSE,
|
|
3977
4004
|
{ click: (evt) => {
|
|
3978
4005
|
evt.stopPropagation();
|
|
3979
|
-
|
|
4006
|
+
(0, _yuneta_gobj_js.gobj_send_event)(gobj, "EV_CLOSE_WINDOW", {}, gobj);
|
|
3980
4007
|
} }
|
|
3981
4008
|
]
|
|
3982
4009
|
]
|
|
@@ -4112,6 +4139,27 @@ function destroy_ui$13(gobj) {
|
|
|
4112
4139
|
}
|
|
4113
4140
|
}
|
|
4114
4141
|
/************************************************************
|
|
4142
|
+
* Register this floating window in the shell's overlay history,
|
|
4143
|
+
* so the browser Back closes it.
|
|
4144
|
+
*
|
|
4145
|
+
* The shell takes the entry off its stack BEFORE it calls the
|
|
4146
|
+
* close function (Back, or a route change draining overlays). When
|
|
4147
|
+
* a subscriber of EV_WINDOW_TO_CLOSE vetoes the close, the window
|
|
4148
|
+
* stays up with no entry: Back would no longer close it, and it
|
|
4149
|
+
* would float over the next views. So a window that survives its
|
|
4150
|
+
* own close function registers again.
|
|
4151
|
+
************************************************************/
|
|
4152
|
+
function register_back_overlay(gobj) {
|
|
4153
|
+
let shell = yui_shell_of(gobj);
|
|
4154
|
+
if (!shell) return;
|
|
4155
|
+
let overlay = yui_shell_register_overlay(shell, function() {
|
|
4156
|
+
(0, _yuneta_gobj_js.gobj_write_attr)(gobj, "back_overlay", null);
|
|
4157
|
+
close_window(gobj);
|
|
4158
|
+
if (!(0, _yuneta_gobj_js.gobj_is_destroying)(gobj) && !(0, _yuneta_gobj_js.gobj_read_attr)(gobj, "back_overlay")) register_back_overlay(gobj);
|
|
4159
|
+
}, { keep_on_navigate: (0, _yuneta_gobj_js.gobj_read_bool_attr)(gobj, "keep_on_navigate") });
|
|
4160
|
+
(0, _yuneta_gobj_js.gobj_write_attr)(gobj, "back_overlay", overlay);
|
|
4161
|
+
}
|
|
4162
|
+
/************************************************************
|
|
4115
4163
|
*
|
|
4116
4164
|
************************************************************/
|
|
4117
4165
|
function close_window(gobj) {
|
|
@@ -4129,12 +4177,12 @@ function close_window(gobj) {
|
|
|
4129
4177
|
no_label: "no",
|
|
4130
4178
|
cancel_label: "cancel"
|
|
4131
4179
|
}).then(function(answer) {
|
|
4132
|
-
if (answer
|
|
4133
|
-
|
|
4134
|
-
|
|
4135
|
-
|
|
4136
|
-
|
|
4137
|
-
|
|
4180
|
+
if (answer !== "yes") return;
|
|
4181
|
+
if ((0, _yuneta_gobj_js.gobj_is_destroying)(gobj)) return;
|
|
4182
|
+
if (on_close) on_close();
|
|
4183
|
+
if ((0, _yuneta_gobj_js.gobj_is_running)(gobj)) (0, _yuneta_gobj_js.gobj_stop)(gobj);
|
|
4184
|
+
(0, _yuneta_gobj_js.gobj_stop_children)(gobj);
|
|
4185
|
+
(0, _yuneta_gobj_js.gobj_destroy)(gobj);
|
|
4138
4186
|
});
|
|
4139
4187
|
}
|
|
4140
4188
|
/************************************************************
|
|
@@ -4169,8 +4217,12 @@ function set_max_icon(gobj, maximized) {
|
|
|
4169
4217
|
if (!$container) return;
|
|
4170
4218
|
let $btn = $container.querySelector(".wc-max");
|
|
4171
4219
|
if ($btn) {
|
|
4220
|
+
let key = maximized ? "restore" : "maximize";
|
|
4172
4221
|
$btn.innerHTML = maximized ? WC_RESTORE : WC_MAX;
|
|
4173
|
-
$btn.setAttribute("
|
|
4222
|
+
$btn.setAttribute("title", (0, i18next.t)(key));
|
|
4223
|
+
$btn.setAttribute("data-i18n-title", key);
|
|
4224
|
+
$btn.setAttribute("aria-label", (0, i18next.t)(key));
|
|
4225
|
+
$btn.setAttribute("data-i18n-aria-label", key);
|
|
4174
4226
|
}
|
|
4175
4227
|
}
|
|
4176
4228
|
/************************************************************
|
|
@@ -4813,7 +4865,7 @@ function ac_register_window(gobj, event, kw, src) {
|
|
|
4813
4865
|
if (prefix) label_items.push([
|
|
4814
4866
|
"span",
|
|
4815
4867
|
{ class: "yui-dock-label-prefix" },
|
|
4816
|
-
prefix
|
|
4868
|
+
document.createTextNode(String(prefix))
|
|
4817
4869
|
]);
|
|
4818
4870
|
if (title_key) label_items.push([
|
|
4819
4871
|
"span",
|
|
@@ -4826,7 +4878,7 @@ function ac_register_window(gobj, event, kw, src) {
|
|
|
4826
4878
|
if (label_items.length === 0) label_items.push([
|
|
4827
4879
|
"span",
|
|
4828
4880
|
{ class: "yui-dock-label-kind" },
|
|
4829
|
-
title
|
|
4881
|
+
document.createTextNode(String(title))
|
|
4830
4882
|
]);
|
|
4831
4883
|
let entry = {
|
|
4832
4884
|
gobj: win,
|
|
@@ -4853,6 +4905,8 @@ function ac_register_window(gobj, event, kw, src) {
|
|
|
4853
4905
|
{
|
|
4854
4906
|
class: "yui-dock-close",
|
|
4855
4907
|
type: "button",
|
|
4908
|
+
title: (0, i18next.t)("close"),
|
|
4909
|
+
"data-i18n-title": "close",
|
|
4856
4910
|
"aria-label": (0, i18next.t)("close"),
|
|
4857
4911
|
"data-i18n-aria-label": "close"
|
|
4858
4912
|
},
|
|
@@ -5117,6 +5171,8 @@ function build_ui$17(gobj) {
|
|
|
5117
5171
|
"button",
|
|
5118
5172
|
{
|
|
5119
5173
|
class: "yui-pager-back button is-white is-hidden",
|
|
5174
|
+
title: (0, i18next.t)("back"),
|
|
5175
|
+
"data-i18n-title": "back",
|
|
5120
5176
|
"aria-label": (0, i18next.t)("back"),
|
|
5121
5177
|
"data-i18n-aria-label": "back"
|
|
5122
5178
|
},
|
|
@@ -5142,6 +5198,8 @@ function build_ui$17(gobj) {
|
|
|
5142
5198
|
"button",
|
|
5143
5199
|
{
|
|
5144
5200
|
class: "yui-pager-discard button is-white is-hidden",
|
|
5201
|
+
title: (0, i18next.t)("discard"),
|
|
5202
|
+
"data-i18n-title": "discard",
|
|
5145
5203
|
"aria-label": (0, i18next.t)("discard"),
|
|
5146
5204
|
"data-i18n-aria-label": "discard"
|
|
5147
5205
|
},
|
|
@@ -5222,13 +5280,12 @@ function render_header(gobj) {
|
|
|
5222
5280
|
let $discard = $container.querySelector(".yui-pager-discard");
|
|
5223
5281
|
$back.classList.toggle("is-hidden", !model.show_back);
|
|
5224
5282
|
let $back_icon = $back.querySelector("i");
|
|
5225
|
-
|
|
5226
|
-
|
|
5227
|
-
|
|
5228
|
-
|
|
5229
|
-
|
|
5230
|
-
|
|
5231
|
-
}
|
|
5283
|
+
let back_key = model.back_kind === "close" ? "close" : "back";
|
|
5284
|
+
$back_icon.className = back_key === "close" ? "yi-xmark" : "yi-arrow-left";
|
|
5285
|
+
$back.setAttribute("title", (0, i18next.t)(back_key));
|
|
5286
|
+
$back.setAttribute("data-i18n-title", back_key);
|
|
5287
|
+
$back.setAttribute("aria-label", (0, i18next.t)(back_key));
|
|
5288
|
+
$back.setAttribute("data-i18n-aria-label", back_key);
|
|
5232
5289
|
$discard.classList.toggle("is-hidden", !model.show_discard);
|
|
5233
5290
|
$title.setAttribute("data-i18n", model.title);
|
|
5234
5291
|
$title.textContent = (0, i18next.t)(model.title);
|
|
@@ -5636,6 +5693,8 @@ function mt_destroy$18(gobj) {
|
|
|
5636
5693
|
* Build UI
|
|
5637
5694
|
************************************************************/
|
|
5638
5695
|
function build_ui$16(gobj) {
|
|
5696
|
+
let back_label = (0, _yuneta_gobj_js.gobj_read_attr)(gobj, "back_label");
|
|
5697
|
+
let next_label = (0, _yuneta_gobj_js.gobj_read_attr)(gobj, "next_label");
|
|
5639
5698
|
let $container = (0, _yuneta_gobj_js.createElement2)([
|
|
5640
5699
|
"div",
|
|
5641
5700
|
{
|
|
@@ -5683,8 +5742,10 @@ function build_ui$16(gobj) {
|
|
|
5683
5742
|
"button",
|
|
5684
5743
|
{
|
|
5685
5744
|
class: "yui-wizard-back button",
|
|
5686
|
-
|
|
5687
|
-
"data-i18n-
|
|
5745
|
+
title: (0, i18next.t)(back_label),
|
|
5746
|
+
"data-i18n-title": back_label,
|
|
5747
|
+
"aria-label": (0, i18next.t)(back_label),
|
|
5748
|
+
"data-i18n-aria-label": back_label
|
|
5688
5749
|
},
|
|
5689
5750
|
[[
|
|
5690
5751
|
"span",
|
|
@@ -5694,9 +5755,9 @@ function build_ui$16(gobj) {
|
|
|
5694
5755
|
"span",
|
|
5695
5756
|
{
|
|
5696
5757
|
class: "is-hidden-mobile",
|
|
5697
|
-
i18n:
|
|
5758
|
+
i18n: back_label
|
|
5698
5759
|
},
|
|
5699
|
-
|
|
5760
|
+
back_label
|
|
5700
5761
|
]],
|
|
5701
5762
|
{ click: function(evt) {
|
|
5702
5763
|
evt.stopPropagation();
|
|
@@ -5706,16 +5767,18 @@ function build_ui$16(gobj) {
|
|
|
5706
5767
|
"button",
|
|
5707
5768
|
{
|
|
5708
5769
|
class: "yui-wizard-primary button is-link",
|
|
5709
|
-
|
|
5710
|
-
"data-i18n-
|
|
5770
|
+
title: (0, i18next.t)(next_label),
|
|
5771
|
+
"data-i18n-title": next_label,
|
|
5772
|
+
"aria-label": (0, i18next.t)(next_label),
|
|
5773
|
+
"data-i18n-aria-label": next_label
|
|
5711
5774
|
},
|
|
5712
5775
|
[[
|
|
5713
5776
|
"span",
|
|
5714
5777
|
{
|
|
5715
5778
|
class: "yui-wizard-primary-label",
|
|
5716
|
-
i18n:
|
|
5779
|
+
i18n: next_label
|
|
5717
5780
|
},
|
|
5718
|
-
|
|
5781
|
+
next_label
|
|
5719
5782
|
]],
|
|
5720
5783
|
{ click: function(evt) {
|
|
5721
5784
|
evt.stopPropagation();
|
|
@@ -5774,14 +5837,19 @@ function render_chrome(gobj) {
|
|
|
5774
5837
|
let $title = $container.querySelector(".yui-wizard-title");
|
|
5775
5838
|
let $counter = $container.querySelector(".yui-wizard-counter");
|
|
5776
5839
|
let $back = $container.querySelector(".yui-wizard-back");
|
|
5840
|
+
let $primary = $container.querySelector(".yui-wizard-primary");
|
|
5777
5841
|
let $plabel = $container.querySelector(".yui-wizard-primary-label");
|
|
5778
|
-
$title.setAttribute("i18n", model.title);
|
|
5779
|
-
$title.textContent = model.title;
|
|
5842
|
+
$title.setAttribute("data-i18n", model.title);
|
|
5843
|
+
$title.textContent = (0, i18next.t)(model.title);
|
|
5780
5844
|
if (model.count > 0) $counter.textContent = `${model.idx + 1} / ${model.count}`;
|
|
5781
5845
|
else $counter.textContent = "";
|
|
5782
5846
|
$back.classList.toggle("is-hidden", !model.show_back);
|
|
5783
|
-
$plabel.setAttribute("i18n", model.primary_label);
|
|
5784
|
-
$plabel.textContent = model.primary_label;
|
|
5847
|
+
$plabel.setAttribute("data-i18n", model.primary_label);
|
|
5848
|
+
$plabel.textContent = (0, i18next.t)(model.primary_label);
|
|
5849
|
+
$primary.setAttribute("title", (0, i18next.t)(model.primary_label));
|
|
5850
|
+
$primary.setAttribute("data-i18n-title", model.primary_label);
|
|
5851
|
+
$primary.setAttribute("aria-label", (0, i18next.t)(model.primary_label));
|
|
5852
|
+
$primary.setAttribute("data-i18n-aria-label", model.primary_label);
|
|
5785
5853
|
for (let i = 0; i < priv.steps.length; i++) {
|
|
5786
5854
|
let s = priv.steps[i];
|
|
5787
5855
|
if (s.$el) s.$el.classList.toggle("is-hidden", i !== model.idx);
|
|
@@ -7995,6 +8063,107 @@ function datetime_local_to_epoch(value) {
|
|
|
7995
8063
|
return Math.floor(date.getTime() / 1e3);
|
|
7996
8064
|
}
|
|
7997
8065
|
//#endregion
|
|
8066
|
+
//#region src/form_json_field.js
|
|
8067
|
+
/***********************************************************************
|
|
8068
|
+
* form_json_field.js
|
|
8069
|
+
*
|
|
8070
|
+
* Pure logic of a json field of C_YUI_FORM: what a jsoneditor
|
|
8071
|
+
* holds, read as the value its column stores.
|
|
8072
|
+
*
|
|
8073
|
+
* The editor answers its content in one of two shapes -- {json}
|
|
8074
|
+
* (tree mode) or {text} (text mode, whatever the reader typed).
|
|
8075
|
+
* A text that does not parse used to be caught and replaced by
|
|
8076
|
+
* `{}` or `[]`, and SAVED: a trailing comma wiped the column, with
|
|
8077
|
+
* no log and no message. A text that is not json, or json of the
|
|
8078
|
+
* wrong shape (a list in a dict column), is an error now, and the
|
|
8079
|
+
* form refuses to save while a field holds one.
|
|
8080
|
+
*
|
|
8081
|
+
* Copyright (c) 2026, ArtGins.
|
|
8082
|
+
* All Rights Reserved.
|
|
8083
|
+
***********************************************************************/
|
|
8084
|
+
var SHAPE_OF_TYPE = {
|
|
8085
|
+
object: "dict",
|
|
8086
|
+
dict: "dict",
|
|
8087
|
+
template: "dict",
|
|
8088
|
+
array: "list",
|
|
8089
|
+
list: "list",
|
|
8090
|
+
table: "list",
|
|
8091
|
+
coordinates: "container"
|
|
8092
|
+
};
|
|
8093
|
+
/************************************************************
|
|
8094
|
+
* The shape `type` stores: "dict", "list", "container" or "any".
|
|
8095
|
+
************************************************************/
|
|
8096
|
+
function json_field_shape(type) {
|
|
8097
|
+
return SHAPE_OF_TYPE[type] || "any";
|
|
8098
|
+
}
|
|
8099
|
+
/************************************************************
|
|
8100
|
+
* The empty value of a shape: what a blank editor stores.
|
|
8101
|
+
************************************************************/
|
|
8102
|
+
function json_field_empty(shape) {
|
|
8103
|
+
if (shape === "list") return [];
|
|
8104
|
+
return {};
|
|
8105
|
+
}
|
|
8106
|
+
function value_fits(value, shape) {
|
|
8107
|
+
let is_list = Array.isArray(value);
|
|
8108
|
+
let is_dict = value !== null && typeof value === "object" && !is_list;
|
|
8109
|
+
switch (shape) {
|
|
8110
|
+
case "dict": return is_dict;
|
|
8111
|
+
case "list": return is_list;
|
|
8112
|
+
case "container": return is_dict || is_list;
|
|
8113
|
+
default: return true;
|
|
8114
|
+
}
|
|
8115
|
+
}
|
|
8116
|
+
/************************************************************
|
|
8117
|
+
* Parse what a json field holds.
|
|
8118
|
+
*
|
|
8119
|
+
* `value` is a json string (what the form reads out of an editor)
|
|
8120
|
+
* or an already parsed value; an editor's content goes through
|
|
8121
|
+
* json_editor_value() first.
|
|
8122
|
+
* Returns {value, error}: `error` is "" when the value is good, else
|
|
8123
|
+
* an i18n key; `value` is then the empty value of the shape and must
|
|
8124
|
+
* NOT be stored.
|
|
8125
|
+
*
|
|
8126
|
+
* A blank text is not an error: it is the empty value.
|
|
8127
|
+
************************************************************/
|
|
8128
|
+
function parse_json_field(value, type) {
|
|
8129
|
+
let shape = json_field_shape(type);
|
|
8130
|
+
if (typeof value === "string") {
|
|
8131
|
+
if (value.trim() === "") return {
|
|
8132
|
+
value: json_field_empty(shape),
|
|
8133
|
+
error: ""
|
|
8134
|
+
};
|
|
8135
|
+
try {
|
|
8136
|
+
value = JSON.parse(value);
|
|
8137
|
+
} catch (e) {
|
|
8138
|
+
return {
|
|
8139
|
+
value: json_field_empty(shape),
|
|
8140
|
+
error: "invalid json"
|
|
8141
|
+
};
|
|
8142
|
+
}
|
|
8143
|
+
}
|
|
8144
|
+
if (value === void 0) return {
|
|
8145
|
+
value: json_field_empty(shape),
|
|
8146
|
+
error: ""
|
|
8147
|
+
};
|
|
8148
|
+
if (!value_fits(value, shape)) return {
|
|
8149
|
+
value: json_field_empty(shape),
|
|
8150
|
+
error: "invalid json"
|
|
8151
|
+
};
|
|
8152
|
+
return {
|
|
8153
|
+
value,
|
|
8154
|
+
error: ""
|
|
8155
|
+
};
|
|
8156
|
+
}
|
|
8157
|
+
/************************************************************
|
|
8158
|
+
* What a jsoneditor content ({text} or {json}) holds: the
|
|
8159
|
+
* text as typed, or the tree-mode json.
|
|
8160
|
+
************************************************************/
|
|
8161
|
+
function json_editor_value(content) {
|
|
8162
|
+
if (!content) return;
|
|
8163
|
+
if (content.text !== void 0) return content.text;
|
|
8164
|
+
return content.json;
|
|
8165
|
+
}
|
|
8166
|
+
//#endregion
|
|
7998
8167
|
//#region src/c_yui_form.js
|
|
7999
8168
|
/***********************************************************************
|
|
8000
8169
|
* c_yui_form.js
|
|
@@ -8359,10 +8528,61 @@ function build_ui$15(gobj) {
|
|
|
8359
8528
|
function destroy_ui$10(gobj) {
|
|
8360
8529
|
let $container = (0, _yuneta_gobj_js.gobj_read_attr)(gobj, "$container");
|
|
8361
8530
|
if ($container) {
|
|
8531
|
+
destroy_widgets(gobj, $container);
|
|
8362
8532
|
if ($container.parentNode) $container.parentNode.removeChild($container);
|
|
8363
8533
|
(0, _yuneta_gobj_js.gobj_write_attr)(gobj, "$container", null);
|
|
8364
8534
|
}
|
|
8365
8535
|
}
|
|
8536
|
+
/************************************************************
|
|
8537
|
+
* The icon a table cell draws as its control (delete the row,
|
|
8538
|
+
* add a nested row): an element, so it carries its name. Drawn
|
|
8539
|
+
* by Tabulator on every render, so t() at render time is
|
|
8540
|
+
* current.
|
|
8541
|
+
************************************************************/
|
|
8542
|
+
function cell_icon(icon_class, key) {
|
|
8543
|
+
let $i = document.createElement("i");
|
|
8544
|
+
$i.className = icon_class;
|
|
8545
|
+
$i.setAttribute("title", (0, i18next.t)(key));
|
|
8546
|
+
$i.setAttribute("aria-label", (0, i18next.t)(key));
|
|
8547
|
+
return $i;
|
|
8548
|
+
}
|
|
8549
|
+
/************************************************************
|
|
8550
|
+
* Destroy the third-party widgets the form built. Removing
|
|
8551
|
+
* their DOM is not enough: Tom Select keeps listeners on
|
|
8552
|
+
* `document` and `window`, the jsoneditor is a live Svelte app
|
|
8553
|
+
* and a Tabulator keeps its observers -- each one a closure over
|
|
8554
|
+
* this form, alive for the life of the page. Nested tables go
|
|
8555
|
+
* first: their parent's destroy drops the rows they hang from.
|
|
8556
|
+
************************************************************/
|
|
8557
|
+
function destroy_widgets(gobj, $container) {
|
|
8558
|
+
let destroy = (what, widget) => {
|
|
8559
|
+
try {
|
|
8560
|
+
widget.destroy();
|
|
8561
|
+
} catch (e) {
|
|
8562
|
+
(0, _yuneta_gobj_js.log_warning)(`${(0, _yuneta_gobj_js.gobj_short_name)(gobj)}: cannot destroy ${what}: ${e}`);
|
|
8563
|
+
}
|
|
8564
|
+
};
|
|
8565
|
+
$container.querySelectorAll(".yui-tabulator-table-nested").forEach(($el) => {
|
|
8566
|
+
if ($el.tabulator) {
|
|
8567
|
+
destroy("nested table", $el.tabulator);
|
|
8568
|
+
$el.tabulator = null;
|
|
8569
|
+
}
|
|
8570
|
+
});
|
|
8571
|
+
$container.querySelectorAll(".yui-form-data-input").forEach(($el) => {
|
|
8572
|
+
if ($el.tom_select) {
|
|
8573
|
+
destroy("select", $el.tom_select);
|
|
8574
|
+
$el.tom_select = null;
|
|
8575
|
+
}
|
|
8576
|
+
if ($el.jsoneditor) {
|
|
8577
|
+
destroy("json editor", $el.jsoneditor);
|
|
8578
|
+
$el.jsoneditor = null;
|
|
8579
|
+
}
|
|
8580
|
+
if ($el.tabulator) {
|
|
8581
|
+
destroy("table", $el.tabulator);
|
|
8582
|
+
$el.tabulator = null;
|
|
8583
|
+
}
|
|
8584
|
+
});
|
|
8585
|
+
}
|
|
8366
8586
|
/******************************************************************
|
|
8367
8587
|
* Build form with bulma and createElement2
|
|
8368
8588
|
******************************************************************/
|
|
@@ -8916,7 +9136,13 @@ function create_form_field(gobj, $form, prefix, field_desc, { tag, inputType, na
|
|
|
8916
9136
|
{ class: "" },
|
|
8917
9137
|
[[
|
|
8918
9138
|
"button",
|
|
8919
|
-
{
|
|
9139
|
+
{
|
|
9140
|
+
class: "button p-1",
|
|
9141
|
+
title: (0, i18next.t)("add"),
|
|
9142
|
+
"data-i18n-title": "add",
|
|
9143
|
+
"aria-label": (0, i18next.t)("add"),
|
|
9144
|
+
"data-i18n-aria-label": "add"
|
|
9145
|
+
},
|
|
8920
9146
|
[[
|
|
8921
9147
|
"span",
|
|
8922
9148
|
{ class: "icon m-0" },
|
|
@@ -9074,7 +9300,7 @@ function create_form_field(gobj, $form, prefix, field_desc, { tag, inputType, na
|
|
|
9074
9300
|
value: option,
|
|
9075
9301
|
i18n: option
|
|
9076
9302
|
},
|
|
9077
|
-
option
|
|
9303
|
+
document.createTextNode(String(option))
|
|
9078
9304
|
]),
|
|
9079
9305
|
{ "change": function(evt) {
|
|
9080
9306
|
(0, _yuneta_gobj_js.gobj_send_event)(gobj, "EV_RECORD_CHANGED", {}, gobj);
|
|
@@ -9153,13 +9379,19 @@ function create_form_field(gobj, $form, prefix, field_desc, { tag, inputType, na
|
|
|
9153
9379
|
break;
|
|
9154
9380
|
}
|
|
9155
9381
|
case "radio": {
|
|
9156
|
-
let
|
|
9157
|
-
|
|
9158
|
-
|
|
9159
|
-
|
|
9160
|
-
|
|
9161
|
-
|
|
9162
|
-
|
|
9382
|
+
let label_key = String(options === void 0 || options === null ? "" : options);
|
|
9383
|
+
$extend = (0, _yuneta_gobj_js.createElement2)([
|
|
9384
|
+
"label",
|
|
9385
|
+
{ class: "radio" },
|
|
9386
|
+
[["input", {
|
|
9387
|
+
type: "radio",
|
|
9388
|
+
name
|
|
9389
|
+
}], [
|
|
9390
|
+
"span",
|
|
9391
|
+
{ i18n: label_key },
|
|
9392
|
+
label_key
|
|
9393
|
+
]]
|
|
9394
|
+
]);
|
|
9163
9395
|
$control.appendChild($extend);
|
|
9164
9396
|
break;
|
|
9165
9397
|
}
|
|
@@ -9179,6 +9411,10 @@ function create_form_field(gobj, $form, prefix, field_desc, { tag, inputType, na
|
|
|
9179
9411
|
props: {
|
|
9180
9412
|
readOnly: !!readonly,
|
|
9181
9413
|
onChange: function() {
|
|
9414
|
+
if ($extend.yui_json_error) {
|
|
9415
|
+
check_json_editor($extend);
|
|
9416
|
+
mark_field_validity($extend);
|
|
9417
|
+
}
|
|
9182
9418
|
(0, _yuneta_gobj_js.gobj_send_event)(gobj, "EV_RECORD_CHANGED", {}, gobj);
|
|
9183
9419
|
},
|
|
9184
9420
|
timestampTag: function({ field, value, path }) {
|
|
@@ -9502,7 +9738,7 @@ function create_tabulator$1(gobj, $extend, name, template) {
|
|
|
9502
9738
|
};
|
|
9503
9739
|
if ((0, _yuneta_gobj_js.gobj_read_bool_attr)(gobj, "with_delete_row_btn")) columns.push({
|
|
9504
9740
|
formatter: function(cell, formatterParams) {
|
|
9505
|
-
return "
|
|
9741
|
+
return cell_icon("yi-trash has-text-danger", "delete");
|
|
9506
9742
|
},
|
|
9507
9743
|
width: 40,
|
|
9508
9744
|
hozAlign: "center",
|
|
@@ -9583,7 +9819,7 @@ function template2columns(gobj, columns, template, sub_elements) {
|
|
|
9583
9819
|
});
|
|
9584
9820
|
Object.assign(column, {
|
|
9585
9821
|
formatter: function(cell, formatterParams) {
|
|
9586
|
-
return "
|
|
9822
|
+
return cell_icon("yi-plus has-text-link", "add");
|
|
9587
9823
|
},
|
|
9588
9824
|
hozAlign: "center",
|
|
9589
9825
|
cellClick: function(evt, cell) {
|
|
@@ -9725,6 +9961,7 @@ function template2columns(gobj, columns, template, sub_elements) {
|
|
|
9725
9961
|
* out-of-range number is more precise than anything generic here.
|
|
9726
9962
|
************************************************************/
|
|
9727
9963
|
function field_validation_message($input) {
|
|
9964
|
+
if ($input.yui_json_error) return (0, i18next.t)($input.yui_json_error);
|
|
9728
9965
|
let v = $input.validity;
|
|
9729
9966
|
if (v && v.valueMissing) return (0, i18next.t)("this field is required");
|
|
9730
9967
|
return $input.validationMessage;
|
|
@@ -9737,7 +9974,7 @@ function field_validation_message($input) {
|
|
|
9737
9974
|
function mark_field_validity($input) {
|
|
9738
9975
|
let $h = $input.parentNode ? $input.parentNode.querySelector(".help") : null;
|
|
9739
9976
|
let v = $input.validity;
|
|
9740
|
-
if (!v || v.valid) {
|
|
9977
|
+
if ((!v || v.valid) && !$input.yui_json_error) {
|
|
9741
9978
|
$input.classList.remove("is-danger");
|
|
9742
9979
|
if ($h) {
|
|
9743
9980
|
$h.textContent = "";
|
|
@@ -9758,6 +9995,12 @@ function mark_field_validity($input) {
|
|
|
9758
9995
|
function validate_form(gobj, $form) {
|
|
9759
9996
|
let validated = true;
|
|
9760
9997
|
if (!$form.checkValidity()) validated = false;
|
|
9998
|
+
$form.querySelectorAll(".jsoneditor.yui-form-data-input").forEach(($editor) => {
|
|
9999
|
+
if (!check_json_editor($editor)) {
|
|
10000
|
+
validated = false;
|
|
10001
|
+
mark_field_validity($editor);
|
|
10002
|
+
}
|
|
10003
|
+
});
|
|
9761
10004
|
$form.querySelectorAll(".yui-tabulator-table").forEach(($table) => {
|
|
9762
10005
|
if (!$table.tabulator.validate()) validated = false;
|
|
9763
10006
|
$table.querySelectorAll(".yui-tabulator-table-nested").forEach(($table_nested) => {
|
|
@@ -9767,6 +10010,22 @@ function validate_form(gobj, $form) {
|
|
|
9767
10010
|
return validated;
|
|
9768
10011
|
}
|
|
9769
10012
|
/************************************************************
|
|
10013
|
+
* Does the jsoneditor `$editor` hold json its column can store?
|
|
10014
|
+
* Leaves the answer on the element (`yui_json_error`, an i18n key
|
|
10015
|
+
* or ""), where mark_field_validity() reads it.
|
|
10016
|
+
************************************************************/
|
|
10017
|
+
function check_json_editor($editor) {
|
|
10018
|
+
let jsoneditor = $editor.jsoneditor;
|
|
10019
|
+
let field_desc = $editor.field_desc;
|
|
10020
|
+
if (!jsoneditor || !field_desc || $editor.hasAttribute("readonly")) {
|
|
10021
|
+
$editor.yui_json_error = "";
|
|
10022
|
+
return true;
|
|
10023
|
+
}
|
|
10024
|
+
let r = parse_json_field(json_editor_value(jsoneditor.get()), field_desc.type);
|
|
10025
|
+
$editor.yui_json_error = r.error;
|
|
10026
|
+
return !r.error;
|
|
10027
|
+
}
|
|
10028
|
+
/************************************************************
|
|
9770
10029
|
* Function to get input value based on its type
|
|
9771
10030
|
************************************************************/
|
|
9772
10031
|
function getInputValue($input) {
|
|
@@ -10124,23 +10383,23 @@ function treedb_value_2_form_value(gobj, field_desc, value) {
|
|
|
10124
10383
|
return value;
|
|
10125
10384
|
}
|
|
10126
10385
|
/************************************************************
|
|
10386
|
+
* A json field's value, parsed. validate_form() refuses a field
|
|
10387
|
+
* that does not parse, so reaching the error here is a path that
|
|
10388
|
+
* skipped it: logged, never quiet.
|
|
10389
|
+
************************************************************/
|
|
10390
|
+
function parse_json_value(gobj, field_desc, value) {
|
|
10391
|
+
let r = parse_json_field(value, field_desc.type);
|
|
10392
|
+
if (r.error) (0, _yuneta_gobj_js.log_error)(`${(0, _yuneta_gobj_js.gobj_short_name)(gobj)}: field '${field_desc.name}' (${field_desc.type}) holds no valid json, stored as empty`);
|
|
10393
|
+
return r.value;
|
|
10394
|
+
}
|
|
10395
|
+
/************************************************************
|
|
10127
10396
|
* Convert from frontend to backend
|
|
10128
10397
|
* operation: "create" "update"
|
|
10129
10398
|
************************************************************/
|
|
10130
10399
|
function form_value_2_treedb_value(gobj, field_desc, value) {
|
|
10131
10400
|
let type = field_desc.type;
|
|
10132
10401
|
let real_type = field_desc.real_type;
|
|
10133
|
-
if ((0, _yuneta_gobj_js.gobj_read_str_attr)(gobj, "render_mode") === "edit" && (type === "template" || type === "table" || type === "coordinates"))
|
|
10134
|
-
if ((0, _yuneta_gobj_js.is_string)(value)) try {
|
|
10135
|
-
value = JSON.parse(value);
|
|
10136
|
-
} catch (e) {
|
|
10137
|
-
value = type === "table" ? [] : {};
|
|
10138
|
-
}
|
|
10139
|
-
if (type === "table") {
|
|
10140
|
-
if (!(0, _yuneta_gobj_js.is_array)(value)) value = [];
|
|
10141
|
-
} else if (!(0, _yuneta_gobj_js.is_object)(value) && !(0, _yuneta_gobj_js.is_array)(value)) value = {};
|
|
10142
|
-
return value;
|
|
10143
|
-
}
|
|
10402
|
+
if ((0, _yuneta_gobj_js.gobj_read_str_attr)(gobj, "render_mode") === "edit" && (type === "template" || type === "table" || type === "coordinates")) return parse_json_value(gobj, field_desc, value);
|
|
10144
10403
|
switch (type) {
|
|
10145
10404
|
case "file": break;
|
|
10146
10405
|
case "fkey":
|
|
@@ -10177,13 +10436,7 @@ function form_value_2_treedb_value(gobj, field_desc, value) {
|
|
|
10177
10436
|
case "tel":
|
|
10178
10437
|
case "svg": break;
|
|
10179
10438
|
case "template":
|
|
10180
|
-
|
|
10181
|
-
value = JSON.parse(value);
|
|
10182
|
-
} catch (e) {
|
|
10183
|
-
value = {};
|
|
10184
|
-
}
|
|
10185
|
-
else if ((0, _yuneta_gobj_js.is_object)(value)) {}
|
|
10186
|
-
if (!(0, _yuneta_gobj_js.is_object)(value)) value = {};
|
|
10439
|
+
value = parse_json_value(gobj, field_desc, value);
|
|
10187
10440
|
break;
|
|
10188
10441
|
case "table":
|
|
10189
10442
|
case "id":
|
|
@@ -10200,13 +10453,7 @@ function form_value_2_treedb_value(gobj, field_desc, value) {
|
|
|
10200
10453
|
case "dict": break;
|
|
10201
10454
|
case "array":
|
|
10202
10455
|
case "list":
|
|
10203
|
-
|
|
10204
|
-
value = JSON.parse(value);
|
|
10205
|
-
} catch (e) {
|
|
10206
|
-
value = [];
|
|
10207
|
-
}
|
|
10208
|
-
else if ((0, _yuneta_gobj_js.is_array)(value)) {}
|
|
10209
|
-
if (!(0, _yuneta_gobj_js.is_array)(value)) value = [];
|
|
10456
|
+
value = parse_json_value(gobj, field_desc, value);
|
|
10210
10457
|
break;
|
|
10211
10458
|
case "real":
|
|
10212
10459
|
value = parseFloat(value) || 0;
|
|
@@ -10215,12 +10462,7 @@ function form_value_2_treedb_value(gobj, field_desc, value) {
|
|
|
10215
10462
|
value = (0, _yuneta_gobj_js.parseBoolean)(value);
|
|
10216
10463
|
break;
|
|
10217
10464
|
case "blob":
|
|
10218
|
-
|
|
10219
|
-
value = JSON.parse(value);
|
|
10220
|
-
} catch (e) {
|
|
10221
|
-
value = {};
|
|
10222
|
-
}
|
|
10223
|
-
else if ((0, _yuneta_gobj_js.is_object)(value)) {} else if ((0, _yuneta_gobj_js.is_array)(value)) {} else value = {};
|
|
10465
|
+
value = parse_json_value(gobj, field_desc, value);
|
|
10224
10466
|
break;
|
|
10225
10467
|
case "number": break;
|
|
10226
10468
|
case "coordinates":
|
|
@@ -10360,7 +10602,9 @@ function ac_add_table_row(gobj, event, kw, src) {
|
|
|
10360
10602
|
}
|
|
10361
10603
|
});
|
|
10362
10604
|
}
|
|
10363
|
-
}).catch(function(error) {
|
|
10605
|
+
}).catch(function(error) {
|
|
10606
|
+
(0, _yuneta_gobj_js.log_error)(`${(0, _yuneta_gobj_js.gobj_short_name)(gobj)}: cannot add a table row: ${error}`);
|
|
10607
|
+
});
|
|
10364
10608
|
setTimeout(function() {
|
|
10365
10609
|
if ($row) {
|
|
10366
10610
|
let $tabulator = $row.closest(".yui-tabulator-table");
|
|
@@ -10833,7 +11077,7 @@ function yui_maplibre_relocalize(map, t) {
|
|
|
10833
11077
|
*
|
|
10834
11078
|
* Map Manager
|
|
10835
11079
|
*
|
|
10836
|
-
* Copyright (c) 2025, ArtGins.
|
|
11080
|
+
* Copyright (c) 2025-2026, ArtGins.
|
|
10837
11081
|
* All Rights Reserved.
|
|
10838
11082
|
***********************************************************************/
|
|
10839
11083
|
/***************************************************************
|
|
@@ -10979,6 +11223,7 @@ function mt_start$16(gobj) {
|
|
|
10979
11223
|
function mt_stop$16(gobj) {
|
|
10980
11224
|
let shell = yui_shell_of(gobj);
|
|
10981
11225
|
if (shell) (0, _yuneta_gobj_js.gobj_unsubscribe_event)(shell, "EV_LANGUAGE_CHANGED", {}, gobj);
|
|
11226
|
+
(0, _yuneta_gobj_js.gobj_stop_children)(gobj);
|
|
10982
11227
|
return 0;
|
|
10983
11228
|
}
|
|
10984
11229
|
/***************************************************************
|
|
@@ -11268,52 +11513,24 @@ function find_device(gobj, id) {
|
|
|
11268
11513
|
return null;
|
|
11269
11514
|
}
|
|
11270
11515
|
/************************************************************
|
|
11271
|
-
* Event handler for click
|
|
11516
|
+
* Event handler for click: maplibre's callback only turns the
|
|
11517
|
+
* click into an event; the work is ac_marker_clicked().
|
|
11518
|
+
* Plain json: the marker's identity and where it is.
|
|
11272
11519
|
************************************************************/
|
|
11273
11520
|
function onClick(gobj, e) {
|
|
11274
|
-
|
|
11275
|
-
|
|
11276
|
-
|
|
11277
|
-
|
|
11278
|
-
if (gobj_service) {
|
|
11279
|
-
let window_service_name = `window-map-${(0, _yuneta_gobj_js.clean_name)((0, _yuneta_gobj_js.gobj_name)(gobj_service))}`;
|
|
11280
|
-
let popupContent = (0, _yuneta_gobj_js.createElement2)([
|
|
11281
|
-
"div",
|
|
11282
|
-
{ class: "xmap columns m-0 p-0 is-flex-wrap-wrap" },
|
|
11283
|
-
(0, _yuneta_gobj_js.gobj_read_attr)(gobj_service, "$container")
|
|
11284
|
-
]);
|
|
11285
|
-
let gobj_window = (0, _yuneta_gobj_js.gobj_create_service)(window_service_name, "C_YUI_WINDOW", {
|
|
11286
|
-
$parent: document.getElementById("top-layer"),
|
|
11287
|
-
width: 700,
|
|
11288
|
-
height: 500,
|
|
11289
|
-
auto_save_size_and_position: false,
|
|
11290
|
-
center: true,
|
|
11291
|
-
showMax: false,
|
|
11292
|
-
content_size: true,
|
|
11293
|
-
title_prefix: (0, _yuneta_gobj_js.gobj_name)(gobj_service),
|
|
11294
|
-
title: "",
|
|
11295
|
-
icon: "yi-location-dot",
|
|
11296
|
-
logical_class: "MAP_MARKER_WINDOW",
|
|
11297
|
-
body: popupContent
|
|
11298
|
-
}, gobj);
|
|
11299
|
-
if (!gobj_window) {
|
|
11300
|
-
(0, _yuneta_gobj_js.log_error)(`${(0, _yuneta_gobj_js.gobj_name)(gobj)}: cannot create the marker window`);
|
|
11301
|
-
return;
|
|
11302
|
-
}
|
|
11303
|
-
(0, _yuneta_gobj_js.gobj_start)(gobj_window);
|
|
11304
|
-
} else {
|
|
11305
|
-
const popup = new maplibre_gl.Popup({
|
|
11306
|
-
closeButton: true,
|
|
11307
|
-
closeOnClick: true,
|
|
11308
|
-
closeOnMove: true,
|
|
11309
|
-
anchor: "center",
|
|
11310
|
-
maxWidth: "none"
|
|
11311
|
-
});
|
|
11312
|
-
const popupContent = `
|
|
11313
|
-
<b>${properties.name}</b><br>Id: ${properties.id}
|
|
11314
|
-
`;
|
|
11315
|
-
popup.setLngLat(coordinates).setHTML(popupContent).addTo(map);
|
|
11521
|
+
let feature = e && e.features && e.features[0];
|
|
11522
|
+
if (!feature) {
|
|
11523
|
+
(0, _yuneta_gobj_js.log_error)(`${(0, _yuneta_gobj_js.gobj_name)(gobj)}: marker click with no feature`);
|
|
11524
|
+
return;
|
|
11316
11525
|
}
|
|
11526
|
+
let properties = feature.properties || {};
|
|
11527
|
+
let coordinates = feature.geometry.coordinates.slice();
|
|
11528
|
+
(0, _yuneta_gobj_js.gobj_send_event)(gobj, "EV_MARKER_CLICKED", {
|
|
11529
|
+
gobj_service_name: properties.gobj_service_name || "",
|
|
11530
|
+
name: properties.name !== void 0 ? String(properties.name) : "",
|
|
11531
|
+
id: properties.id !== void 0 ? String(properties.id) : "",
|
|
11532
|
+
coordinates
|
|
11533
|
+
}, gobj);
|
|
11317
11534
|
}
|
|
11318
11535
|
/************************************************************
|
|
11319
11536
|
* Event handlers for dragging
|
|
@@ -11422,6 +11639,68 @@ function ac_refresh$7(gobj, event, kw, src) {
|
|
|
11422
11639
|
return 0;
|
|
11423
11640
|
}
|
|
11424
11641
|
/************************************************************
|
|
11642
|
+
* EV_MARKER_CLICKED {gobj_service_name, name, id, coordinates}
|
|
11643
|
+
*
|
|
11644
|
+
* A marker backed by a gobj service opens that service's view in
|
|
11645
|
+
* a window -- ONE per marker: a second click is told to the open
|
|
11646
|
+
* one (EV_SHOW). (It created a second window under the same service
|
|
11647
|
+
* name, moved the one $container into it and left the first one
|
|
11648
|
+
* empty; closing the first then unregistered the second's name.)
|
|
11649
|
+
* A marker without a service gets a popup with its name and id.
|
|
11650
|
+
************************************************************/
|
|
11651
|
+
function ac_marker_clicked(gobj, event, kw, src) {
|
|
11652
|
+
const map = gobj.priv.xmap;
|
|
11653
|
+
const gobj_service = kw.gobj_service_name ? (0, _yuneta_gobj_js.gobj_find_service)(kw.gobj_service_name, false) : null;
|
|
11654
|
+
if (gobj_service) {
|
|
11655
|
+
let window_service_name = `window-map-${(0, _yuneta_gobj_js.clean_name)((0, _yuneta_gobj_js.gobj_name)(gobj_service))}`;
|
|
11656
|
+
let gobj_window = (0, _yuneta_gobj_js.gobj_find_service)(window_service_name, false);
|
|
11657
|
+
if (gobj_window) {
|
|
11658
|
+
(0, _yuneta_gobj_js.gobj_send_event)(gobj_window, "EV_SHOW", {}, gobj);
|
|
11659
|
+
return 0;
|
|
11660
|
+
}
|
|
11661
|
+
let popupContent = (0, _yuneta_gobj_js.createElement2)([
|
|
11662
|
+
"div",
|
|
11663
|
+
{ class: "xmap columns m-0 p-0 is-flex-wrap-wrap" },
|
|
11664
|
+
(0, _yuneta_gobj_js.gobj_read_attr)(gobj_service, "$container")
|
|
11665
|
+
]);
|
|
11666
|
+
gobj_window = (0, _yuneta_gobj_js.gobj_create_service)(window_service_name, "C_YUI_WINDOW", {
|
|
11667
|
+
$parent: document.getElementById("top-layer"),
|
|
11668
|
+
width: 700,
|
|
11669
|
+
height: 500,
|
|
11670
|
+
auto_save_size_and_position: false,
|
|
11671
|
+
center: true,
|
|
11672
|
+
showMax: false,
|
|
11673
|
+
content_size: true,
|
|
11674
|
+
title_prefix: (0, _yuneta_gobj_js.gobj_name)(gobj_service),
|
|
11675
|
+
title: "",
|
|
11676
|
+
icon: "yi-location-dot",
|
|
11677
|
+
logical_class: "MAP_MARKER_WINDOW",
|
|
11678
|
+
body: popupContent
|
|
11679
|
+
}, gobj);
|
|
11680
|
+
if (!gobj_window) {
|
|
11681
|
+
(0, _yuneta_gobj_js.log_error)(`${(0, _yuneta_gobj_js.gobj_name)(gobj)}: cannot create the marker window`);
|
|
11682
|
+
return -1;
|
|
11683
|
+
}
|
|
11684
|
+
(0, _yuneta_gobj_js.gobj_start)(gobj_window);
|
|
11685
|
+
return 0;
|
|
11686
|
+
}
|
|
11687
|
+
const popup = new maplibre_gl.Popup({
|
|
11688
|
+
closeButton: true,
|
|
11689
|
+
closeOnClick: true,
|
|
11690
|
+
closeOnMove: true,
|
|
11691
|
+
anchor: "center",
|
|
11692
|
+
maxWidth: "none"
|
|
11693
|
+
});
|
|
11694
|
+
let $content = document.createElement("div");
|
|
11695
|
+
let $name = document.createElement("b");
|
|
11696
|
+
$name.textContent = kw.name;
|
|
11697
|
+
$content.appendChild($name);
|
|
11698
|
+
$content.appendChild(document.createElement("br"));
|
|
11699
|
+
$content.appendChild(document.createTextNode(`Id: ${kw.id}`));
|
|
11700
|
+
popup.setLngLat(kw.coordinates).setDOMContent($content).addTo(map);
|
|
11701
|
+
return 0;
|
|
11702
|
+
}
|
|
11703
|
+
/************************************************************
|
|
11425
11704
|
*
|
|
11426
11705
|
************************************************************/
|
|
11427
11706
|
function ac_select(gobj, event, kw, src) {
|
|
@@ -11469,6 +11748,7 @@ function create_gclass$16(gclass_name) {
|
|
|
11469
11748
|
["EV_MAP_ON_LOAD", 0],
|
|
11470
11749
|
["EV_REFRESH", 0],
|
|
11471
11750
|
["EV_SELECT", 0],
|
|
11751
|
+
["EV_MARKER_CLICKED", 0],
|
|
11472
11752
|
["EV_SHOW", 0],
|
|
11473
11753
|
["EV_HIDE", 0]
|
|
11474
11754
|
], [["ST_IDLE", [
|
|
@@ -11502,6 +11782,11 @@ function create_gclass$16(gclass_name) {
|
|
|
11502
11782
|
ac_select,
|
|
11503
11783
|
null
|
|
11504
11784
|
],
|
|
11785
|
+
[
|
|
11786
|
+
"EV_MARKER_CLICKED",
|
|
11787
|
+
ac_marker_clicked,
|
|
11788
|
+
null
|
|
11789
|
+
],
|
|
11505
11790
|
[
|
|
11506
11791
|
"EV_SHOW",
|
|
11507
11792
|
ac_show$11,
|
|
@@ -11668,7 +11953,7 @@ function build_ui$14(gobj) {
|
|
|
11668
11953
|
class: "C_YUI_UPLOT",
|
|
11669
11954
|
style: "overflow:auto;"
|
|
11670
11955
|
}]);
|
|
11671
|
-
(0, _yuneta_gobj_js.
|
|
11956
|
+
(0, _yuneta_gobj_js.gobj_write_attr)(gobj, "$container", $container);
|
|
11672
11957
|
(0, _yuneta_gobj_js.gobj_write_bool_attr)(gobj, "own_container", true);
|
|
11673
11958
|
}
|
|
11674
11959
|
let uPlot_options = {
|
|
@@ -13030,7 +13315,7 @@ function ensure_drag_canvas_patch() {
|
|
|
13030
13315
|
* Displays JSON data as a hierarchical graph visualization
|
|
13031
13316
|
* Migrated from mx_json_viewer.js (mxGraph)
|
|
13032
13317
|
*
|
|
13033
|
-
* Copyright (c) 2025, ArtGins.
|
|
13318
|
+
* Copyright (c) 2025-2026, ArtGins.
|
|
13034
13319
|
* All Rights Reserved.
|
|
13035
13320
|
***********************************************************************/
|
|
13036
13321
|
/***************************************************************
|
|
@@ -13526,7 +13811,12 @@ function build_graph$4(gobj) {
|
|
|
13526
13811
|
});
|
|
13527
13812
|
if (priv.theme) graph.setTheme(priv.theme);
|
|
13528
13813
|
graph.on(_antv_g6.NodeEvent.CLICK, (evt) => {
|
|
13529
|
-
|
|
13814
|
+
let client = evt && evt.client ? evt.client : null;
|
|
13815
|
+
(0, _yuneta_gobj_js.gobj_send_event)(gobj, "EV_NODE_CLICK", {
|
|
13816
|
+
id: evt && evt.target && evt.target.id ? String(evt.target.id) : "",
|
|
13817
|
+
client_x: client && typeof client.x === "number" ? client.x : 0,
|
|
13818
|
+
client_y: client && typeof client.y === "number" ? client.y : 0
|
|
13819
|
+
}, gobj);
|
|
13530
13820
|
});
|
|
13531
13821
|
graph.on("aftertransform", () => {
|
|
13532
13822
|
yui_graph_update_zoom((0, _yuneta_gobj_js.gobj_read_attr)(gobj, "$container"), priv.graph);
|
|
@@ -14457,7 +14747,7 @@ function ac_center$4(gobj, event, kw, src) {
|
|
|
14457
14747
|
function ac_node_click$4(gobj, event, kw, src) {
|
|
14458
14748
|
let priv = gobj.priv;
|
|
14459
14749
|
let graph = priv.graph;
|
|
14460
|
-
let node_id = kw.
|
|
14750
|
+
let node_id = kw.id;
|
|
14461
14751
|
let nodedata;
|
|
14462
14752
|
try {
|
|
14463
14753
|
nodedata = graph.getNodeData(node_id);
|
|
@@ -18533,6 +18823,10 @@ function build_zone(gobj, zone) {
|
|
|
18533
18823
|
{
|
|
18534
18824
|
class: "GCLASS_ZONE_TOGGLE",
|
|
18535
18825
|
type: "button",
|
|
18826
|
+
title: (0, i18next.t)(zone.key),
|
|
18827
|
+
"data-i18n-title": zone.key,
|
|
18828
|
+
"aria-label": (0, i18next.t)(zone.key),
|
|
18829
|
+
"data-i18n-aria-label": zone.key,
|
|
18536
18830
|
"aria-expanded": collapsed ? "false" : "true"
|
|
18537
18831
|
},
|
|
18538
18832
|
[
|
|
@@ -18662,12 +18956,12 @@ function build_attrs(attrs) {
|
|
|
18662
18956
|
[
|
|
18663
18957
|
"td",
|
|
18664
18958
|
{ class: "GCLASS_CELL_DEFAULT" },
|
|
18665
|
-
a.default_value
|
|
18959
|
+
document.createTextNode(String(a.default_value ?? ""))
|
|
18666
18960
|
],
|
|
18667
18961
|
[
|
|
18668
18962
|
"td",
|
|
18669
18963
|
{ class: "GCLASS_CELL_DESC" },
|
|
18670
|
-
a.description
|
|
18964
|
+
document.createTextNode(String(a.description ?? ""))
|
|
18671
18965
|
]
|
|
18672
18966
|
]
|
|
18673
18967
|
];
|
|
@@ -20543,6 +20837,10 @@ function mt_destroy$9(gobj) {
|
|
|
20543
20837
|
cancelAnimationFrame(priv._resize_raf);
|
|
20544
20838
|
priv._resize_raf = 0;
|
|
20545
20839
|
}
|
|
20840
|
+
if (priv.find_timer) {
|
|
20841
|
+
clearTimeout(priv.find_timer);
|
|
20842
|
+
priv.find_timer = null;
|
|
20843
|
+
}
|
|
20546
20844
|
if (priv.graph) {
|
|
20547
20845
|
priv.graph.destroy();
|
|
20548
20846
|
priv.graph = null;
|
|
@@ -20949,7 +21247,12 @@ function build_graph$2(gobj) {
|
|
|
20949
21247
|
save_view_state(gobj);
|
|
20950
21248
|
});
|
|
20951
21249
|
graph.on(_antv_g6.NodeEvent.CLICK, (evt) => {
|
|
20952
|
-
|
|
21250
|
+
let client = evt && evt.client ? evt.client : null;
|
|
21251
|
+
(0, _yuneta_gobj_js.gobj_send_event)(gobj, "EV_NODE_CLICK", {
|
|
21252
|
+
id: evt && evt.target && evt.target.id ? String(evt.target.id) : "",
|
|
21253
|
+
client_x: client && typeof client.x === "number" ? client.x : 0,
|
|
21254
|
+
client_y: client && typeof client.y === "number" ? client.y : 0
|
|
21255
|
+
}, gobj);
|
|
20953
21256
|
});
|
|
20954
21257
|
graph.on(_antv_g6.CanvasEvent.CLICK, (evt) => {
|
|
20955
21258
|
hide_popover(gobj);
|
|
@@ -21961,7 +22264,7 @@ function ac_center$2(gobj, event, kw, src) {
|
|
|
21961
22264
|
function ac_node_click$3(gobj, event, kw, src) {
|
|
21962
22265
|
let priv = gobj.priv;
|
|
21963
22266
|
let graph = priv.graph;
|
|
21964
|
-
let node_id = kw.
|
|
22267
|
+
let node_id = kw.id;
|
|
21965
22268
|
let node_data = priv.node_by_id && priv.node_by_id[node_id] || null;
|
|
21966
22269
|
if (!node_data) try {
|
|
21967
22270
|
let nd = graph.getNodeData(node_id);
|
|
@@ -21977,8 +22280,8 @@ function ac_node_click$3(gobj, event, kw, src) {
|
|
|
21977
22280
|
(0, _yuneta_gobj_js.gobj_post_event)(gobj, "EV_CENTER_ANCHOR", {}, gobj);
|
|
21978
22281
|
return 0;
|
|
21979
22282
|
}
|
|
21980
|
-
let client_x = kw.
|
|
21981
|
-
let client_y = kw.
|
|
22283
|
+
let client_x = kw.client_x || 0;
|
|
22284
|
+
let client_y = kw.client_y || 0;
|
|
21982
22285
|
show_popover(gobj, node_data, client_x, client_y);
|
|
21983
22286
|
return 0;
|
|
21984
22287
|
}
|
|
@@ -22629,7 +22932,7 @@ function is_decorative(it) {
|
|
|
22629
22932
|
var attrs_table$7 = [
|
|
22630
22933
|
(0, _yuneta_gobj_js.SDATA)(_yuneta_gobj_js.data_type_t.DTP_POINTER, "subscriber", 0, null, "Subscriber of output events"),
|
|
22631
22934
|
(0, _yuneta_gobj_js.SDATA)(_yuneta_gobj_js.data_type_t.DTP_STRING, "menu_id", 0, "", "Id of the menu this nav renders"),
|
|
22632
|
-
(0, _yuneta_gobj_js.SDATA)(_yuneta_gobj_js.data_type_t.DTP_STRING, "nav_label", 0, "", "
|
|
22935
|
+
(0, _yuneta_gobj_js.SDATA)(_yuneta_gobj_js.data_type_t.DTP_STRING, "nav_label", 0, "", "i18n key of the label for aria/heading; falls back to 'navigation'"),
|
|
22633
22936
|
(0, _yuneta_gobj_js.SDATA)(_yuneta_gobj_js.data_type_t.DTP_JSON, "menu_items", 0, null, "Array of menu items to render"),
|
|
22634
22937
|
(0, _yuneta_gobj_js.SDATA)(_yuneta_gobj_js.data_type_t.DTP_STRING, "zone", 0, "", "Zone id where this nav lives"),
|
|
22635
22938
|
(0, _yuneta_gobj_js.SDATA)(_yuneta_gobj_js.data_type_t.DTP_STRING, "layout", 0, "vertical", "vertical|icon-bar|tabs|drawer|submenu|accordion"),
|
|
@@ -22644,7 +22947,10 @@ var attrs_table$7 = [
|
|
|
22644
22947
|
(0, _yuneta_gobj_js.SDATA_END)()
|
|
22645
22948
|
];
|
|
22646
22949
|
var __nav_aria_seq__ = 0;
|
|
22647
|
-
var PRIVATE_DATA$7 = {
|
|
22950
|
+
var PRIVATE_DATA$7 = {
|
|
22951
|
+
click_handler: null,
|
|
22952
|
+
key_handler: null
|
|
22953
|
+
};
|
|
22648
22954
|
var __gclass__$7 = null;
|
|
22649
22955
|
/******************************
|
|
22650
22956
|
* Framework Methods
|
|
@@ -22680,6 +22986,7 @@ function mt_destroy$7(gobj) {
|
|
|
22680
22986
|
let $c = (0, _yuneta_gobj_js.gobj_read_attr)(gobj, "$container");
|
|
22681
22987
|
let priv = gobj.priv;
|
|
22682
22988
|
if ($c && priv && priv.click_handler) $c.removeEventListener("click", priv.click_handler);
|
|
22989
|
+
if ($c && priv && priv.key_handler) $c.removeEventListener("keydown", priv.key_handler);
|
|
22683
22990
|
if ($c && $c.parentNode) $c.parentNode.removeChild($c);
|
|
22684
22991
|
(0, _yuneta_gobj_js.gobj_write_attr)(gobj, "$container", null);
|
|
22685
22992
|
}
|
|
@@ -22697,7 +23004,7 @@ function build_ui$7(gobj) {
|
|
|
22697
23004
|
}
|
|
22698
23005
|
let items = (0, _yuneta_gobj_js.gobj_read_attr)(gobj, "menu_items") || [];
|
|
22699
23006
|
let zone = (0, _yuneta_gobj_js.gobj_read_attr)(gobj, "zone") || "";
|
|
22700
|
-
|
|
23007
|
+
(0, _yuneta_gobj_js.gobj_read_attr)(gobj, "menu_id");
|
|
22701
23008
|
let $container;
|
|
22702
23009
|
switch (layout) {
|
|
22703
23010
|
case "vertical":
|
|
@@ -22741,8 +23048,9 @@ function build_ui$7(gobj) {
|
|
|
22741
23048
|
if (layout !== "drawer") {
|
|
22742
23049
|
$container.setAttribute("role", "navigation");
|
|
22743
23050
|
if (!$container.hasAttribute("aria-label")) {
|
|
22744
|
-
let label = (0, _yuneta_gobj_js.gobj_read_attr)(gobj, "nav_label") ||
|
|
22745
|
-
$container.setAttribute("aria-label", label);
|
|
23051
|
+
let label = (0, _yuneta_gobj_js.gobj_read_attr)(gobj, "nav_label") || "navigation";
|
|
23052
|
+
$container.setAttribute("aria-label", (0, i18next.t)(label));
|
|
23053
|
+
$container.setAttribute("data-i18n-aria-label", label);
|
|
22746
23054
|
}
|
|
22747
23055
|
}
|
|
22748
23056
|
wire_clicks(gobj, $container);
|
|
@@ -22761,6 +23069,7 @@ function rebuild(gobj) {
|
|
|
22761
23069
|
let next = $old ? $old.nextSibling : null;
|
|
22762
23070
|
let was_hidden = !!($old && $old.classList.contains("is-hidden"));
|
|
22763
23071
|
if ($old && priv.click_handler) $old.removeEventListener("click", priv.click_handler);
|
|
23072
|
+
if ($old && priv.key_handler) $old.removeEventListener("keydown", priv.key_handler);
|
|
22764
23073
|
build_ui$7(gobj);
|
|
22765
23074
|
let $new = (0, _yuneta_gobj_js.gobj_read_attr)(gobj, "$container");
|
|
22766
23075
|
if ($new && was_hidden) $new.classList.add("is-hidden");
|
|
@@ -22865,6 +23174,7 @@ function render_tabs(gobj, items) {
|
|
|
22865
23174
|
class: "icon is-small yui-nav-close ml-2",
|
|
22866
23175
|
"data-close-item": it.id,
|
|
22867
23176
|
role: "button",
|
|
23177
|
+
tabindex: "0",
|
|
22868
23178
|
"aria-label": (0, i18next.t)("close"),
|
|
22869
23179
|
"data-i18n-aria-label": "close",
|
|
22870
23180
|
title: (0, i18next.t)("close"),
|
|
@@ -22875,12 +23185,15 @@ function render_tabs(gobj, items) {
|
|
|
22875
23185
|
"aria-hidden": "true"
|
|
22876
23186
|
}]
|
|
22877
23187
|
]);
|
|
23188
|
+
let label = it.name || "";
|
|
22878
23189
|
let a_attrs = {
|
|
22879
23190
|
href: it.route ? "#" + it.route : "#",
|
|
22880
23191
|
"data-item-id": it.id,
|
|
22881
|
-
"data-route": it.route || ""
|
|
23192
|
+
"data-route": it.route || "",
|
|
23193
|
+
"aria-label": label || it.id
|
|
22882
23194
|
};
|
|
22883
|
-
|
|
23195
|
+
if (label) a_attrs["data-i18n-aria-label"] = label;
|
|
23196
|
+
let tip = it.tooltip || it.aria_label || label;
|
|
22884
23197
|
if (tip) {
|
|
22885
23198
|
a_attrs.title = tip;
|
|
22886
23199
|
a_attrs["data-i18n-title"] = tip;
|
|
@@ -23026,12 +23339,13 @@ function render_backbar(gobj) {
|
|
|
23026
23339
|
]);
|
|
23027
23340
|
}
|
|
23028
23341
|
function render_drawer(gobj, items) {
|
|
23029
|
-
let menu_id = (0, _yuneta_gobj_js.gobj_read_attr)(gobj, "menu_id") || "drawer";
|
|
23030
23342
|
let wrap = document.createElement("div");
|
|
23031
23343
|
wrap.className = "yui-drawer";
|
|
23032
23344
|
wrap.setAttribute("role", "dialog");
|
|
23033
23345
|
wrap.setAttribute("aria-modal", "true");
|
|
23034
|
-
|
|
23346
|
+
let nav_label = (0, _yuneta_gobj_js.gobj_read_attr)(gobj, "nav_label") || "navigation";
|
|
23347
|
+
wrap.setAttribute("aria-label", (0, i18next.t)(nav_label));
|
|
23348
|
+
wrap.setAttribute("data-i18n-aria-label", nav_label);
|
|
23035
23349
|
let back = document.createElement("div");
|
|
23036
23350
|
back.className = "yui-drawer-backdrop";
|
|
23037
23351
|
back.setAttribute("data-close-drawer", "1");
|
|
@@ -23039,7 +23353,8 @@ function render_drawer(gobj, items) {
|
|
|
23039
23353
|
let panel = document.createElement("div");
|
|
23040
23354
|
panel.className = "yui-drawer-panel";
|
|
23041
23355
|
panel.setAttribute("role", "navigation");
|
|
23042
|
-
panel.setAttribute("aria-label",
|
|
23356
|
+
panel.setAttribute("aria-label", (0, i18next.t)(nav_label));
|
|
23357
|
+
panel.setAttribute("data-i18n-aria-label", nav_label);
|
|
23043
23358
|
panel.appendChild(render_vertical(gobj, items));
|
|
23044
23359
|
wrap.appendChild(back);
|
|
23045
23360
|
wrap.appendChild(panel);
|
|
@@ -23093,7 +23408,13 @@ function render_accordion(gobj, items) {
|
|
|
23093
23408
|
"aria-expanded": "false",
|
|
23094
23409
|
"aria-controls": body_id
|
|
23095
23410
|
};
|
|
23096
|
-
if (!(0, _yuneta_gobj_js.empty_string)(head_text))
|
|
23411
|
+
if (!(0, _yuneta_gobj_js.empty_string)(head_text)) {
|
|
23412
|
+
head_attrs.i18n = head_text;
|
|
23413
|
+
head_attrs.title = head_text;
|
|
23414
|
+
head_attrs["data-i18n-title"] = head_text;
|
|
23415
|
+
head_attrs["aria-label"] = head_text;
|
|
23416
|
+
head_attrs["data-i18n-aria-label"] = head_text;
|
|
23417
|
+
}
|
|
23097
23418
|
let $hdr = (0, _yuneta_gobj_js.createElement2)([
|
|
23098
23419
|
"button",
|
|
23099
23420
|
head_attrs,
|
|
@@ -23179,7 +23500,7 @@ function item_li(gobj, it, opts) {
|
|
|
23179
23500
|
"aria-label": aria_key
|
|
23180
23501
|
};
|
|
23181
23502
|
if (label) a_attrs["data-i18n-aria-label"] = label;
|
|
23182
|
-
let tip = it.tooltip || it.aria_label;
|
|
23503
|
+
let tip = it.tooltip || it.aria_label || label;
|
|
23183
23504
|
if (tip) {
|
|
23184
23505
|
a_attrs.title = tip;
|
|
23185
23506
|
a_attrs["data-i18n-title"] = tip;
|
|
@@ -23233,7 +23554,7 @@ function item_iconbar(gobj, it, opts) {
|
|
|
23233
23554
|
"aria-label": label || it.id
|
|
23234
23555
|
};
|
|
23235
23556
|
if (label) a_attrs["data-i18n-aria-label"] = label;
|
|
23236
|
-
let tip = it.tooltip || it.aria_label;
|
|
23557
|
+
let tip = it.tooltip || it.aria_label || label;
|
|
23237
23558
|
if (tip) {
|
|
23238
23559
|
a_attrs.title = tip;
|
|
23239
23560
|
a_attrs["data-i18n-title"] = tip;
|
|
@@ -23301,6 +23622,14 @@ function wire_clicks(gobj, $container) {
|
|
|
23301
23622
|
};
|
|
23302
23623
|
$container.addEventListener("click", handler);
|
|
23303
23624
|
priv.click_handler = handler;
|
|
23625
|
+
let key_handler = (ev) => {
|
|
23626
|
+
if (ev.key !== "Enter" && ev.key !== " ") return;
|
|
23627
|
+
let target = ev.target;
|
|
23628
|
+
if (!target || !target.closest || !target.closest("[data-close-item]")) return;
|
|
23629
|
+
handler(ev);
|
|
23630
|
+
};
|
|
23631
|
+
$container.addEventListener("keydown", key_handler);
|
|
23632
|
+
priv.key_handler = key_handler;
|
|
23304
23633
|
}
|
|
23305
23634
|
/***************************
|
|
23306
23635
|
* Actions
|
|
@@ -23355,7 +23684,7 @@ function ac_route_changed(gobj, event, kw, src) {
|
|
|
23355
23684
|
return 0;
|
|
23356
23685
|
}
|
|
23357
23686
|
function css_escape(s) {
|
|
23358
|
-
return String(s).replace(/"/g, "\\\"");
|
|
23687
|
+
return String(s).replace(/\\/g, "\\\\").replace(/"/g, "\\\"");
|
|
23359
23688
|
}
|
|
23360
23689
|
/***************************************************************
|
|
23361
23690
|
* FSM
|
|
@@ -23575,6 +23904,8 @@ function build_body(shell, t) {
|
|
|
23575
23904
|
type: "text",
|
|
23576
23905
|
placeholder: t("filter", { defaultValue: "Filter…" }),
|
|
23577
23906
|
"data-i18n-placeholder": "filter",
|
|
23907
|
+
title: t("filter", { defaultValue: "Filter" }),
|
|
23908
|
+
"data-i18n-title": "filter",
|
|
23578
23909
|
"aria-label": t("filter", { defaultValue: "Filter" }),
|
|
23579
23910
|
"data-i18n-aria-label": "filter"
|
|
23580
23911
|
}]);
|
|
@@ -23662,6 +23993,10 @@ function build_body(shell, t) {
|
|
|
23662
23993
|
"button",
|
|
23663
23994
|
{
|
|
23664
23995
|
class: "button is-small ROUTEMAP_PRINT",
|
|
23996
|
+
title: t("print", { defaultValue: "Print" }),
|
|
23997
|
+
"data-i18n-title": "print",
|
|
23998
|
+
"aria-label": t("print", { defaultValue: "Print" }),
|
|
23999
|
+
"data-i18n-aria-label": "print",
|
|
23665
24000
|
i18n: "print"
|
|
23666
24001
|
},
|
|
23667
24002
|
t("print", { defaultValue: "Print" })
|
|
@@ -27202,46 +27537,46 @@ function yui_selection_bar(t, opts) {
|
|
|
27202
27537
|
/***********************************************************************
|
|
27203
27538
|
* yui_table_filter_clear.js
|
|
27204
27539
|
*
|
|
27205
|
-
*
|
|
27206
|
-
*
|
|
27207
|
-
*
|
|
27208
|
-
*
|
|
27209
|
-
*
|
|
27210
|
-
*
|
|
27211
|
-
*
|
|
27212
|
-
*
|
|
27213
|
-
*
|
|
27214
|
-
*
|
|
27215
|
-
* - **
|
|
27216
|
-
*
|
|
27217
|
-
*
|
|
27218
|
-
*
|
|
27219
|
-
*
|
|
27220
|
-
*
|
|
27221
|
-
*
|
|
27222
|
-
*
|
|
27223
|
-
* - **
|
|
27224
|
-
* `setHeaderFilterValue(field, "")`
|
|
27225
|
-
*
|
|
27226
|
-
*
|
|
27227
|
-
*
|
|
27228
|
-
*
|
|
27229
|
-
* - **
|
|
27230
|
-
*
|
|
27231
|
-
*
|
|
27232
|
-
*
|
|
27233
|
-
*
|
|
27234
|
-
* `querySelector
|
|
27235
|
-
*
|
|
27540
|
+
* THE ✕ OF A TABULATOR'S HEADER FILTERS.
|
|
27541
|
+
*
|
|
27542
|
+
* A column filter is set by typing and removed by DELETING what
|
|
27543
|
+
* was typed, letter by letter, and nothing in the header says it
|
|
27544
|
+
* can be removed. With several columns filtered, getting the
|
|
27545
|
+
* whole table back is an exercise of memory: which ones did I
|
|
27546
|
+
* touch. The ✕ says it and does it.
|
|
27547
|
+
*
|
|
27548
|
+
* THREE DECISIONS THAT ARE NOT OBVIOUS:
|
|
27549
|
+
*
|
|
27550
|
+
* - **It shows while the filter has content, focused or not.**
|
|
27551
|
+
* The opposite of a form's ✕ (`yui_inputs.js`), which appears
|
|
27552
|
+
* only on the field being edited so as not to light a cross on
|
|
27553
|
+
* every filled field. Here the use case is the reverse: the
|
|
27554
|
+
* filter is already set, the focus is elsewhere, and what is
|
|
27555
|
+
* wanted is to see it and remove it. Hidden behind the focus it
|
|
27556
|
+
* would take two clicks.
|
|
27557
|
+
*
|
|
27558
|
+
* - **It clears through the API, not by faking keys.**
|
|
27559
|
+
* `setHeaderFilterValue(field, "")` is what Tabulator offers,
|
|
27560
|
+
* and it keeps the value and the filter consistent. Synthesising
|
|
27561
|
+
* an `input` on the `<input>` depends on what that filter's
|
|
27562
|
+
* editor listens to, which changes with the column type.
|
|
27563
|
+
*
|
|
27564
|
+
* - **The header is walked, the editor is not wrapped.** The
|
|
27565
|
+
* columns are built from the topic's schema, so there is no
|
|
27566
|
+
* single place to wrap the editor; and the header rebuilds
|
|
27567
|
+
* itself when the columns change. The walk is idempotent -- it
|
|
27568
|
+
* marks what already has its cross -- and is triggered by a
|
|
27569
|
+
* one-pass `querySelector`, so repeating it on every render
|
|
27570
|
+
* costs nothing.
|
|
27236
27571
|
*
|
|
27237
27572
|
* Copyright (c) 2026, ArtGins.
|
|
27238
27573
|
* All Rights Reserved.
|
|
27239
27574
|
***********************************************************************/
|
|
27240
27575
|
var MARK = "data-yui-filter-clear";
|
|
27241
27576
|
/***************************************************************
|
|
27242
|
-
*
|
|
27577
|
+
* Put (or put back) the ✕ of every header filter of `table`.
|
|
27243
27578
|
*
|
|
27244
|
-
*
|
|
27579
|
+
* Idempotent: the ones that already have it are skipped.
|
|
27245
27580
|
***************************************************************/
|
|
27246
27581
|
function decorate(table) {
|
|
27247
27582
|
if (!table || !table.element) return;
|
|
@@ -27279,11 +27614,11 @@ function decorate(table) {
|
|
|
27279
27614
|
}
|
|
27280
27615
|
}
|
|
27281
27616
|
/***************************************************************
|
|
27282
|
-
*
|
|
27617
|
+
* Hook the ✕ onto a table already created.
|
|
27283
27618
|
*
|
|
27284
|
-
*
|
|
27285
|
-
*
|
|
27286
|
-
*
|
|
27619
|
+
* Called once, with the table built. The hooks cover the two
|
|
27620
|
+
* moments the header appears or is rebuilt: when it is built
|
|
27621
|
+
* and when the columns change.
|
|
27287
27622
|
***************************************************************/
|
|
27288
27623
|
function yui_table_filter_clear(table) {
|
|
27289
27624
|
if (!table) return;
|
|
@@ -27933,6 +28268,7 @@ function mt_stop$5(gobj) {
|
|
|
27933
28268
|
close_cell_file_dialog(gobj);
|
|
27934
28269
|
close_hook_choice(gobj);
|
|
27935
28270
|
drop_pending_assets(gobj);
|
|
28271
|
+
drop_pending_pages(gobj);
|
|
27936
28272
|
table__destroy(gobj);
|
|
27937
28273
|
}
|
|
27938
28274
|
/***************************************************************
|
|
@@ -28852,6 +29188,7 @@ function create_tabulator(gobj) {
|
|
|
28852
29188
|
else try {
|
|
28853
29189
|
n = tabulator.getDataCount("active");
|
|
28854
29190
|
} catch (e) {
|
|
29191
|
+
(0, _yuneta_gobj_js.log_warning)(`${(0, _yuneta_gobj_js.gobj_short_name)(gobj)}: cannot count the table's rows: ${e}`);
|
|
28855
29192
|
n = 0;
|
|
28856
29193
|
}
|
|
28857
29194
|
let paged = (0, _yuneta_gobj_js.gobj_read_bool_attr)(gobj, "with_remote_paging");
|
|
@@ -29081,7 +29418,9 @@ function build_json_cell_preview(value) {
|
|
|
29081
29418
|
{
|
|
29082
29419
|
class: "JSON_CELL",
|
|
29083
29420
|
title: (0, i18next.t)("show json"),
|
|
29084
|
-
"data-i18n-title": "show json"
|
|
29421
|
+
"data-i18n-title": "show json",
|
|
29422
|
+
"aria-label": (0, i18next.t)("show json"),
|
|
29423
|
+
"data-i18n-aria-label": "show json"
|
|
29085
29424
|
},
|
|
29086
29425
|
[["span", { class: "JSON_CELL_ICON icon yi-eye" }], [
|
|
29087
29426
|
"span",
|
|
@@ -30081,33 +30420,15 @@ function transform__form_value_2_treedb_value(gobj, col, value, operation) {
|
|
|
30081
30420
|
case "object":
|
|
30082
30421
|
case "dict":
|
|
30083
30422
|
case "template":
|
|
30084
|
-
if ((0, _yuneta_gobj_js.is_string)(value)) try {
|
|
30085
|
-
value = JSON.parse(value);
|
|
30086
|
-
} catch (e) {
|
|
30087
|
-
value = {};
|
|
30088
|
-
}
|
|
30089
|
-
else if ((0, _yuneta_gobj_js.is_object)(value)) {}
|
|
30090
|
-
if (!(0, _yuneta_gobj_js.is_object)(value)) value = {};
|
|
30091
|
-
break;
|
|
30092
30423
|
case "array":
|
|
30093
30424
|
case "list":
|
|
30094
|
-
if ((0, _yuneta_gobj_js.is_string)(value)) try {
|
|
30095
|
-
value = JSON.parse(value);
|
|
30096
|
-
} catch (e) {
|
|
30097
|
-
value = [];
|
|
30098
|
-
}
|
|
30099
|
-
else if ((0, _yuneta_gobj_js.is_array)(value)) {}
|
|
30100
|
-
if (!(0, _yuneta_gobj_js.is_array)(value)) value = [];
|
|
30101
|
-
break;
|
|
30102
30425
|
case "coordinates":
|
|
30103
|
-
case "blob":
|
|
30104
|
-
|
|
30105
|
-
|
|
30106
|
-
|
|
30107
|
-
value = {};
|
|
30108
|
-
}
|
|
30109
|
-
else if ((0, _yuneta_gobj_js.is_object)(value)) {} else if ((0, _yuneta_gobj_js.is_array)(value)) {} else value = {};
|
|
30426
|
+
case "blob": {
|
|
30427
|
+
let r = parse_json_field(value, field_desc.type);
|
|
30428
|
+
if (r.error) (0, _yuneta_gobj_js.log_warning)(`${(0, _yuneta_gobj_js.gobj_short_name)(gobj)}: column '${col.id}' (${field_desc.type}) holds no valid json, taken as empty`);
|
|
30429
|
+
value = r.value;
|
|
30110
30430
|
break;
|
|
30431
|
+
}
|
|
30111
30432
|
case "enum":
|
|
30112
30433
|
switch (field_desc.real_type) {
|
|
30113
30434
|
case "string":
|
|
@@ -31066,6 +31387,21 @@ function request_page(gobj, page, size) {
|
|
|
31066
31387
|
});
|
|
31067
31388
|
}
|
|
31068
31389
|
/************************************************************
|
|
31390
|
+
* The view stops: no page request is waited for any more. Each
|
|
31391
|
+
* one's watchdog would otherwise fire EV_PAGE_TIMEOUT on a gobj
|
|
31392
|
+
* stopped -- or destroyed -- 20 s later.
|
|
31393
|
+
************************************************************/
|
|
31394
|
+
function drop_pending_pages(gobj) {
|
|
31395
|
+
let priv = gobj.priv;
|
|
31396
|
+
let pending = priv._pending_pages || {};
|
|
31397
|
+
priv._pending_pages = {};
|
|
31398
|
+
for (let req_id of Object.keys(pending)) {
|
|
31399
|
+
let pend = pending[req_id];
|
|
31400
|
+
if (pend.timer) window.clearTimeout(pend.timer);
|
|
31401
|
+
pend.reject(/* @__PURE__ */ new Error("the view stopped"));
|
|
31402
|
+
}
|
|
31403
|
+
}
|
|
31404
|
+
/************************************************************
|
|
31069
31405
|
* Settle a parked page request, however it ended.
|
|
31070
31406
|
************************************************************/
|
|
31071
31407
|
function settle_page(gobj, req_id, value, error) {
|
|
@@ -63354,6 +63690,7 @@ function start_node_resize(gobj, e, mx, my) {
|
|
|
63354
63690
|
function onPointerUp(ev) {
|
|
63355
63691
|
document.removeEventListener("pointermove", onPointerMove);
|
|
63356
63692
|
document.removeEventListener("pointerup", onPointerUp);
|
|
63693
|
+
document.removeEventListener("pointercancel", onPointerCancel);
|
|
63357
63694
|
const dLeft = (currentRect.left - origVpRect.left) / zoom;
|
|
63358
63695
|
const dTop = (currentRect.top - origVpRect.top) / zoom;
|
|
63359
63696
|
const dRight = (currentRect.right - origVpRect.right) / zoom;
|
|
@@ -63387,8 +63724,15 @@ function start_node_resize(gobj, e, mx, my) {
|
|
|
63387
63724
|
mark_graph_dirty(gobj);
|
|
63388
63725
|
});
|
|
63389
63726
|
}
|
|
63727
|
+
function onPointerCancel(ev) {
|
|
63728
|
+
document.removeEventListener("pointermove", onPointerMove);
|
|
63729
|
+
document.removeEventListener("pointerup", onPointerUp);
|
|
63730
|
+
document.removeEventListener("pointercancel", onPointerCancel);
|
|
63731
|
+
update_resize_handles_position(gobj);
|
|
63732
|
+
}
|
|
63390
63733
|
document.addEventListener("pointermove", onPointerMove);
|
|
63391
63734
|
document.addEventListener("pointerup", onPointerUp);
|
|
63735
|
+
document.addEventListener("pointercancel", onPointerCancel);
|
|
63392
63736
|
}
|
|
63393
63737
|
/************************************************************
|
|
63394
63738
|
* Port selection and individual port resizing
|
|
@@ -63976,6 +64320,7 @@ function start_link_drag(gobj, e) {
|
|
|
63976
64320
|
function onPointerUp(ev) {
|
|
63977
64321
|
document.removeEventListener("pointermove", onPointerMove);
|
|
63978
64322
|
document.removeEventListener("pointerup", onPointerUp);
|
|
64323
|
+
document.removeEventListener("pointercancel", onPointerCancel);
|
|
63979
64324
|
priv.$container.style.cursor = "";
|
|
63980
64325
|
if (priv._link_drag_svg) {
|
|
63981
64326
|
priv._link_drag_svg.remove();
|
|
@@ -63989,8 +64334,20 @@ function start_link_drag(gobj, e) {
|
|
|
63989
64334
|
if (target) try_complete_link(gobj, target.node_id, target.port_key);
|
|
63990
64335
|
else exit_linking_mode(gobj);
|
|
63991
64336
|
}
|
|
64337
|
+
function onPointerCancel(ev) {
|
|
64338
|
+
document.removeEventListener("pointermove", onPointerMove);
|
|
64339
|
+
document.removeEventListener("pointerup", onPointerUp);
|
|
64340
|
+
document.removeEventListener("pointercancel", onPointerCancel);
|
|
64341
|
+
priv.$container.style.cursor = "";
|
|
64342
|
+
if (priv._link_drag_svg) {
|
|
64343
|
+
priv._link_drag_svg.remove();
|
|
64344
|
+
priv._link_drag_svg = null;
|
|
64345
|
+
}
|
|
64346
|
+
exit_linking_mode(gobj);
|
|
64347
|
+
}
|
|
63992
64348
|
document.addEventListener("pointermove", onPointerMove);
|
|
63993
64349
|
document.addEventListener("pointerup", onPointerUp);
|
|
64350
|
+
document.addEventListener("pointercancel", onPointerCancel);
|
|
63994
64351
|
}
|
|
63995
64352
|
/************************************************************
|
|
63996
64353
|
* Find if a canvas point hits a valid hook port during
|
|
@@ -64177,6 +64534,7 @@ function start_port_resize(gobj, e) {
|
|
|
64177
64534
|
function onPointerUp(ev) {
|
|
64178
64535
|
document.removeEventListener("pointermove", onPointerMove);
|
|
64179
64536
|
document.removeEventListener("pointerup", onPointerUp);
|
|
64537
|
+
document.removeEventListener("pointercancel", onPointerCancel);
|
|
64180
64538
|
const dx = ev.clientX - clientCx;
|
|
64181
64539
|
const dy = ev.clientY - clientCy;
|
|
64182
64540
|
let vpR = Math.max(PORT_HANDLE_SIZE, Math.sqrt(dx * dx + dy * dy));
|
|
@@ -64199,8 +64557,15 @@ function start_port_resize(gobj, e) {
|
|
|
64199
64557
|
mark_graph_dirty(gobj);
|
|
64200
64558
|
});
|
|
64201
64559
|
}
|
|
64560
|
+
function onPointerCancel(ev) {
|
|
64561
|
+
document.removeEventListener("pointermove", onPointerMove);
|
|
64562
|
+
document.removeEventListener("pointerup", onPointerUp);
|
|
64563
|
+
document.removeEventListener("pointercancel", onPointerCancel);
|
|
64564
|
+
update_port_resize_handles_position(gobj);
|
|
64565
|
+
}
|
|
64202
64566
|
document.addEventListener("pointermove", onPointerMove);
|
|
64203
64567
|
document.addEventListener("pointerup", onPointerUp);
|
|
64568
|
+
document.addEventListener("pointercancel", onPointerCancel);
|
|
64204
64569
|
}
|
|
64205
64570
|
/************************************************************
|
|
64206
64571
|
* Edge selection: show a floating properties icon near
|
|
@@ -72259,6 +72624,7 @@ var JSON_FIELDS$1 = [
|
|
|
72259
72624
|
"properties",
|
|
72260
72625
|
"pkey2s"
|
|
72261
72626
|
];
|
|
72627
|
+
var C_BACKSLASH = "\\\\";
|
|
72262
72628
|
var JSON_BACKSLASH = "\\\\\\\\";
|
|
72263
72629
|
var JSON_DQUOTE = "\\\\\\\"";
|
|
72264
72630
|
var JSON_QUOTE = "\\\\u0027";
|
|
@@ -72364,7 +72730,19 @@ function c_scalar(value, key) {
|
|
|
72364
72730
|
* themselves.
|
|
72365
72731
|
***************************************************************/
|
|
72366
72732
|
function c_text(text) {
|
|
72367
|
-
return text.replace(/\\/g, JSON_BACKSLASH).replace(/"/g, JSON_DQUOTE).replace(/'/g, JSON_QUOTE);
|
|
72733
|
+
return text.replace(/\\/g, JSON_BACKSLASH).replace(/"/g, JSON_DQUOTE).replace(/'/g, JSON_QUOTE).replace(/[\u0000-\u001f\u007f]/g, json_control);
|
|
72734
|
+
}
|
|
72735
|
+
var JSON_SHORT_ESCAPES = {
|
|
72736
|
+
"\n": "n",
|
|
72737
|
+
"\r": "r",
|
|
72738
|
+
" ": "t",
|
|
72739
|
+
"\b": "b",
|
|
72740
|
+
"\f": "f"
|
|
72741
|
+
};
|
|
72742
|
+
function json_control(ch) {
|
|
72743
|
+
let short = JSON_SHORT_ESCAPES[ch];
|
|
72744
|
+
if (short) return C_BACKSLASH + short;
|
|
72745
|
+
return "\\\\u" + ch.charCodeAt(0).toString(16).padStart(4, "0");
|
|
72368
72746
|
}
|
|
72369
72747
|
/***************************************************************
|
|
72370
72748
|
* Render a value at `indent`, appending its lines to `lines`.
|
|
@@ -78685,16 +79063,19 @@ function build_ui(gobj) {
|
|
|
78685
79063
|
(0, _yuneta_gobj_js.gobj_write_attr)(gobj, "$container", $container);
|
|
78686
79064
|
}
|
|
78687
79065
|
function build_mode_button(gobj, mode) {
|
|
79066
|
+
let name = mode_name(mode);
|
|
78688
79067
|
let $btn = (0, _yuneta_gobj_js.createElement2)([
|
|
78689
79068
|
"button",
|
|
78690
79069
|
{
|
|
78691
79070
|
class: `button YUI_PERIOD_MODE YUI_PERIOD_MODE_${mode.id.toUpperCase()}`,
|
|
78692
|
-
type: "button"
|
|
79071
|
+
type: "button",
|
|
79072
|
+
title: name,
|
|
79073
|
+
"aria-label": name
|
|
78693
79074
|
},
|
|
78694
79075
|
[[
|
|
78695
79076
|
"span",
|
|
78696
79077
|
{ class: "YUI_PERIOD_MODE_TEXT" },
|
|
78697
|
-
|
|
79078
|
+
name
|
|
78698
79079
|
]]
|
|
78699
79080
|
]);
|
|
78700
79081
|
$btn.addEventListener("click", () => {
|
|
@@ -78716,16 +79097,19 @@ function build_more_menu(gobj) {
|
|
|
78716
79097
|
]);
|
|
78717
79098
|
for (let mode of priv.modes) {
|
|
78718
79099
|
if (!mode.overflow) continue;
|
|
79100
|
+
let name = mode_name(mode);
|
|
78719
79101
|
let $item = (0, _yuneta_gobj_js.createElement2)([
|
|
78720
79102
|
"a",
|
|
78721
79103
|
{
|
|
78722
79104
|
class: `dropdown-item YUI_PERIOD_MODE YUI_PERIOD_MODE_${mode.id.toUpperCase()}`,
|
|
78723
|
-
href: "#"
|
|
79105
|
+
href: "#",
|
|
79106
|
+
title: name,
|
|
79107
|
+
"aria-label": name
|
|
78724
79108
|
},
|
|
78725
79109
|
[[
|
|
78726
79110
|
"span",
|
|
78727
79111
|
{ class: "YUI_PERIOD_MODE_TEXT" },
|
|
78728
|
-
|
|
79112
|
+
name
|
|
78729
79113
|
]]
|
|
78730
79114
|
]);
|
|
78731
79115
|
$item.addEventListener("click", (ev) => {
|
|
@@ -79023,7 +79407,11 @@ function render_calendar(gobj) {
|
|
|
79023
79407
|
"button",
|
|
79024
79408
|
{
|
|
79025
79409
|
class: "button is-ghost mt-2 YUI_PERIOD_CAL_TODAY",
|
|
79026
|
-
type: "button"
|
|
79410
|
+
type: "button",
|
|
79411
|
+
title: (0, i18next.t)("today"),
|
|
79412
|
+
"data-i18n-title": "today",
|
|
79413
|
+
"aria-label": (0, i18next.t)("today"),
|
|
79414
|
+
"data-i18n-aria-label": "today"
|
|
79027
79415
|
},
|
|
79028
79416
|
[[
|
|
79029
79417
|
"span",
|
|
@@ -79351,8 +79739,11 @@ function ac_language_changed(gobj, event, kw, src) {
|
|
|
79351
79739
|
let priv = gobj.priv;
|
|
79352
79740
|
for (let mode of priv.modes) {
|
|
79353
79741
|
if (!mode.$btn) continue;
|
|
79742
|
+
let name = mode_name(mode);
|
|
79354
79743
|
let $text = mode.$btn.querySelector(".YUI_PERIOD_MODE_TEXT");
|
|
79355
|
-
if ($text) $text.textContent =
|
|
79744
|
+
if ($text) $text.textContent = name;
|
|
79745
|
+
mode.$btn.setAttribute("title", name);
|
|
79746
|
+
mode.$btn.setAttribute("aria-label", name);
|
|
79356
79747
|
}
|
|
79357
79748
|
repaint(gobj);
|
|
79358
79749
|
if (priv.$calendar) render_calendar(gobj);
|
|
@@ -80784,7 +81175,9 @@ function build_control_bar() {
|
|
|
80784
81175
|
"data-dir": key,
|
|
80785
81176
|
type: "button",
|
|
80786
81177
|
title: (0, i18next.t)(title),
|
|
80787
|
-
"data-i18n-title": title
|
|
81178
|
+
"data-i18n-title": title,
|
|
81179
|
+
"aria-label": (0, i18next.t)(title),
|
|
81180
|
+
"data-i18n-aria-label": title
|
|
80788
81181
|
},
|
|
80789
81182
|
glyph,
|
|
80790
81183
|
{ click: (ev) => {
|