@yuneta/gobj-ui 5.11.1 → 5.12.0
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/dist/gobj-ui.cjs.js +877 -524
- package/dist/gobj-ui.es.js +879 -525
- package/package.json +2 -2
- package/src/c_yui_json.js +8 -0
- package/src/c_yui_treedb_topic_with_form.js +150 -0
package/dist/gobj-ui.es.js
CHANGED
|
@@ -33,7 +33,7 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
33
33
|
}
|
|
34
34
|
return to;
|
|
35
35
|
};
|
|
36
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
36
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule || !__hasOwnProp.call(mod, "default") ? __defProp(target, "default", {
|
|
37
37
|
value: mod,
|
|
38
38
|
enumerable: true
|
|
39
39
|
}) : target, mod));
|
|
@@ -1345,10 +1345,11 @@ function instantiate_menus(gobj, config) {
|
|
|
1345
1345
|
let renders = secondary_nav_renders(item, render_to_obj(layout));
|
|
1346
1346
|
let sub_menu_id = `secondary.${menu_id}.${item.id}`;
|
|
1347
1347
|
for (let render_cfg of renders) {
|
|
1348
|
-
let
|
|
1348
|
+
let nav = instantiate_nav_in_zone(gobj, {
|
|
1349
1349
|
items: sub.items,
|
|
1350
1350
|
render: { [zone_id]: render_cfg }
|
|
1351
|
-
}, sub_menu_id, zone_id, "secondary", item.name || "")
|
|
1351
|
+
}, sub_menu_id, zone_id, "secondary", item.name || "");
|
|
1352
|
+
let $c = gobj_read_attr(nav, "$container");
|
|
1352
1353
|
if ($c) $c.classList.add("is-hidden");
|
|
1353
1354
|
}
|
|
1354
1355
|
}
|
|
@@ -1365,7 +1366,8 @@ function instantiate_nav_in_zone(gobj, menu, menu_id, zone_id, level, nav_label)
|
|
|
1365
1366
|
let render_cfg = menu.render && (menu.render[zone_id] || menu.render["*"]) || { layout: "vertical" };
|
|
1366
1367
|
if (is_string(render_cfg)) render_cfg = { layout: render_cfg };
|
|
1367
1368
|
let layout = render_cfg.layout || "vertical";
|
|
1368
|
-
let
|
|
1369
|
+
let nav_name = `nav_${menu_id.replace(/\./g, "_")}_${zone_id}` + (layout === "backbar" ? "_backbar" : "");
|
|
1370
|
+
let nav = gobj_create(nav_name, "C_YUI_NAV", {
|
|
1369
1371
|
menu_id,
|
|
1370
1372
|
nav_label: nav_label || "",
|
|
1371
1373
|
menu_items: menu.items || [],
|
|
@@ -1891,14 +1893,15 @@ function build_toolbar_connection_item(gobj, it) {
|
|
|
1891
1893
|
attrs.title = tip;
|
|
1892
1894
|
attrs["data-i18n-title"] = tip;
|
|
1893
1895
|
}
|
|
1896
|
+
let $dot = createElement2([
|
|
1897
|
+
"span",
|
|
1898
|
+
{ class: "yui-conn-dot" },
|
|
1899
|
+
""
|
|
1900
|
+
]);
|
|
1894
1901
|
let $item = createElement2([
|
|
1895
1902
|
"button",
|
|
1896
1903
|
attrs,
|
|
1897
|
-
[
|
|
1898
|
-
"span",
|
|
1899
|
-
{ class: "yui-conn-dot" },
|
|
1900
|
-
""
|
|
1901
|
-
])]
|
|
1904
|
+
[$dot]
|
|
1902
1905
|
]);
|
|
1903
1906
|
if ((it.action && it.action.type || "") !== "") $item.addEventListener("click", (ev) => {
|
|
1904
1907
|
ev.preventDefault();
|
|
@@ -1935,11 +1938,13 @@ function handle_toolbar_action(gobj, item, $trigger) {
|
|
|
1935
1938
|
let action = item && item.action || {};
|
|
1936
1939
|
switch (action.type) {
|
|
1937
1940
|
case "navigate":
|
|
1938
|
-
if (!empty_string(action.route))
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1941
|
+
if (!empty_string(action.route)) {
|
|
1942
|
+
if (gobj_read_attr(gobj, "use_hash") && !route_restores_url(gobj, action.route)) {
|
|
1943
|
+
let h = route_to_hash(action.route);
|
|
1944
|
+
if (window.location.hash !== h) window.location.hash = h;
|
|
1945
|
+
else navigate_to(gobj, action.route);
|
|
1946
|
+
} else navigate_to(gobj, action.route);
|
|
1947
|
+
}
|
|
1943
1948
|
break;
|
|
1944
1949
|
case "drawer": {
|
|
1945
1950
|
let op = action.op || "toggle";
|
|
@@ -1975,11 +1980,13 @@ function toggle_toolbar_dropdown(gobj, item, action, $trigger) {
|
|
|
1975
1980
|
function open_toolbar_dropdown(gobj, item, action, $trigger) {
|
|
1976
1981
|
let priv = gobj.priv;
|
|
1977
1982
|
if (!priv || !priv.layers || !priv.layers.popup) return;
|
|
1983
|
+
let aria_key = item && (item.aria_label || item.name || item.id) || "Menu";
|
|
1984
|
+
let i18n_aria = item && (item.aria_label || item.name) || "Menu";
|
|
1978
1985
|
let $panel = createElement2(["div", {
|
|
1979
1986
|
class: "yui-toolbar-dropdown-panel",
|
|
1980
1987
|
role: "menu",
|
|
1981
|
-
"aria-label":
|
|
1982
|
-
"data-i18n-aria-label":
|
|
1988
|
+
"aria-label": aria_key,
|
|
1989
|
+
"data-i18n-aria-label": i18n_aria,
|
|
1983
1990
|
"data-toolbar-dropdown-for": item && item.id || ""
|
|
1984
1991
|
}]);
|
|
1985
1992
|
let raw_items = is_array(action.items) ? action.items : [];
|
|
@@ -2449,14 +2456,15 @@ function create_gclass$18(gclass_name) {
|
|
|
2449
2456
|
null
|
|
2450
2457
|
]
|
|
2451
2458
|
]]];
|
|
2452
|
-
|
|
2459
|
+
const event_types = [
|
|
2453
2460
|
["EV_NAV_CLICKED", 0],
|
|
2454
2461
|
["EV_DRAWER_CLOSE_REQUESTED", 0],
|
|
2455
2462
|
["EV_NAV_ITEM_CLOSE", event_flag_t.EVF_OUTPUT_EVENT | event_flag_t.EVF_PUBLIC_EVENT | event_flag_t.EVF_NO_WARN_SUBS],
|
|
2456
2463
|
["EV_ROUTE_REQUESTED", event_flag_t.EVF_OUTPUT_EVENT | event_flag_t.EVF_PUBLIC_EVENT | event_flag_t.EVF_NO_WARN_SUBS],
|
|
2457
2464
|
["EV_ROUTE_CHANGED", event_flag_t.EVF_OUTPUT_EVENT | event_flag_t.EVF_PUBLIC_EVENT | event_flag_t.EVF_NO_WARN_SUBS],
|
|
2458
2465
|
["EV_LANGUAGE_CHANGED", event_flag_t.EVF_OUTPUT_EVENT | event_flag_t.EVF_PUBLIC_EVENT | event_flag_t.EVF_NO_WARN_SUBS]
|
|
2459
|
-
]
|
|
2466
|
+
];
|
|
2467
|
+
__gclass__$18 = gclass_create(gclass_name, event_types, states, gmt$18, 0, attrs_table$18, PRIVATE_DATA$18, 0, 0, 0, gclass_flag_t.gcflag_no_check_output_events);
|
|
2460
2468
|
if (!__gclass__$18) return -1;
|
|
2461
2469
|
return 0;
|
|
2462
2470
|
}
|
|
@@ -3136,10 +3144,11 @@ function build_dialog(shell, message, buttons, opts) {
|
|
|
3136
3144
|
{ class: "CONFIRM_FOOT modal-card-foot" },
|
|
3137
3145
|
$footer_children
|
|
3138
3146
|
]);
|
|
3147
|
+
let logical = opts && opts.logical_class ? " " + opts.logical_class : "";
|
|
3139
3148
|
let $modal = createElement2([
|
|
3140
3149
|
"div",
|
|
3141
3150
|
{
|
|
3142
|
-
class: `CONFIRM${
|
|
3151
|
+
class: `CONFIRM${logical} modal yui-modal yui-confirm is-active is-${type}`,
|
|
3143
3152
|
role: "dialog",
|
|
3144
3153
|
"aria-modal": "true"
|
|
3145
3154
|
},
|
|
@@ -3325,7 +3334,8 @@ var __gclass__$17 = null;
|
|
|
3325
3334
|
function mt_create$17(gobj) {
|
|
3326
3335
|
const subscriber = gobj_read_pointer_attr(gobj, "subscriber");
|
|
3327
3336
|
if (subscriber) gobj_subscribe_event(gobj, null, {}, subscriber);
|
|
3328
|
-
|
|
3337
|
+
let window_id = "window-" + clean_name(gobj_short_name(gobj));
|
|
3338
|
+
gobj_write_attr(gobj, "window_id", window_id);
|
|
3329
3339
|
let manager = resolve_manager(gobj);
|
|
3330
3340
|
build_ui$14(gobj);
|
|
3331
3341
|
if (manager) {
|
|
@@ -3345,9 +3355,12 @@ function mt_create$17(gobj) {
|
|
|
3345
3355
|
}, gobj);
|
|
3346
3356
|
} else if (gobj_read_bool_attr(gobj, "back_dismissable")) {
|
|
3347
3357
|
let shell = yui_shell_of(gobj);
|
|
3348
|
-
if (shell)
|
|
3349
|
-
|
|
3350
|
-
|
|
3358
|
+
if (shell) {
|
|
3359
|
+
let overlay = yui_shell_register_overlay(shell, function() {
|
|
3360
|
+
close_window(gobj);
|
|
3361
|
+
}, { keep_on_navigate: gobj_read_bool_attr(gobj, "keep_on_navigate") });
|
|
3362
|
+
gobj_write_attr(gobj, "back_overlay", overlay);
|
|
3363
|
+
}
|
|
3351
3364
|
}
|
|
3352
3365
|
let on_win_resize = function() {
|
|
3353
3366
|
handleResize(gobj);
|
|
@@ -3453,16 +3466,18 @@ function build_default_header(gobj) {
|
|
|
3453
3466
|
if (empty_string(title) && empty_string(prefix)) return null;
|
|
3454
3467
|
let icon = gobj_read_str_attr(gobj, "icon");
|
|
3455
3468
|
let items = [];
|
|
3456
|
-
if (!empty_string(icon))
|
|
3457
|
-
"
|
|
3458
|
-
|
|
3459
|
-
|
|
3460
|
-
|
|
3461
|
-
|
|
3462
|
-
|
|
3463
|
-
|
|
3464
|
-
|
|
3465
|
-
|
|
3469
|
+
if (!empty_string(icon)) {
|
|
3470
|
+
if (icon.charAt(0) === "<") items.push([
|
|
3471
|
+
"span",
|
|
3472
|
+
{ class: "icon" },
|
|
3473
|
+
icon
|
|
3474
|
+
]);
|
|
3475
|
+
else items.push([
|
|
3476
|
+
"span",
|
|
3477
|
+
{ class: "icon" },
|
|
3478
|
+
[["i", { class: icon }]]
|
|
3479
|
+
]);
|
|
3480
|
+
}
|
|
3466
3481
|
if (!empty_string(prefix)) items.push([
|
|
3467
3482
|
"span",
|
|
3468
3483
|
{ class: "WINDOW_TITLE_PREFIX has-text-weight-semibold" },
|
|
@@ -4121,7 +4136,7 @@ function create_gclass$17(gclass_name) {
|
|
|
4121
4136
|
null
|
|
4122
4137
|
]
|
|
4123
4138
|
]]];
|
|
4124
|
-
|
|
4139
|
+
const event_types = [
|
|
4125
4140
|
["EV_WINDOW_TO_CLOSE", event_flag_t.EVF_OUTPUT_EVENT | event_flag_t.EVF_NO_WARN_SUBS],
|
|
4126
4141
|
["EV_WINDOW_MOVED", event_flag_t.EVF_OUTPUT_EVENT | event_flag_t.EVF_NO_WARN_SUBS],
|
|
4127
4142
|
["EV_WINDOW_RESIZED", event_flag_t.EVF_OUTPUT_EVENT | event_flag_t.EVF_NO_WARN_SUBS],
|
|
@@ -4129,7 +4144,8 @@ function create_gclass$17(gclass_name) {
|
|
|
4129
4144
|
["EV_SHOW", 0],
|
|
4130
4145
|
["EV_HIDE", 0],
|
|
4131
4146
|
["EV_CLOSE_WINDOW", 0]
|
|
4132
|
-
]
|
|
4147
|
+
];
|
|
4148
|
+
__gclass__$17 = gclass_create(gclass_name, event_types, states, gmt$17, 0, attrs_table$17, PRIVATE_DATA$17, 0, 0, 0, 0);
|
|
4133
4149
|
if (!__gclass__$17) return -1;
|
|
4134
4150
|
return 0;
|
|
4135
4151
|
}
|
|
@@ -4310,11 +4326,12 @@ function ensure_dock_style() {
|
|
|
4310
4326
|
************************************************************/
|
|
4311
4327
|
function build_dock(gobj) {
|
|
4312
4328
|
ensure_dock_style();
|
|
4313
|
-
|
|
4329
|
+
let $dock = createElement2([
|
|
4314
4330
|
"div",
|
|
4315
4331
|
{ class: "C_YUI_WINDOW_MANAGER yui-dock is-empty" },
|
|
4316
4332
|
[]
|
|
4317
|
-
])
|
|
4333
|
+
]);
|
|
4334
|
+
gobj_write_attr(gobj, "$container", $dock);
|
|
4318
4335
|
apply_placement(gobj);
|
|
4319
4336
|
}
|
|
4320
4337
|
/************************************************************
|
|
@@ -4765,7 +4782,7 @@ function mt_destroy$15(gobj) {
|
|
|
4765
4782
|
* Build UI
|
|
4766
4783
|
************************************************************/
|
|
4767
4784
|
function build_ui$13(gobj) {
|
|
4768
|
-
|
|
4785
|
+
let $container = createElement2([
|
|
4769
4786
|
"div",
|
|
4770
4787
|
{
|
|
4771
4788
|
class: "C_YUI_PAGER",
|
|
@@ -4834,7 +4851,8 @@ function build_ui$13(gobj) {
|
|
|
4834
4851
|
},
|
|
4835
4852
|
[]
|
|
4836
4853
|
]]
|
|
4837
|
-
])
|
|
4854
|
+
]);
|
|
4855
|
+
gobj_write_attr(gobj, "$container", $container);
|
|
4838
4856
|
}
|
|
4839
4857
|
/************************************************************
|
|
4840
4858
|
* Destroy UI
|
|
@@ -5094,7 +5112,7 @@ function create_gclass$15(gclass_name) {
|
|
|
5094
5112
|
null
|
|
5095
5113
|
]
|
|
5096
5114
|
]]];
|
|
5097
|
-
|
|
5115
|
+
const event_types = [
|
|
5098
5116
|
["EV_PUSH_PAGE", 0],
|
|
5099
5117
|
["EV_POP_PAGE", 0],
|
|
5100
5118
|
["EV_BACK", 0],
|
|
@@ -5107,7 +5125,8 @@ function create_gclass$15(gclass_name) {
|
|
|
5107
5125
|
["EV_PAGE_SHOWN", event_flag_t.EVF_OUTPUT_EVENT | event_flag_t.EVF_NO_WARN_SUBS],
|
|
5108
5126
|
["EV_PAGE_DISCARD", event_flag_t.EVF_OUTPUT_EVENT],
|
|
5109
5127
|
["EV_PAGER_EXIT", event_flag_t.EVF_OUTPUT_EVENT]
|
|
5110
|
-
]
|
|
5128
|
+
];
|
|
5129
|
+
__gclass__$15 = gclass_create(gclass_name, event_types, states, gmt$15, 0, attrs_table$15, PRIVATE_DATA$15, 0, 0, 0, 0);
|
|
5111
5130
|
if (!__gclass__$15) return -1;
|
|
5112
5131
|
return 0;
|
|
5113
5132
|
}
|
|
@@ -5297,7 +5316,7 @@ function mt_destroy$14(gobj) {
|
|
|
5297
5316
|
* Build UI
|
|
5298
5317
|
************************************************************/
|
|
5299
5318
|
function build_ui$12(gobj) {
|
|
5300
|
-
|
|
5319
|
+
let $container = createElement2([
|
|
5301
5320
|
"div",
|
|
5302
5321
|
{
|
|
5303
5322
|
class: "C_YUI_WIZARD",
|
|
@@ -5383,7 +5402,8 @@ function build_ui$12(gobj) {
|
|
|
5383
5402
|
]]
|
|
5384
5403
|
]
|
|
5385
5404
|
]
|
|
5386
|
-
])
|
|
5405
|
+
]);
|
|
5406
|
+
gobj_write_attr(gobj, "$container", $container);
|
|
5387
5407
|
}
|
|
5388
5408
|
/************************************************************
|
|
5389
5409
|
* Destroy UI
|
|
@@ -5709,7 +5729,7 @@ function create_gclass$14(gclass_name) {
|
|
|
5709
5729
|
null
|
|
5710
5730
|
]
|
|
5711
5731
|
]]];
|
|
5712
|
-
|
|
5732
|
+
const event_types = [
|
|
5713
5733
|
["EV_SET_STEPS", 0],
|
|
5714
5734
|
["EV_NEXT", 0],
|
|
5715
5735
|
["EV_PREV", 0],
|
|
@@ -5725,7 +5745,8 @@ function create_gclass$14(gclass_name) {
|
|
|
5725
5745
|
["EV_WIZARD_DONE", event_flag_t.EVF_OUTPUT_EVENT],
|
|
5726
5746
|
["EV_WIZARD_CANCEL", event_flag_t.EVF_OUTPUT_EVENT],
|
|
5727
5747
|
["EV_STEP_VALIDATE", event_flag_t.EVF_OUTPUT_EVENT | event_flag_t.EVF_NO_WARN_SUBS]
|
|
5728
|
-
]
|
|
5748
|
+
];
|
|
5749
|
+
__gclass__$14 = gclass_create(gclass_name, event_types, states, gmt$14, 0, attrs_table$14, PRIVATE_DATA$14, 0, 0, 0, 0);
|
|
5729
5750
|
if (!__gclass__$14) return -1;
|
|
5730
5751
|
return 0;
|
|
5731
5752
|
}
|
|
@@ -6008,7 +6029,8 @@ function mt_create$13(gobj) {
|
|
|
6008
6029
|
let subscriber = gobj_read_pointer_attr(gobj, "subscriber");
|
|
6009
6030
|
if (!subscriber) subscriber = gobj_parent(gobj);
|
|
6010
6031
|
gobj_subscribe_event(gobj, null, {}, subscriber);
|
|
6011
|
-
|
|
6032
|
+
let name = clean_name(gobj_name(gobj));
|
|
6033
|
+
gobj_write_attr(gobj, "form_id", "form" + name);
|
|
6012
6034
|
build_ui$11(gobj);
|
|
6013
6035
|
}
|
|
6014
6036
|
/************************************************************
|
|
@@ -6092,7 +6114,8 @@ function set_changed_stated(gobj, changed) {
|
|
|
6092
6114
|
async function readClipboard$1(gobj) {
|
|
6093
6115
|
try {
|
|
6094
6116
|
const text = await navigator.clipboard.readText();
|
|
6095
|
-
|
|
6117
|
+
let kw = JSON.parse(text);
|
|
6118
|
+
gobj_send_event(gobj, "EV_PASTE_RECORD", kw, gobj);
|
|
6096
6119
|
} catch (error) {
|
|
6097
6120
|
log_error(`Failed to read clipboard contents: ${error}`);
|
|
6098
6121
|
}
|
|
@@ -6309,8 +6332,9 @@ function destroy_ui$7(gobj) {
|
|
|
6309
6332
|
* Build form with bulma and createElement2
|
|
6310
6333
|
******************************************************************/
|
|
6311
6334
|
function build_form(gobj) {
|
|
6335
|
+
let form_id = gobj_read_str_attr(gobj, "form_id");
|
|
6312
6336
|
let $form = createElement2(["form", {
|
|
6313
|
-
id:
|
|
6337
|
+
id: form_id,
|
|
6314
6338
|
class: "yui-form"
|
|
6315
6339
|
}]);
|
|
6316
6340
|
let template = gobj_read_attr(gobj, "template");
|
|
@@ -6417,7 +6441,6 @@ function build_form_field_conf(gobj, field_desc) {
|
|
|
6417
6441
|
case "list":
|
|
6418
6442
|
field_conf.tag = "select2";
|
|
6419
6443
|
field_conf.options = field_desc.enum_list;
|
|
6420
|
-
break;
|
|
6421
6444
|
}
|
|
6422
6445
|
break;
|
|
6423
6446
|
case "hook": break;
|
|
@@ -6454,18 +6477,12 @@ function build_form_field_conf(gobj, field_desc) {
|
|
|
6454
6477
|
case "time":
|
|
6455
6478
|
field_conf.tag = "input";
|
|
6456
6479
|
field_conf.inputType = "datetime-local";
|
|
6457
|
-
|
|
6458
|
-
case "string": break;
|
|
6459
|
-
case "integer": break;
|
|
6460
|
-
}
|
|
6480
|
+
field_desc.real_type;
|
|
6461
6481
|
break;
|
|
6462
6482
|
case "color":
|
|
6463
6483
|
field_conf.tag = "input";
|
|
6464
6484
|
field_conf.inputType = "color";
|
|
6465
|
-
|
|
6466
|
-
case "string": break;
|
|
6467
|
-
case "integer": break;
|
|
6468
|
-
}
|
|
6485
|
+
field_desc.real_type;
|
|
6469
6486
|
break;
|
|
6470
6487
|
case "email":
|
|
6471
6488
|
field_conf.tag = "input";
|
|
@@ -6583,9 +6600,7 @@ function build_fkey_ref$1(gobj, field_desc, value) {
|
|
|
6583
6600
|
refs[ref] = true;
|
|
6584
6601
|
break;
|
|
6585
6602
|
case "array":
|
|
6586
|
-
case "list":
|
|
6587
|
-
refs.push(ref);
|
|
6588
|
-
break;
|
|
6603
|
+
case "list": refs.push(ref);
|
|
6589
6604
|
}
|
|
6590
6605
|
}
|
|
6591
6606
|
return refs;
|
|
@@ -6691,40 +6706,38 @@ function create_form_field(gobj, $form, prefix, field_desc, { tag, inputType, na
|
|
|
6691
6706
|
]]
|
|
6692
6707
|
]);
|
|
6693
6708
|
break;
|
|
6694
|
-
default:
|
|
6695
|
-
|
|
6709
|
+
default: $element = createElement2([
|
|
6710
|
+
"div",
|
|
6711
|
+
{ class: "xfield field is-horizontal" },
|
|
6712
|
+
[[
|
|
6696
6713
|
"div",
|
|
6697
|
-
{ class: "
|
|
6714
|
+
{ class: "field-label is-normal" },
|
|
6715
|
+
[[
|
|
6716
|
+
"label",
|
|
6717
|
+
{
|
|
6718
|
+
class: "label ",
|
|
6719
|
+
i18n: label_i18n || label,
|
|
6720
|
+
for: name
|
|
6721
|
+
},
|
|
6722
|
+
label
|
|
6723
|
+
]]
|
|
6724
|
+
], [
|
|
6725
|
+
"div",
|
|
6726
|
+
{ class: "field-body" },
|
|
6698
6727
|
[[
|
|
6699
6728
|
"div",
|
|
6700
|
-
{ class: "field
|
|
6729
|
+
{ class: "field" },
|
|
6701
6730
|
[[
|
|
6702
|
-
"
|
|
6731
|
+
"div",
|
|
6703
6732
|
{
|
|
6704
|
-
class: "
|
|
6705
|
-
|
|
6706
|
-
for: name
|
|
6733
|
+
class: "xcontrol control",
|
|
6734
|
+
style: ""
|
|
6707
6735
|
},
|
|
6708
|
-
|
|
6709
|
-
]]
|
|
6710
|
-
], [
|
|
6711
|
-
"div",
|
|
6712
|
-
{ class: "field-body" },
|
|
6713
|
-
[[
|
|
6714
|
-
"div",
|
|
6715
|
-
{ class: "field" },
|
|
6716
|
-
[[
|
|
6717
|
-
"div",
|
|
6718
|
-
{
|
|
6719
|
-
class: "xcontrol control",
|
|
6720
|
-
style: ""
|
|
6721
|
-
},
|
|
6722
|
-
[]
|
|
6723
|
-
]]
|
|
6736
|
+
[]
|
|
6724
6737
|
]]
|
|
6725
6738
|
]]
|
|
6726
|
-
]
|
|
6727
|
-
|
|
6739
|
+
]]
|
|
6740
|
+
]);
|
|
6728
6741
|
}
|
|
6729
6742
|
break;
|
|
6730
6743
|
case "textarea":
|
|
@@ -6977,7 +6990,7 @@ function create_form_field(gobj, $form, prefix, field_desc, { tag, inputType, na
|
|
|
6977
6990
|
log_error(sprintf("%s: select field '%s' options not an array (type=%s, real_type=%s); rendering empty", gobj_short_name(gobj), name, field_desc.type, field_desc.real_type));
|
|
6978
6991
|
opts = [];
|
|
6979
6992
|
}
|
|
6980
|
-
let
|
|
6993
|
+
let extend = [
|
|
6981
6994
|
"div",
|
|
6982
6995
|
{ class: "select" },
|
|
6983
6996
|
[
|
|
@@ -6995,7 +7008,8 @@ function create_form_field(gobj, $form, prefix, field_desc, { tag, inputType, na
|
|
|
6995
7008
|
gobj_send_event(gobj, "EV_RECORD_CHANGED", {}, gobj);
|
|
6996
7009
|
} }
|
|
6997
7010
|
]
|
|
6998
|
-
]
|
|
7011
|
+
];
|
|
7012
|
+
let $wrapper = createElement2(extend);
|
|
6999
7013
|
$control.appendChild($wrapper);
|
|
7000
7014
|
$extend = $wrapper.querySelector("select");
|
|
7001
7015
|
break;
|
|
@@ -7006,7 +7020,7 @@ function create_form_field(gobj, $form, prefix, field_desc, { tag, inputType, na
|
|
|
7006
7020
|
log_error(sprintf("%s: select2 field '%s' options not an array (type=%s, real_type=%s); rendering empty", gobj_short_name(gobj), name, field_desc.type, field_desc.real_type));
|
|
7007
7021
|
opts = [];
|
|
7008
7022
|
}
|
|
7009
|
-
|
|
7023
|
+
let extend = [
|
|
7010
7024
|
"select",
|
|
7011
7025
|
{
|
|
7012
7026
|
name,
|
|
@@ -7021,7 +7035,8 @@ function create_form_field(gobj, $form, prefix, field_desc, { tag, inputType, na
|
|
|
7021
7035
|
},
|
|
7022
7036
|
option
|
|
7023
7037
|
])
|
|
7024
|
-
]
|
|
7038
|
+
];
|
|
7039
|
+
$extend = createElement2(extend);
|
|
7025
7040
|
$control.appendChild($extend);
|
|
7026
7041
|
$extend.tom_select = new TomSelect($extend, {
|
|
7027
7042
|
allowEmptyOption: true,
|
|
@@ -7059,15 +7074,17 @@ function create_form_field(gobj, $form, prefix, field_desc, { tag, inputType, na
|
|
|
7059
7074
|
$extend = $wrapper.querySelector("input");
|
|
7060
7075
|
break;
|
|
7061
7076
|
}
|
|
7062
|
-
case "radio":
|
|
7063
|
-
|
|
7077
|
+
case "radio": {
|
|
7078
|
+
let elm = `
|
|
7064
7079
|
<label class="radio">
|
|
7065
7080
|
<input type="radio" name="${name}">
|
|
7066
7081
|
${t(options)}
|
|
7067
7082
|
</label>
|
|
7068
|
-
|
|
7083
|
+
`;
|
|
7084
|
+
$extend = createOneHtml(elm);
|
|
7069
7085
|
$control.appendChild($extend);
|
|
7070
7086
|
break;
|
|
7087
|
+
}
|
|
7071
7088
|
case "jsoneditor": {
|
|
7072
7089
|
let attrs = {
|
|
7073
7090
|
class: "jsoneditor" + (yui_is_dark() ? " jse-theme-dark" : ""),
|
|
@@ -7174,9 +7191,7 @@ function create_coordinates(gobj, attrs) {
|
|
|
7174
7191
|
case error.TIMEOUT:
|
|
7175
7192
|
errorMsg = t("timed out");
|
|
7176
7193
|
break;
|
|
7177
|
-
default:
|
|
7178
|
-
errorMsg = t("unknown error");
|
|
7179
|
-
break;
|
|
7194
|
+
default: errorMsg = t("unknown error");
|
|
7180
7195
|
}
|
|
7181
7196
|
$input.classList.add("is-danger");
|
|
7182
7197
|
let $h = $input.closest(".xcontrol").parentNode.querySelector(".help");
|
|
@@ -7191,7 +7206,7 @@ function create_coordinates(gobj, attrs) {
|
|
|
7191
7206
|
$h.style.display = "block";
|
|
7192
7207
|
}
|
|
7193
7208
|
}
|
|
7194
|
-
let
|
|
7209
|
+
let extend = [
|
|
7195
7210
|
"div",
|
|
7196
7211
|
{ class: "field is-flex is-align-items-center" },
|
|
7197
7212
|
[[
|
|
@@ -7218,7 +7233,8 @@ function create_coordinates(gobj, attrs) {
|
|
|
7218
7233
|
} }
|
|
7219
7234
|
]]
|
|
7220
7235
|
]]
|
|
7221
|
-
]
|
|
7236
|
+
];
|
|
7237
|
+
let $extend = createElement2(extend);
|
|
7222
7238
|
let $control = $extend.querySelector(".control");
|
|
7223
7239
|
attach_clear($control, $control.querySelector("input"));
|
|
7224
7240
|
return $extend;
|
|
@@ -7245,10 +7261,11 @@ function create_tabulator$1(gobj, $extend, name, template) {
|
|
|
7245
7261
|
tabulator_settings.columns = template2columns(gobj, columns, template, sub_elements);
|
|
7246
7262
|
if (sub_elements.length > 0) tabulator_settings.rowFormatter = function(row) {
|
|
7247
7263
|
for (let sub_element of sub_elements) {
|
|
7248
|
-
let
|
|
7264
|
+
let extend = ["div", {
|
|
7249
7265
|
class: "yui-tabulator-table-nested pl-6 is-bordered is-striped",
|
|
7250
7266
|
"name": sub_element.name
|
|
7251
|
-
}]
|
|
7267
|
+
}];
|
|
7268
|
+
let $extend = createElement2(extend);
|
|
7252
7269
|
$extend.tabulator = create_tabulator$1(gobj, $extend, sub_element.name, sub_element.template);
|
|
7253
7270
|
row.getElement().appendChild($extend);
|
|
7254
7271
|
}
|
|
@@ -7336,9 +7353,10 @@ function template2columns(gobj, columns, template, sub_elements) {
|
|
|
7336
7353
|
cellClick: function(evt, cell) {
|
|
7337
7354
|
evt.stopPropagation();
|
|
7338
7355
|
let $row = cell.getRow().getElement();
|
|
7356
|
+
let $extend = $row.querySelector(`[name="${field_desc.name}"]`);
|
|
7339
7357
|
gobj_send_event(gobj, "EV_ADD_TABLE_ROW", {
|
|
7340
7358
|
$row,
|
|
7341
|
-
$table: $
|
|
7359
|
+
$table: $extend,
|
|
7342
7360
|
record: {},
|
|
7343
7361
|
loading: false
|
|
7344
7362
|
}, gobj);
|
|
@@ -7353,9 +7371,7 @@ function template2columns(gobj, columns, template, sub_elements) {
|
|
|
7353
7371
|
case "object":
|
|
7354
7372
|
case "dict":
|
|
7355
7373
|
case "array":
|
|
7356
|
-
case "list":
|
|
7357
|
-
column.editorParams.values = field_desc.enum_list;
|
|
7358
|
-
break;
|
|
7374
|
+
case "list": column.editorParams.values = field_desc.enum_list;
|
|
7359
7375
|
}
|
|
7360
7376
|
break;
|
|
7361
7377
|
case "hook": break;
|
|
@@ -7400,18 +7416,12 @@ function template2columns(gobj, columns, template, sub_elements) {
|
|
|
7400
7416
|
verticalNavigation: "table",
|
|
7401
7417
|
elementAttributes: { title: "slide bar to choose option" }
|
|
7402
7418
|
};
|
|
7403
|
-
|
|
7404
|
-
case "string": break;
|
|
7405
|
-
case "integer": break;
|
|
7406
|
-
}
|
|
7419
|
+
field_desc.real_type;
|
|
7407
7420
|
break;
|
|
7408
7421
|
case "color":
|
|
7409
7422
|
column.editor = "input";
|
|
7410
7423
|
column.editorParams = {};
|
|
7411
|
-
|
|
7412
|
-
case "string": break;
|
|
7413
|
-
case "integer": break;
|
|
7414
|
-
}
|
|
7424
|
+
field_desc.real_type;
|
|
7415
7425
|
break;
|
|
7416
7426
|
case "email":
|
|
7417
7427
|
column.editor = "input";
|
|
@@ -7507,9 +7517,7 @@ function get_form_values(gobj, $form) {
|
|
|
7507
7517
|
const date = new Date($input.value);
|
|
7508
7518
|
value = Math.floor(date.getTime() / 1e3);
|
|
7509
7519
|
break;
|
|
7510
|
-
default:
|
|
7511
|
-
value = getInputValue($input);
|
|
7512
|
-
break;
|
|
7520
|
+
default: value = getInputValue($input);
|
|
7513
7521
|
}
|
|
7514
7522
|
break;
|
|
7515
7523
|
case "textarea":
|
|
@@ -7556,9 +7564,7 @@ function get_form_values(gobj, $form) {
|
|
|
7556
7564
|
if ($input.tagName !== "INPUT") $input = $input.querySelector("input");
|
|
7557
7565
|
value = getInputValue($input);
|
|
7558
7566
|
break;
|
|
7559
|
-
default:
|
|
7560
|
-
log_error(sprintf("%s: $form type unknown: '%s'", gobj_short_name(gobj), tag));
|
|
7561
|
-
break;
|
|
7567
|
+
default: log_error(sprintf("%s: $form type unknown: '%s'", gobj_short_name(gobj), tag));
|
|
7562
7568
|
}
|
|
7563
7569
|
value = form_value_2_treedb_value(gobj, field_desc, value);
|
|
7564
7570
|
let path;
|
|
@@ -7574,14 +7580,16 @@ function get_form_values(gobj, $form) {
|
|
|
7574
7580
|
function clear_data(gobj, $form) {
|
|
7575
7581
|
let pkey = gobj_read_str_attr(gobj, "pkey");
|
|
7576
7582
|
$form.querySelectorAll("input, select, textarea, .jsoneditor").forEach(($input) => {
|
|
7577
|
-
if ($input.name !== pkey)
|
|
7578
|
-
|
|
7579
|
-
|
|
7580
|
-
|
|
7581
|
-
|
|
7582
|
-
|
|
7583
|
-
|
|
7584
|
-
|
|
7583
|
+
if ($input.name !== pkey) {
|
|
7584
|
+
if ($input.classList.contains("jsoneditor")) {
|
|
7585
|
+
let jsoneditor = $input.jsoneditor;
|
|
7586
|
+
if (jsoneditor) jsoneditor.set({ text: "" });
|
|
7587
|
+
} else if ($input.type === "checkbox") $input.checked = false;
|
|
7588
|
+
else if ($input.type === "radio") $input.checked = false;
|
|
7589
|
+
else if ($input.type === "datetime-local") $input.value = null;
|
|
7590
|
+
else if ($input.type === "select-multiple") $input.tom_select.clear();
|
|
7591
|
+
else $input.value = null;
|
|
7592
|
+
}
|
|
7585
7593
|
});
|
|
7586
7594
|
$form.querySelectorAll(".yui-tabulator-table").forEach(($table) => {
|
|
7587
7595
|
if ($table.tabulator.initialized) $table.tabulator.clearData();
|
|
@@ -7663,9 +7671,7 @@ function set_form_values(gobj, template, $form, record) {
|
|
|
7663
7671
|
case "color":
|
|
7664
7672
|
$input.value = convertColor(value);
|
|
7665
7673
|
break;
|
|
7666
|
-
default:
|
|
7667
|
-
$input.value = value;
|
|
7668
|
-
break;
|
|
7674
|
+
default: $input.value = value;
|
|
7669
7675
|
}
|
|
7670
7676
|
break;
|
|
7671
7677
|
case "textarea":
|
|
@@ -7696,9 +7702,7 @@ function set_form_values(gobj, template, $form, record) {
|
|
|
7696
7702
|
if ($input.tagName !== "INPUT") $input = $input.querySelector("input");
|
|
7697
7703
|
$input.value = value;
|
|
7698
7704
|
break;
|
|
7699
|
-
default:
|
|
7700
|
-
log_error(sprintf("%s: $form type unknown: '%s'", gobj_short_name(gobj), tag));
|
|
7701
|
-
break;
|
|
7705
|
+
default: log_error(sprintf("%s: $form type unknown: '%s'", gobj_short_name(gobj), tag));
|
|
7702
7706
|
}
|
|
7703
7707
|
refresh_clear($input);
|
|
7704
7708
|
});
|
|
@@ -7812,9 +7816,7 @@ function treedb_value_2_form_value(gobj, field_desc, value) {
|
|
|
7812
7816
|
}
|
|
7813
7817
|
value = `${longitude}, ${latitude}`;
|
|
7814
7818
|
break;
|
|
7815
|
-
default:
|
|
7816
|
-
log_error("treedb_value_2_form_value() type unknown: " + type);
|
|
7817
|
-
break;
|
|
7819
|
+
default: log_error("treedb_value_2_form_value() type unknown: " + type);
|
|
7818
7820
|
}
|
|
7819
7821
|
return value;
|
|
7820
7822
|
}
|
|
@@ -7858,9 +7860,7 @@ function form_value_2_treedb_value(gobj, field_desc, value) {
|
|
|
7858
7860
|
case "integer":
|
|
7859
7861
|
if (value && is_date(value)) value = value.getTime() / 1e3;
|
|
7860
7862
|
break;
|
|
7861
|
-
default:
|
|
7862
|
-
log_error("incompatible type for time: " + real_type);
|
|
7863
|
-
break;
|
|
7863
|
+
default: log_error("incompatible type for time: " + real_type);
|
|
7864
7864
|
}
|
|
7865
7865
|
break;
|
|
7866
7866
|
case "date":
|
|
@@ -7921,9 +7921,7 @@ function form_value_2_treedb_value(gobj, field_desc, value) {
|
|
|
7921
7921
|
"coordinates": [lnglat[0], lnglat[1]]
|
|
7922
7922
|
} };
|
|
7923
7923
|
break;
|
|
7924
|
-
default:
|
|
7925
|
-
log_error("form_value_2_treedb_value() type unknown: " + type);
|
|
7926
|
-
break;
|
|
7924
|
+
default: log_error("form_value_2_treedb_value() type unknown: " + type);
|
|
7927
7925
|
}
|
|
7928
7926
|
return value;
|
|
7929
7927
|
}
|
|
@@ -7960,7 +7958,8 @@ function ac_load_record(gobj, event, kw, src) {
|
|
|
7960
7958
|
function ac_save_record(gobj, event, kw, src) {
|
|
7961
7959
|
let $form = gobj_read_attr(gobj, "$container").querySelector("form");
|
|
7962
7960
|
if (validate_form(gobj, $form)) {
|
|
7963
|
-
|
|
7961
|
+
let values = get_form_values(gobj, $form);
|
|
7962
|
+
gobj_publish_event(gobj, "EV_SAVE_RECORD", values);
|
|
7964
7963
|
set_changed_stated(gobj, false);
|
|
7965
7964
|
} else {
|
|
7966
7965
|
kw.abort_close = true;
|
|
@@ -8166,7 +8165,7 @@ function create_gclass$13(gclass_name) {
|
|
|
8166
8165
|
null
|
|
8167
8166
|
]
|
|
8168
8167
|
]]];
|
|
8169
|
-
|
|
8168
|
+
const event_types = [
|
|
8170
8169
|
["EV_LOAD_RECORD", 0],
|
|
8171
8170
|
["EV_SAVE_RECORD", event_flag_t.EVF_OUTPUT_EVENT],
|
|
8172
8171
|
["EV_UNDO_RECORD", 0],
|
|
@@ -8182,7 +8181,8 @@ function create_gclass$13(gclass_name) {
|
|
|
8182
8181
|
["EV_SHOW", 0],
|
|
8183
8182
|
["EV_HIDE", 0],
|
|
8184
8183
|
["EV_TIMEOUT", 0]
|
|
8185
|
-
]
|
|
8184
|
+
];
|
|
8185
|
+
__gclass__$13 = gclass_create(gclass_name, event_types, states, gmt$13, 0, attrs_table$13, PRIVATE_DATA$13, 0, 0, 0, 0);
|
|
8186
8186
|
if (!__gclass__$13) return -1;
|
|
8187
8187
|
return 0;
|
|
8188
8188
|
}
|
|
@@ -8781,14 +8781,16 @@ function xtouchStart(gobj, e) {
|
|
|
8781
8781
|
function ac_edit_map(gobj, event, kw, src) {
|
|
8782
8782
|
let priv = gobj.priv;
|
|
8783
8783
|
const map = priv.xmap;
|
|
8784
|
-
if (kw_has_key(kw, "enable_moving_markers"))
|
|
8785
|
-
|
|
8786
|
-
|
|
8787
|
-
|
|
8788
|
-
|
|
8789
|
-
|
|
8790
|
-
|
|
8791
|
-
|
|
8784
|
+
if (kw_has_key(kw, "enable_moving_markers")) {
|
|
8785
|
+
if (kw.enable_moving_markers) {
|
|
8786
|
+
map.on("mousedown", "unclustered-point", priv.xmouseDown);
|
|
8787
|
+
map.on("touchstart", "unclustered-point", priv.xtouchStart);
|
|
8788
|
+
map.off("click", "unclustered-point", priv.onClick);
|
|
8789
|
+
} else {
|
|
8790
|
+
map.off("mousedown", "unclustered-point", priv.xmouseDown);
|
|
8791
|
+
map.off("touchstart", "unclustered-point", priv.xtouchStart);
|
|
8792
|
+
map.on("click", "unclustered-point", priv.onClick);
|
|
8793
|
+
}
|
|
8792
8794
|
}
|
|
8793
8795
|
return 0;
|
|
8794
8796
|
}
|
|
@@ -9031,14 +9033,15 @@ function build_ui$10(gobj) {
|
|
|
9031
9033
|
gobj_write_bool_attr(gobj, "$container", $container);
|
|
9032
9034
|
gobj_write_bool_attr(gobj, "own_container", true);
|
|
9033
9035
|
}
|
|
9034
|
-
let
|
|
9036
|
+
let uPlot_options = {
|
|
9035
9037
|
title: gobj_read_attr(gobj, "title"),
|
|
9036
9038
|
width: gobj_read_attr(gobj, "width"),
|
|
9037
9039
|
height: gobj_read_attr(gobj, "height"),
|
|
9038
9040
|
series: gobj_read_attr(gobj, "series"),
|
|
9039
9041
|
axes: gobj_read_attr(gobj, "axes"),
|
|
9040
9042
|
scales: gobj_read_attr(gobj, "scales")
|
|
9041
|
-
}
|
|
9043
|
+
};
|
|
9044
|
+
let uplot = new uPlot(uPlot_options, gobj_read_attr(gobj, "data"), $container);
|
|
9042
9045
|
gobj_write_attr(gobj, "uplot", uplot);
|
|
9043
9046
|
let fixed_height = gobj_read_attr(gobj, "height");
|
|
9044
9047
|
function fit_to_container() {
|
|
@@ -9093,11 +9096,13 @@ function ac_load_data$2(gobj, event, kw, src) {
|
|
|
9093
9096
|
for (let idx = 1; idx < uplot.series.length; idx++) {
|
|
9094
9097
|
let serie = uplot.series[idx];
|
|
9095
9098
|
let value = kw[i][serie.id];
|
|
9096
|
-
if (is_string(value))
|
|
9097
|
-
|
|
9098
|
-
|
|
9099
|
-
|
|
9100
|
-
|
|
9099
|
+
if (is_string(value)) {
|
|
9100
|
+
if (value.toLowerCase() === "on") value = 1;
|
|
9101
|
+
else if (value.toLowerCase() === "off") value = 0;
|
|
9102
|
+
else {
|
|
9103
|
+
log_error(`${gobj_short_name(gobj)} value not contemplated: '${value}'`);
|
|
9104
|
+
value = 0;
|
|
9105
|
+
}
|
|
9101
9106
|
}
|
|
9102
9107
|
data[idx].push(value);
|
|
9103
9108
|
}
|
|
@@ -9573,6 +9578,7 @@ function mt_destroy$10(gobj) {
|
|
|
9573
9578
|
************************************************************/
|
|
9574
9579
|
function build_ui$9(gobj) {
|
|
9575
9580
|
let priv = gobj.priv;
|
|
9581
|
+
let $toolbar = make_toolbar$3(gobj);
|
|
9576
9582
|
let $container = createElement2([
|
|
9577
9583
|
"div",
|
|
9578
9584
|
{
|
|
@@ -9582,7 +9588,7 @@ function build_ui$9(gobj) {
|
|
|
9582
9588
|
[[
|
|
9583
9589
|
"div",
|
|
9584
9590
|
{ class: "is-flex-grow-0 is-flex toolbar_yui_json_graph" },
|
|
9585
|
-
|
|
9591
|
+
$toolbar
|
|
9586
9592
|
], [
|
|
9587
9593
|
"div",
|
|
9588
9594
|
{
|
|
@@ -9765,9 +9771,7 @@ function build_cell_html(key, value, type, dark) {
|
|
|
9765
9771
|
case "dict":
|
|
9766
9772
|
display_value = `{${json_object_size(value)}}`;
|
|
9767
9773
|
break;
|
|
9768
|
-
default:
|
|
9769
|
-
display_value = String(value);
|
|
9770
|
-
break;
|
|
9774
|
+
default: display_value = String(value);
|
|
9771
9775
|
}
|
|
9772
9776
|
return `<span style="color:${key_color}">• ${escapeHtml(String(key))}: </span><span style="color:${color}">${display_value}</span>`;
|
|
9773
9777
|
}
|
|
@@ -10212,7 +10216,7 @@ function create_gclass$10(gclass_name) {
|
|
|
10212
10216
|
null
|
|
10213
10217
|
]
|
|
10214
10218
|
]]];
|
|
10215
|
-
|
|
10219
|
+
const event_types = [
|
|
10216
10220
|
["EV_LOAD_DATA", 0],
|
|
10217
10221
|
["EV_REFRESH", 0],
|
|
10218
10222
|
["EV_THEME", 0],
|
|
@@ -10225,7 +10229,8 @@ function create_gclass$10(gclass_name) {
|
|
|
10225
10229
|
["EV_SHOW", 0],
|
|
10226
10230
|
["EV_HIDE", 0],
|
|
10227
10231
|
["EV_JSON_ITEM_CLICKED", event_flag_t.EVF_OUTPUT_EVENT]
|
|
10228
|
-
]
|
|
10232
|
+
];
|
|
10233
|
+
__gclass__$10 = gclass_create(gclass_name, event_types, states, gmt$10, 0, attrs_table$10, PRIVATE_DATA$10, 0, 0, 0, 0);
|
|
10229
10234
|
if (!__gclass__$10) return -1;
|
|
10230
10235
|
return 0;
|
|
10231
10236
|
}
|
|
@@ -10475,6 +10480,7 @@ function mt_destroy$9(gobj) {
|
|
|
10475
10480
|
************************************************************/
|
|
10476
10481
|
function build_ui$8(gobj) {
|
|
10477
10482
|
let priv = gobj.priv;
|
|
10483
|
+
let $toolbar = make_toolbar$2(gobj);
|
|
10478
10484
|
let $container = createElement2([
|
|
10479
10485
|
"div",
|
|
10480
10486
|
{
|
|
@@ -10484,7 +10490,7 @@ function build_ui$8(gobj) {
|
|
|
10484
10490
|
[[
|
|
10485
10491
|
"div",
|
|
10486
10492
|
{ class: "JSON_TOOLBAR is-flex-grow-0" },
|
|
10487
|
-
[
|
|
10493
|
+
[$toolbar]
|
|
10488
10494
|
], [
|
|
10489
10495
|
"div",
|
|
10490
10496
|
{
|
|
@@ -10841,9 +10847,7 @@ function leaf_row(key, value, depth) {
|
|
|
10841
10847
|
case "boolean":
|
|
10842
10848
|
text = value ? "true" : "false";
|
|
10843
10849
|
break;
|
|
10844
|
-
default:
|
|
10845
|
-
text = String(value);
|
|
10846
|
-
break;
|
|
10850
|
+
default: text = String(value);
|
|
10847
10851
|
}
|
|
10848
10852
|
let body = [];
|
|
10849
10853
|
if (key !== null && key !== "") {
|
|
@@ -11191,7 +11195,7 @@ function create_gclass$9(gclass_name) {
|
|
|
11191
11195
|
null
|
|
11192
11196
|
]
|
|
11193
11197
|
]]];
|
|
11194
|
-
|
|
11198
|
+
const event_types = [
|
|
11195
11199
|
["EV_SET_JSON", 0],
|
|
11196
11200
|
["EV_SUBTREE_LOADED", 0],
|
|
11197
11201
|
["EV_SUBTREE_ERROR", 0],
|
|
@@ -11206,7 +11210,8 @@ function create_gclass$9(gclass_name) {
|
|
|
11206
11210
|
["EV_SHOW", 0],
|
|
11207
11211
|
["EV_HIDE", 0],
|
|
11208
11212
|
["EV_EXPAND_PATH", event_flag_t.EVF_OUTPUT_EVENT | event_flag_t.EVF_NO_WARN_SUBS]
|
|
11209
|
-
]
|
|
11213
|
+
];
|
|
11214
|
+
__gclass__$9 = gclass_create(gclass_name, event_types, states, gmt$9, 0, attrs_table$9, PRIVATE_DATA$9, 0, 0, 0, 0);
|
|
11210
11215
|
if (!__gclass__$9) return -1;
|
|
11211
11216
|
return 0;
|
|
11212
11217
|
}
|
|
@@ -11214,6 +11219,7 @@ function create_gclass$9(gclass_name) {
|
|
|
11214
11219
|
* Register GClass
|
|
11215
11220
|
***************************************************************/
|
|
11216
11221
|
function register_c_yui_json() {
|
|
11222
|
+
if (gclass_find_by_name(GCLASS_NAME$9, false)) return 0;
|
|
11217
11223
|
return create_gclass$9(GCLASS_NAME$9);
|
|
11218
11224
|
}
|
|
11219
11225
|
//#endregion
|
|
@@ -11504,6 +11510,7 @@ function mt_destroy$8(gobj) {
|
|
|
11504
11510
|
************************************************************/
|
|
11505
11511
|
function build_ui$7(gobj) {
|
|
11506
11512
|
let priv = gobj.priv;
|
|
11513
|
+
let $toolbar = make_toolbar$1(gobj);
|
|
11507
11514
|
let $container = createElement2([
|
|
11508
11515
|
"div",
|
|
11509
11516
|
{
|
|
@@ -11513,7 +11520,7 @@ function build_ui$7(gobj) {
|
|
|
11513
11520
|
[[
|
|
11514
11521
|
"div",
|
|
11515
11522
|
{ class: "is-flex-grow-0 is-flex toolbar_yui_gobj_tree" },
|
|
11516
|
-
|
|
11523
|
+
$toolbar
|
|
11517
11524
|
], [
|
|
11518
11525
|
"div",
|
|
11519
11526
|
{
|
|
@@ -13482,7 +13489,8 @@ function render_tabs(gobj, items) {
|
|
|
13482
13489
|
]);
|
|
13483
13490
|
}
|
|
13484
13491
|
function render_cards(gobj, items) {
|
|
13485
|
-
|
|
13492
|
+
let show_label = gobj_read_attr(gobj, "show_label");
|
|
13493
|
+
return createElement2(cards_grid_descriptor(items, show_label));
|
|
13486
13494
|
}
|
|
13487
13495
|
/************************************************************
|
|
13488
13496
|
* "backbar": a single "← <section>" link back to the section
|
|
@@ -13949,13 +13957,14 @@ function create_gclass$6(gclass_name) {
|
|
|
13949
13957
|
ac_set_items,
|
|
13950
13958
|
null
|
|
13951
13959
|
]]]];
|
|
13952
|
-
|
|
13960
|
+
const event_types = [
|
|
13953
13961
|
["EV_ROUTE_CHANGED", 0],
|
|
13954
13962
|
["EV_SET_ITEMS", 0],
|
|
13955
13963
|
["EV_NAV_CLICKED", event_flag_t.EVF_OUTPUT_EVENT | event_flag_t.EVF_PUBLIC_EVENT],
|
|
13956
13964
|
["EV_NAV_ITEM_CLOSE", event_flag_t.EVF_OUTPUT_EVENT | event_flag_t.EVF_PUBLIC_EVENT],
|
|
13957
13965
|
["EV_DRAWER_CLOSE_REQUESTED", event_flag_t.EVF_OUTPUT_EVENT | event_flag_t.EVF_PUBLIC_EVENT]
|
|
13958
|
-
]
|
|
13966
|
+
];
|
|
13967
|
+
__gclass__$6 = gclass_create(gclass_name, event_types, states, gmt$6, 0, attrs_table$6, PRIVATE_DATA$6, 0, 0, 0, 0);
|
|
13959
13968
|
if (!__gclass__$6) return -1;
|
|
13960
13969
|
return 0;
|
|
13961
13970
|
}
|
|
@@ -14121,20 +14130,21 @@ function build_body(shell, t) {
|
|
|
14121
14130
|
kind: "group",
|
|
14122
14131
|
children: map.other
|
|
14123
14132
|
});
|
|
14133
|
+
let root = {
|
|
14134
|
+
label: map.brand.label || "app",
|
|
14135
|
+
icon: "",
|
|
14136
|
+
route: map.brand.route || "",
|
|
14137
|
+
event: "",
|
|
14138
|
+
current: !!map.brand.current,
|
|
14139
|
+
children
|
|
14140
|
+
};
|
|
14124
14141
|
let $tree = createElement2([
|
|
14125
14142
|
"div",
|
|
14126
14143
|
{ class: "ROUTEMAP_TREE" },
|
|
14127
14144
|
[createElement2([
|
|
14128
14145
|
"ul",
|
|
14129
14146
|
{ class: "ROUTEMAP_UL ROUTEMAP_ROOT" },
|
|
14130
|
-
[render_node(
|
|
14131
|
-
label: map.brand.label || "app",
|
|
14132
|
-
icon: "",
|
|
14133
|
-
route: map.brand.route || "",
|
|
14134
|
-
event: "",
|
|
14135
|
-
current: !!map.brand.current,
|
|
14136
|
-
children
|
|
14137
|
-
})]
|
|
14147
|
+
[render_node(root)]
|
|
14138
14148
|
])]
|
|
14139
14149
|
]);
|
|
14140
14150
|
let $search = createElement2(["input", {
|
|
@@ -14321,8 +14331,9 @@ function yui_shell_show_route_map(shell, opts) {
|
|
|
14321
14331
|
if (gclass_find_by_name("C_YUI_WINDOW") !== null) {
|
|
14322
14332
|
let win_ref = { gobj: null };
|
|
14323
14333
|
let $body = build_body(shell, t);
|
|
14334
|
+
let $parent = yui_shell_popup_layer(shell) || typeof document !== "undefined" && document.getElementById("top-layer") || null;
|
|
14324
14335
|
let win = gobj_create_service(WIN_NAME$1, "C_YUI_WINDOW", {
|
|
14325
|
-
$parent
|
|
14336
|
+
$parent,
|
|
14326
14337
|
subscriber: null,
|
|
14327
14338
|
modal: false,
|
|
14328
14339
|
showMax: true,
|
|
@@ -14736,7 +14747,8 @@ function add_tab(gobj, gobj2, id, text, icon) {
|
|
|
14736
14747
|
************************************************************/
|
|
14737
14748
|
function select_topic_by_id(gobj, id) {
|
|
14738
14749
|
gobj_send_event(gobj, "EV_SHOW", { href: id }, gobj);
|
|
14739
|
-
|
|
14750
|
+
let topic = id.indexOf("?") >= 0 ? id.split("?")[1] : id;
|
|
14751
|
+
gobj_publish_event(gobj, "EV_TOPIC_SELECTED", { topic });
|
|
14740
14752
|
}
|
|
14741
14753
|
/************************************************************
|
|
14742
14754
|
* One icon-action anchor of a topic card: a REAL hash link
|
|
@@ -15184,13 +15196,14 @@ function process_treedb_descs$1(gobj) {
|
|
|
15184
15196
|
gobj_start(gobj_topic_form);
|
|
15185
15197
|
}
|
|
15186
15198
|
let href = gobj_read_str_attr(gobj, "last_selection");
|
|
15187
|
-
if (gobj_read_bool_attr(gobj, "with_cards_landing"))
|
|
15188
|
-
|
|
15189
|
-
|
|
15190
|
-
|
|
15191
|
-
|
|
15192
|
-
|
|
15193
|
-
|
|
15199
|
+
if (gobj_read_bool_attr(gobj, "with_cards_landing")) {
|
|
15200
|
+
if (gobj.priv._pending_info) {
|
|
15201
|
+
let ti = gobj.priv._pending_info;
|
|
15202
|
+
gobj.priv._pending_info = null;
|
|
15203
|
+
show_topic_info(gobj, ti);
|
|
15204
|
+
} else if (href && href.indexOf("?") >= 0) gobj_send_event(gobj, "EV_SHOW", { href }, gobj);
|
|
15205
|
+
else show_topics_landing(gobj);
|
|
15206
|
+
} else {
|
|
15194
15207
|
if (!href) try {
|
|
15195
15208
|
let topic = window.localStorage.getItem(`yui_treedb_topics:${gobj_name(gobj)}`);
|
|
15196
15209
|
if (topic) href = `${gobj_name(gobj)}?${topic}`;
|
|
@@ -15532,7 +15545,10 @@ function ac_mt_command_answer$1(gobj, event, kw, src) {
|
|
|
15532
15545
|
break;
|
|
15533
15546
|
case "nodes":
|
|
15534
15547
|
let topic_name = kw_get_str(gobj, kw_command, "topic_name", "", kw_flag_t.KW_REQUIRED);
|
|
15535
|
-
if (result >= 0)
|
|
15548
|
+
if (result >= 0) {
|
|
15549
|
+
let gobj_topic_form = gobj_find_child(gobj, { __gobj_name__: `${gobj_name(gobj)}?${topic_name}` });
|
|
15550
|
+
gobj_send_event(gobj_topic_form, "EV_LOAD_NODES", data, gobj);
|
|
15551
|
+
}
|
|
15536
15552
|
break;
|
|
15537
15553
|
case "create-node":
|
|
15538
15554
|
case "update-node":
|
|
@@ -15698,7 +15714,10 @@ function ac_treedb_node_created$1(gobj, event, kw, src) {
|
|
|
15698
15714
|
let treedb_name = kw_get_str(gobj, kw, "treedb_name", "", 0);
|
|
15699
15715
|
let topic_name = kw_get_str(gobj, kw, "topic_name", "", 0);
|
|
15700
15716
|
let node = kw_get_dict_value(gobj, kw, "node", null, 0);
|
|
15701
|
-
if (treedb_name === gobj_read_str_attr(gobj, "treedb_name"))
|
|
15717
|
+
if (treedb_name === gobj_read_str_attr(gobj, "treedb_name")) {
|
|
15718
|
+
let gobj_formtable = get_gobj_formtable(gobj, topic_name);
|
|
15719
|
+
gobj_send_event(gobj_formtable, "EV_LOAD_NODE_CREATED", [node], gobj);
|
|
15720
|
+
}
|
|
15702
15721
|
return 0;
|
|
15703
15722
|
}
|
|
15704
15723
|
/********************************************
|
|
@@ -15708,7 +15727,10 @@ function ac_treedb_node_updated$1(gobj, event, kw, src) {
|
|
|
15708
15727
|
let treedb_name = kw_get_str(gobj, kw, "treedb_name", "", 0);
|
|
15709
15728
|
let topic_name = kw_get_str(gobj, kw, "topic_name", "", 0);
|
|
15710
15729
|
let node = kw_get_dict_value(gobj, kw, "node", null, 0);
|
|
15711
|
-
if (treedb_name === gobj_read_str_attr(gobj, "treedb_name"))
|
|
15730
|
+
if (treedb_name === gobj_read_str_attr(gobj, "treedb_name")) {
|
|
15731
|
+
let gobj_formtable = get_gobj_formtable(gobj, topic_name);
|
|
15732
|
+
gobj_send_event(gobj_formtable, "EV_LOAD_NODE_UPDATED", [node], gobj);
|
|
15733
|
+
}
|
|
15712
15734
|
return 0;
|
|
15713
15735
|
}
|
|
15714
15736
|
/********************************************
|
|
@@ -15718,7 +15740,10 @@ function ac_treedb_node_deleted$1(gobj, event, kw, src) {
|
|
|
15718
15740
|
let treedb_name = kw_get_str(gobj, kw, "treedb_name", "", 0);
|
|
15719
15741
|
let topic_name = kw_get_str(gobj, kw, "topic_name", "", 0);
|
|
15720
15742
|
let node = kw_get_dict_value(gobj, kw, "node", null, 0);
|
|
15721
|
-
if (treedb_name === gobj_read_str_attr(gobj, "treedb_name"))
|
|
15743
|
+
if (treedb_name === gobj_read_str_attr(gobj, "treedb_name")) {
|
|
15744
|
+
let gobj_formtable = get_gobj_formtable(gobj, topic_name);
|
|
15745
|
+
gobj_send_event(gobj_formtable, "EV_NODE_DELETED", [node], gobj);
|
|
15746
|
+
}
|
|
15722
15747
|
return 0;
|
|
15723
15748
|
}
|
|
15724
15749
|
/********************************************
|
|
@@ -15924,7 +15949,7 @@ function create_gclass$5(gclass_name) {
|
|
|
15924
15949
|
null
|
|
15925
15950
|
]
|
|
15926
15951
|
]]];
|
|
15927
|
-
|
|
15952
|
+
const event_types = [
|
|
15928
15953
|
["EV_MT_COMMAND_ANSWER", event_flag_t.EVF_PUBLIC_EVENT],
|
|
15929
15954
|
["EV_TREEDB_NODE_CREATED", event_flag_t.EVF_PUBLIC_EVENT],
|
|
15930
15955
|
["EV_TREEDB_NODE_UPDATED", event_flag_t.EVF_PUBLIC_EVENT],
|
|
@@ -15945,7 +15970,8 @@ function create_gclass$5(gclass_name) {
|
|
|
15945
15970
|
["EV_BACK_TO_TOPICS", 0],
|
|
15946
15971
|
["EV_TRANSPORT_STATE", 0],
|
|
15947
15972
|
["EV_TOPIC_SELECTED", event_flag_t.EVF_OUTPUT_EVENT | event_flag_t.EVF_NO_WARN_SUBS]
|
|
15948
|
-
]
|
|
15973
|
+
];
|
|
15974
|
+
__gclass__$5 = gclass_create(gclass_name, event_types, states, gmt$5, 0, attrs_table$5, PRIVATE_DATA$5, 0, 0, 0, 0);
|
|
15949
15975
|
if (!__gclass__$5) return -1;
|
|
15950
15976
|
return 0;
|
|
15951
15977
|
}
|
|
@@ -16075,6 +16101,7 @@ var attrs_table$4 = [
|
|
|
16075
16101
|
SDATA(data_type_t.DTP_BOOLEAN, "with_paste_button", 0, true, "Button toolbar PASTE"),
|
|
16076
16102
|
SDATA(data_type_t.DTP_BOOLEAN, "with_refresh_button", 0, true, "Button toolbar REFRESH"),
|
|
16077
16103
|
SDATA(data_type_t.DTP_BOOLEAN, "with_search_button", 0, true, "Button toolbar SEARCH"),
|
|
16104
|
+
SDATA(data_type_t.DTP_BOOLEAN, "with_schema_button", 0, true, "Button toolbar SCHEMA (show the topic's desc)"),
|
|
16078
16105
|
SDATA(data_type_t.DTP_BOOLEAN, "with_in_row_edit_icons", 0, true, "Add a last column with internal EDIT/DELETE icon"),
|
|
16079
16106
|
SDATA(data_type_t.DTP_BOOLEAN, "editable", 0, false, "Edit state"),
|
|
16080
16107
|
SDATA(data_type_t.DTP_BOOLEAN, "with_checkbox", 0, true, "Auxiliary first column to select rows"),
|
|
@@ -16108,7 +16135,9 @@ var PRIVATE_DATA$4 = {
|
|
|
16108
16135
|
topic_name: "",
|
|
16109
16136
|
tabulator: null,
|
|
16110
16137
|
form: null,
|
|
16111
|
-
form_modal: null
|
|
16138
|
+
form_modal: null,
|
|
16139
|
+
schema_gobj: null,
|
|
16140
|
+
schema_modal: null
|
|
16112
16141
|
};
|
|
16113
16142
|
var __gclass__$4 = null;
|
|
16114
16143
|
function popup_mount_layer(gobj) {
|
|
@@ -16147,6 +16176,7 @@ function mt_stop$4(gobj) {
|
|
|
16147
16176
|
let shell = yui_shell_of(gobj);
|
|
16148
16177
|
if (shell) gobj_unsubscribe_event(shell, "EV_LANGUAGE_CHANGED", {}, gobj);
|
|
16149
16178
|
close_form_dialog(gobj);
|
|
16179
|
+
close_schema_dialog(gobj);
|
|
16150
16180
|
table__destroy(gobj);
|
|
16151
16181
|
}
|
|
16152
16182
|
/***************************************************************
|
|
@@ -16154,6 +16184,7 @@ function mt_stop$4(gobj) {
|
|
|
16154
16184
|
***************************************************************/
|
|
16155
16185
|
function mt_destroy$4(gobj) {
|
|
16156
16186
|
close_form_dialog(gobj);
|
|
16187
|
+
close_schema_dialog(gobj);
|
|
16157
16188
|
destroy_ui$1(gobj);
|
|
16158
16189
|
}
|
|
16159
16190
|
/************************************************************
|
|
@@ -16209,7 +16240,8 @@ function cmd_get_topic_data(gobj, cmd, kw, src) {
|
|
|
16209
16240
|
async function readClipboard(gobj) {
|
|
16210
16241
|
try {
|
|
16211
16242
|
const text = await navigator.clipboard.readText();
|
|
16212
|
-
|
|
16243
|
+
let kw = JSON.parse(text);
|
|
16244
|
+
gobj_send_event(gobj, "EV_PASTE_ROWS", kw, gobj);
|
|
16213
16245
|
} catch (error) {
|
|
16214
16246
|
log_error(`Failed to read clipboard contents: ${error}`);
|
|
16215
16247
|
}
|
|
@@ -16355,7 +16387,9 @@ function build_ui$4(gobj) {
|
|
|
16355
16387
|
let toolbar_id = gobj_read_str_attr(gobj, "toolbar_id");
|
|
16356
16388
|
let $view_toolbar = createElement2(["div", { class: "TREEDB_TABLE_TOOLS is-flex is-align-items-center" }]);
|
|
16357
16389
|
let with_refresh_button = gobj_read_bool_attr(gobj, "with_refresh_button");
|
|
16358
|
-
|
|
16390
|
+
let with_search_button = gobj_read_bool_attr(gobj, "with_search_button");
|
|
16391
|
+
let with_schema_button = gobj_read_bool_attr(gobj, "with_schema_button");
|
|
16392
|
+
if (with_search_button) {
|
|
16359
16393
|
let search_id = `${toolbar_id}_search`;
|
|
16360
16394
|
let $search_box = createElement2([
|
|
16361
16395
|
"div",
|
|
@@ -16413,6 +16447,33 @@ function build_ui$4(gobj) {
|
|
|
16413
16447
|
]);
|
|
16414
16448
|
$view_toolbar.appendChild($refresh);
|
|
16415
16449
|
}
|
|
16450
|
+
if (with_schema_button) {
|
|
16451
|
+
let $schema = createElement2([
|
|
16452
|
+
"button",
|
|
16453
|
+
{
|
|
16454
|
+
class: "TREEDB_TABLE_SCHEMA button mr-1",
|
|
16455
|
+
title: t("schema"),
|
|
16456
|
+
"data-i18n-title": "schema",
|
|
16457
|
+
"aria-label": t("schema"),
|
|
16458
|
+
"data-i18n-aria-label": "schema"
|
|
16459
|
+
},
|
|
16460
|
+
[["i", { class: "yi-hexagon-nodes" }], [
|
|
16461
|
+
"span",
|
|
16462
|
+
{
|
|
16463
|
+
class: "is-hidden-mobile",
|
|
16464
|
+
i18n: "schema",
|
|
16465
|
+
style: "padding-left:5px;"
|
|
16466
|
+
},
|
|
16467
|
+
"schema"
|
|
16468
|
+
]],
|
|
16469
|
+
{ "click": (event) => {
|
|
16470
|
+
event.stopPropagation();
|
|
16471
|
+
gobj_send_event(gobj, "EV_SHOW_SCHEMA", {}, gobj);
|
|
16472
|
+
} }
|
|
16473
|
+
]);
|
|
16474
|
+
$view_toolbar.appendChild($schema);
|
|
16475
|
+
}
|
|
16476
|
+
let table_id = gobj_read_str_attr(gobj, "table_id");
|
|
16416
16477
|
let $container = createElement2([
|
|
16417
16478
|
"div",
|
|
16418
16479
|
{
|
|
@@ -16423,7 +16484,7 @@ function build_ui$4(gobj) {
|
|
|
16423
16484
|
class: "TREEDB_TABLE_TOOLBAR toolbar_tabulator_table m-1",
|
|
16424
16485
|
style: "display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap;"
|
|
16425
16486
|
}], ["div", {
|
|
16426
|
-
id: `${
|
|
16487
|
+
id: `${table_id}`,
|
|
16427
16488
|
style: "margin-top:0px !important;"
|
|
16428
16489
|
}]]
|
|
16429
16490
|
]);
|
|
@@ -16466,7 +16527,8 @@ function destroy_ui$1(gobj) {
|
|
|
16466
16527
|
* columns); leave the rest on the flat shared key.
|
|
16467
16528
|
******************************************************************/
|
|
16468
16529
|
function col_label(col, topic_name) {
|
|
16469
|
-
|
|
16530
|
+
let keys = topic_name ? [topic_name + "." + col.id, col.id] : [col.id];
|
|
16531
|
+
return t(keys, { defaultValue: col.header || col.id });
|
|
16470
16532
|
}
|
|
16471
16533
|
/******************************************************************
|
|
16472
16534
|
* Column-title formatter: render the header as a span carrying
|
|
@@ -16592,7 +16654,6 @@ function create_tabulator(gobj) {
|
|
|
16592
16654
|
case "real":
|
|
16593
16655
|
hozAlign = "right";
|
|
16594
16656
|
sorter = "number";
|
|
16595
|
-
break;
|
|
16596
16657
|
}
|
|
16597
16658
|
let colDef = {
|
|
16598
16659
|
title: col_label(col, gobj_read_str_attr(gobj, "topic_name")),
|
|
@@ -16737,9 +16798,7 @@ function transform__treedb_value_2_table_value(gobj, col, value, row, field) {
|
|
|
16737
16798
|
case "object":
|
|
16738
16799
|
case "dict":
|
|
16739
16800
|
case "array":
|
|
16740
|
-
case "list":
|
|
16741
|
-
value = JSON.stringify(value);
|
|
16742
|
-
break;
|
|
16801
|
+
case "list": value = JSON.stringify(value);
|
|
16743
16802
|
}
|
|
16744
16803
|
break;
|
|
16745
16804
|
case "hook":
|
|
@@ -16756,14 +16815,16 @@ function transform__treedb_value_2_table_value(gobj, col, value, row, field) {
|
|
|
16756
16815
|
break;
|
|
16757
16816
|
case "fkey":
|
|
16758
16817
|
let new_value = [];
|
|
16759
|
-
if (value)
|
|
16760
|
-
|
|
16761
|
-
|
|
16762
|
-
|
|
16763
|
-
let
|
|
16764
|
-
|
|
16818
|
+
if (value) {
|
|
16819
|
+
if (is_string(value)) {
|
|
16820
|
+
let fkey = treedb_decoder_fkey(col, value);
|
|
16821
|
+
if (fkey) new_value.push(fkey.id);
|
|
16822
|
+
} else if (is_array(value)) for (let i = 0; i < value.length; i++) {
|
|
16823
|
+
let fkey = treedb_decoder_fkey(col, value[i]);
|
|
16824
|
+
if (fkey) new_value.push(fkey.id);
|
|
16825
|
+
}
|
|
16826
|
+
else log_error("fkey type unsupported: " + JSON.stringify(value));
|
|
16765
16827
|
}
|
|
16766
|
-
else log_error("fkey type unsupported: " + JSON.stringify(value));
|
|
16767
16828
|
value = new_value.join(", ");
|
|
16768
16829
|
break;
|
|
16769
16830
|
case "now":
|
|
@@ -16784,14 +16845,11 @@ function transform__treedb_value_2_table_value(gobj, col, value, row, field) {
|
|
|
16784
16845
|
second: "2-digit",
|
|
16785
16846
|
hour12: true
|
|
16786
16847
|
}).format(value) + "</span>";
|
|
16787
|
-
break;
|
|
16788
16848
|
}
|
|
16789
16849
|
break;
|
|
16790
16850
|
case "color": break;
|
|
16791
16851
|
case "image": break;
|
|
16792
|
-
default:
|
|
16793
|
-
log_error(`transform__treedb_value_2_table_value() unhandled type '${field_desc.type}' (real_type='${field_desc.real_type}') for field '${field}', topic ${priv.topic_name}`);
|
|
16794
|
-
break;
|
|
16852
|
+
default: log_error(`transform__treedb_value_2_table_value() unhandled type '${field_desc.type}' (real_type='${field_desc.real_type}') for field '${field}', topic ${priv.topic_name}`);
|
|
16795
16853
|
}
|
|
16796
16854
|
if (value !== null && value !== void 0 && typeof value === "object" && !(value instanceof Node)) {
|
|
16797
16855
|
log_error(`transform__treedb_value_2_table_value() unexpected object value for field '${field}' (type='${field_desc.type}', real_type='${field_desc.real_type}'): ${JSON.stringify(value)}, topic ${priv.topic_name}`);
|
|
@@ -16959,6 +17017,83 @@ function close_form_dialog(gobj) {
|
|
|
16959
17017
|
teardown_form_child(gobj);
|
|
16960
17018
|
}
|
|
16961
17019
|
/************************************************************
|
|
17020
|
+
* Show the topic's SCHEMA: its `desc` — pkey, cols, types,
|
|
17021
|
+
* flags and fkey targets — in the standardized adaptive
|
|
17022
|
+
* dialog, rendered by a C_YUI_JSON child. A viewer and not a
|
|
17023
|
+
* <pre> dump because a forty-column topic is only readable
|
|
17024
|
+
* collapsed and searchable.
|
|
17025
|
+
*
|
|
17026
|
+
* Read-only and offline: the desc is already in this gobj,
|
|
17027
|
+
* so no command is issued and nothing can be edited here.
|
|
17028
|
+
************************************************************/
|
|
17029
|
+
function open_schema_dialog(gobj) {
|
|
17030
|
+
close_schema_dialog(gobj);
|
|
17031
|
+
let priv = gobj.priv;
|
|
17032
|
+
let desc = gobj_read_attr(gobj, "desc");
|
|
17033
|
+
if (!desc) {
|
|
17034
|
+
log_error(`${gobj_short_name(gobj)}: no desc, no schema to show`);
|
|
17035
|
+
return;
|
|
17036
|
+
}
|
|
17037
|
+
let shell = yui_shell_of(gobj);
|
|
17038
|
+
if (!shell) {
|
|
17039
|
+
log_error(`${gobj_short_name(gobj)}: no shell, cannot open the schema view`);
|
|
17040
|
+
return;
|
|
17041
|
+
}
|
|
17042
|
+
let json_view = gobj_create_pure_child("schema_" + clean_name(gobj_name(gobj)), "C_YUI_JSON", {}, gobj);
|
|
17043
|
+
if (!json_view) {
|
|
17044
|
+
log_error(`${gobj_short_name(gobj)}: cannot create the schema viewer`);
|
|
17045
|
+
return;
|
|
17046
|
+
}
|
|
17047
|
+
priv.schema_gobj = json_view;
|
|
17048
|
+
gobj_start(json_view);
|
|
17049
|
+
let $box = gobj_read_attr(json_view, "$container");
|
|
17050
|
+
if (!$box) {
|
|
17051
|
+
log_error(`${gobj_short_name(gobj)}: the schema viewer built no $container`);
|
|
17052
|
+
teardown_schema_child(gobj);
|
|
17053
|
+
return;
|
|
17054
|
+
}
|
|
17055
|
+
priv.schema_modal = yui_shell_show_modal(shell, $box, {
|
|
17056
|
+
dialog: true,
|
|
17057
|
+
logical_class: "TREEDB_SCHEMA_SHEET",
|
|
17058
|
+
title_prefix: gobj_read_str_attr(gobj, "topic_name"),
|
|
17059
|
+
title: "schema",
|
|
17060
|
+
t,
|
|
17061
|
+
on_close: function() {
|
|
17062
|
+
teardown_schema_child(gobj);
|
|
17063
|
+
}
|
|
17064
|
+
});
|
|
17065
|
+
gobj_send_event(json_view, "EV_SET_JSON", { json: desc }, gobj);
|
|
17066
|
+
}
|
|
17067
|
+
/************************************************************
|
|
17068
|
+
* Destroy the hosted C_YUI_JSON child. Called from the
|
|
17069
|
+
* schema modal's on_close — the shell has already removed
|
|
17070
|
+
* the dialog DOM and retired its Escape / history entries.
|
|
17071
|
+
************************************************************/
|
|
17072
|
+
function teardown_schema_child(gobj) {
|
|
17073
|
+
let priv = gobj.priv;
|
|
17074
|
+
if (priv.schema_gobj) {
|
|
17075
|
+
if (gobj_is_running(priv.schema_gobj)) gobj_stop(priv.schema_gobj);
|
|
17076
|
+
gobj_destroy(priv.schema_gobj);
|
|
17077
|
+
priv.schema_gobj = null;
|
|
17078
|
+
}
|
|
17079
|
+
priv.schema_modal = null;
|
|
17080
|
+
}
|
|
17081
|
+
/************************************************************
|
|
17082
|
+
* Close the schema dialog (teardown, or a second open).
|
|
17083
|
+
* Closing the modal runs its on_close, which tears the
|
|
17084
|
+
* viewer child down.
|
|
17085
|
+
************************************************************/
|
|
17086
|
+
function close_schema_dialog(gobj) {
|
|
17087
|
+
let priv = gobj.priv;
|
|
17088
|
+
if (priv.schema_modal) {
|
|
17089
|
+
let modal = priv.schema_modal;
|
|
17090
|
+
priv.schema_modal = null;
|
|
17091
|
+
modal.close();
|
|
17092
|
+
return;
|
|
17093
|
+
}
|
|
17094
|
+
teardown_schema_child(gobj);
|
|
17095
|
+
}
|
|
17096
|
+
/************************************************************
|
|
16962
17097
|
* True if the topic's pkey col carries the "rowid" flag.
|
|
16963
17098
|
************************************************************/
|
|
16964
17099
|
function pkey_is_rowid(gobj) {
|
|
@@ -17072,16 +17207,16 @@ function transform__form_value_2_treedb_value(gobj, col, value, operation) {
|
|
|
17072
17207
|
case "enum":
|
|
17073
17208
|
switch (field_desc.real_type) {
|
|
17074
17209
|
case "string":
|
|
17075
|
-
if (is_array(value))
|
|
17076
|
-
|
|
17210
|
+
if (is_array(value)) {
|
|
17211
|
+
if (value.length > 0) value = value[0];
|
|
17212
|
+
else value = "";
|
|
17213
|
+
}
|
|
17077
17214
|
break;
|
|
17078
17215
|
case "object":
|
|
17079
17216
|
case "dict":
|
|
17080
17217
|
case "array":
|
|
17081
17218
|
case "list": break;
|
|
17082
|
-
default:
|
|
17083
|
-
log_error("col type unknown 6: " + field_desc.real_type);
|
|
17084
|
-
break;
|
|
17219
|
+
default: log_error("col type unknown 6: " + field_desc.real_type);
|
|
17085
17220
|
}
|
|
17086
17221
|
break;
|
|
17087
17222
|
case "now":
|
|
@@ -17093,23 +17228,17 @@ function transform__form_value_2_treedb_value(gobj, col, value, operation) {
|
|
|
17093
17228
|
case "integer":
|
|
17094
17229
|
if (value && is_date(value)) value = value.getTime() / 1e3;
|
|
17095
17230
|
break;
|
|
17096
|
-
default:
|
|
17097
|
-
log_error("col type unknown 7: " + field_desc.real_type);
|
|
17098
|
-
break;
|
|
17231
|
+
default: log_error("col type unknown 7: " + field_desc.real_type);
|
|
17099
17232
|
}
|
|
17100
17233
|
break;
|
|
17101
17234
|
case "color":
|
|
17102
17235
|
switch (field_desc.real_type) {
|
|
17103
17236
|
case "string": break;
|
|
17104
17237
|
case "integer": break;
|
|
17105
|
-
default:
|
|
17106
|
-
log_error("col type unknown 7: " + field_desc.real_type);
|
|
17107
|
-
break;
|
|
17238
|
+
default: log_error("col type unknown 7: " + field_desc.real_type);
|
|
17108
17239
|
}
|
|
17109
17240
|
break;
|
|
17110
|
-
default:
|
|
17111
|
-
log_error("col type unknown 8: " + field_desc.type);
|
|
17112
|
-
break;
|
|
17241
|
+
default: log_error("col type unknown 8: " + field_desc.type);
|
|
17113
17242
|
}
|
|
17114
17243
|
return value;
|
|
17115
17244
|
}
|
|
@@ -17151,9 +17280,7 @@ function build_fkey_ref(gobj, col, value) {
|
|
|
17151
17280
|
refs[topic_name + "^" + v + "^" + hook] = true;
|
|
17152
17281
|
break;
|
|
17153
17282
|
case "array":
|
|
17154
|
-
case "list":
|
|
17155
|
-
refs.push(topic_name + "^" + v + "^" + hook);
|
|
17156
|
-
break;
|
|
17283
|
+
case "list": refs.push(topic_name + "^" + v + "^" + hook);
|
|
17157
17284
|
}
|
|
17158
17285
|
} else if (is_object(v)) {
|
|
17159
17286
|
let topic_name = v.topic_name;
|
|
@@ -17166,9 +17293,7 @@ function build_fkey_ref(gobj, col, value) {
|
|
|
17166
17293
|
refs[topic_name + "^" + v.id + "^" + hook] = true;
|
|
17167
17294
|
break;
|
|
17168
17295
|
case "array":
|
|
17169
|
-
case "list":
|
|
17170
|
-
refs.push(topic_name + "^" + v.id + "^" + hook);
|
|
17171
|
-
break;
|
|
17296
|
+
case "list": refs.push(topic_name + "^" + v.id + "^" + hook);
|
|
17172
17297
|
}
|
|
17173
17298
|
} else {
|
|
17174
17299
|
log_error("Merde value1: " + v);
|
|
@@ -17285,8 +17410,10 @@ function ac_load_nodes(gobj, event, kw, src) {
|
|
|
17285
17410
|
return -1;
|
|
17286
17411
|
}
|
|
17287
17412
|
let tabulator = gobj_read_attr(gobj, "tabulator");
|
|
17288
|
-
if (tabulator)
|
|
17289
|
-
|
|
17413
|
+
if (tabulator) {
|
|
17414
|
+
if (tabulator._ready) tabulator.setData(data);
|
|
17415
|
+
else tabulator._pendingData = data;
|
|
17416
|
+
}
|
|
17290
17417
|
return 0;
|
|
17291
17418
|
}
|
|
17292
17419
|
/************************************************************
|
|
@@ -17395,9 +17522,7 @@ function ac_new_row(gobj, event, kw, src) {
|
|
|
17395
17522
|
case "template":
|
|
17396
17523
|
if (col.template) row[col.id] = col.template;
|
|
17397
17524
|
break;
|
|
17398
|
-
default:
|
|
17399
|
-
if (field_desc.default_value !== void 0) row[col.id] = field_desc.default_value;
|
|
17400
|
-
break;
|
|
17525
|
+
default: if (field_desc.default_value !== void 0) row[col.id] = field_desc.default_value;
|
|
17401
17526
|
}
|
|
17402
17527
|
}
|
|
17403
17528
|
show_create_form(gobj, row);
|
|
@@ -17488,7 +17613,8 @@ function ac_paste_rows(gobj, event, kw, src) {
|
|
|
17488
17613
|
* fkeys, times and numbers). Route by the form's mode.
|
|
17489
17614
|
************************************************************/
|
|
17490
17615
|
function ac_form_save_record(gobj, event, kw, src) {
|
|
17491
|
-
|
|
17616
|
+
let mode = gobj_read_str_attr(src, "form_mode");
|
|
17617
|
+
gobj_publish_event(gobj, mode === "create" ? "EV_CREATE_RECORD" : "EV_UPDATE_RECORD", {
|
|
17492
17618
|
topic_name: gobj_read_str_attr(gobj, "topic_name"),
|
|
17493
17619
|
record: kw
|
|
17494
17620
|
});
|
|
@@ -17505,12 +17631,14 @@ function ac_select_rows(gobj, event, kw, src) {
|
|
|
17505
17631
|
let $container = gobj_read_attr(gobj, "$container");
|
|
17506
17632
|
let $button_delete_record = $container.querySelector(`.button-delete-record`);
|
|
17507
17633
|
let $button_copy_record = $container.querySelector(`.button-copy-record`);
|
|
17508
|
-
if ($button_delete_record)
|
|
17509
|
-
|
|
17510
|
-
|
|
17511
|
-
|
|
17512
|
-
|
|
17513
|
-
|
|
17634
|
+
if ($button_delete_record) {
|
|
17635
|
+
if (tabulator.getSelectedData().length && gobj_read_bool_attr(gobj, "editable")) {
|
|
17636
|
+
$button_delete_record.removeAttribute("disabled");
|
|
17637
|
+
$button_copy_record.removeAttribute("disabled");
|
|
17638
|
+
} else {
|
|
17639
|
+
$button_delete_record.setAttribute("disabled", true);
|
|
17640
|
+
$button_copy_record.setAttribute("disabled", true);
|
|
17641
|
+
}
|
|
17514
17642
|
}
|
|
17515
17643
|
if (gobj_read_bool_attr(gobj, "broadcast_select_rows_event")) gobj_publish_event(gobj, event, kw);
|
|
17516
17644
|
return 0;
|
|
@@ -17523,12 +17651,14 @@ function ac_unselect_rows(gobj, event, kw, src) {
|
|
|
17523
17651
|
let $container = gobj_read_attr(gobj, "$container");
|
|
17524
17652
|
let $button_delete_record = $container.querySelector(`.button-delete-record`);
|
|
17525
17653
|
let $button_copy_record = $container.querySelector(`.button-copy-record`);
|
|
17526
|
-
if ($button_delete_record)
|
|
17527
|
-
|
|
17528
|
-
|
|
17529
|
-
|
|
17530
|
-
|
|
17531
|
-
|
|
17654
|
+
if ($button_delete_record) {
|
|
17655
|
+
if (tabulator.getSelectedData().length && gobj_read_bool_attr(gobj, "editable")) {
|
|
17656
|
+
$button_delete_record.removeAttribute("disabled");
|
|
17657
|
+
$button_copy_record.removeAttribute("disabled");
|
|
17658
|
+
} else {
|
|
17659
|
+
$button_delete_record.setAttribute("disabled", true);
|
|
17660
|
+
$button_copy_record.setAttribute("disabled", true);
|
|
17661
|
+
}
|
|
17532
17662
|
}
|
|
17533
17663
|
if (gobj_read_bool_attr(gobj, "broadcast_select_rows_event")) gobj_publish_event(gobj, event, kw);
|
|
17534
17664
|
return 0;
|
|
@@ -17550,7 +17680,8 @@ function ac_change_locale(gobj, event, kw, src) {
|
|
|
17550
17680
|
* };
|
|
17551
17681
|
************************************************************/
|
|
17552
17682
|
function ac_show_hook_data$1(gobj, event, kw, src) {
|
|
17553
|
-
let
|
|
17683
|
+
let webix = gobj_command(gobj_parent(gobj), "get_topic_data", kw, gobj);
|
|
17684
|
+
let row = kwid_find_one_record(gobj, webix.data, kw.row_id, null);
|
|
17554
17685
|
if (row) {
|
|
17555
17686
|
let cell = row[kw.col_id];
|
|
17556
17687
|
show_dropdown_popup_menu(gobj, kw.click_x, kw.click_y, cell);
|
|
@@ -17565,6 +17696,13 @@ function ac_refresh$1(gobj, event, kw, src) {
|
|
|
17565
17696
|
return 0;
|
|
17566
17697
|
}
|
|
17567
17698
|
/************************************************************
|
|
17699
|
+
* Show the schema (desc) of this topic
|
|
17700
|
+
************************************************************/
|
|
17701
|
+
function ac_show_schema(gobj, event, kw, src) {
|
|
17702
|
+
open_schema_dialog(gobj);
|
|
17703
|
+
return 0;
|
|
17704
|
+
}
|
|
17705
|
+
/************************************************************
|
|
17568
17706
|
* {
|
|
17569
17707
|
* href: href
|
|
17570
17708
|
* }
|
|
@@ -17678,6 +17816,11 @@ function create_gclass$4(gclass_name) {
|
|
|
17678
17816
|
ac_refresh$1,
|
|
17679
17817
|
null
|
|
17680
17818
|
],
|
|
17819
|
+
[
|
|
17820
|
+
"EV_SHOW_SCHEMA",
|
|
17821
|
+
ac_show_schema,
|
|
17822
|
+
null
|
|
17823
|
+
],
|
|
17681
17824
|
[
|
|
17682
17825
|
"EV_SHOW",
|
|
17683
17826
|
ac_show$3,
|
|
@@ -17689,7 +17832,7 @@ function create_gclass$4(gclass_name) {
|
|
|
17689
17832
|
null
|
|
17690
17833
|
]
|
|
17691
17834
|
]]];
|
|
17692
|
-
|
|
17835
|
+
const event_types = [
|
|
17693
17836
|
["EV_LANGUAGE_CHANGED", 0],
|
|
17694
17837
|
["EV_LOAD_NODES", 0],
|
|
17695
17838
|
["EV_LOAD_NODE_CREATED", 0],
|
|
@@ -17706,13 +17849,15 @@ function create_gclass$4(gclass_name) {
|
|
|
17706
17849
|
["EV_SHOW_HOOK_DATA", event_flag_t.EVF_OUTPUT_EVENT],
|
|
17707
17850
|
["EV_CHANGE_LOCALE", 0],
|
|
17708
17851
|
["EV_REFRESH", 0],
|
|
17852
|
+
["EV_SHOW_SCHEMA", 0],
|
|
17709
17853
|
["EV_CREATE_RECORD", event_flag_t.EVF_OUTPUT_EVENT],
|
|
17710
17854
|
["EV_UPDATE_RECORD", event_flag_t.EVF_OUTPUT_EVENT],
|
|
17711
17855
|
["EV_DELETE_RECORD", event_flag_t.EVF_OUTPUT_EVENT],
|
|
17712
17856
|
["EV_REFRESH_TOPIC", event_flag_t.EVF_OUTPUT_EVENT],
|
|
17713
17857
|
["EV_SHOW", 0],
|
|
17714
17858
|
["EV_HIDE", 0]
|
|
17715
|
-
]
|
|
17859
|
+
];
|
|
17860
|
+
__gclass__$4 = gclass_create(gclass_name, event_types, states, gmt$4, 0, attrs_table$4, PRIVATE_DATA$4, 0, 0, 0, 0);
|
|
17716
17861
|
if (!__gclass__$4) return -1;
|
|
17717
17862
|
return 0;
|
|
17718
17863
|
}
|
|
@@ -17721,6 +17866,7 @@ function create_gclass$4(gclass_name) {
|
|
|
17721
17866
|
***************************************************************/
|
|
17722
17867
|
function register_c_yui_treedb_topic_with_form() {
|
|
17723
17868
|
if (!gclass_find_by_name("C_YUI_FORM", false)) register_c_yui_form();
|
|
17869
|
+
if (!gclass_find_by_name("C_YUI_JSON", false)) register_c_yui_json();
|
|
17724
17870
|
return create_gclass$4(GCLASS_NAME$4);
|
|
17725
17871
|
}
|
|
17726
17872
|
//#endregion
|
|
@@ -17907,7 +18053,8 @@ function mt_create$3(gobj) {
|
|
|
17907
18053
|
if (!subscriber) subscriber = gobj_parent(gobj);
|
|
17908
18054
|
gobj_subscribe_event(gobj, null, {}, subscriber);
|
|
17909
18055
|
if (!priv.treedb_name) log_error(`${gobj_name(gobj)} -> treedb_name not configured`);
|
|
17910
|
-
|
|
18056
|
+
let canvas_id = clean_name(gobj_name(gobj)) + "-canvas";
|
|
18057
|
+
gobj_write_attr(gobj, "canvas_id", canvas_id);
|
|
17911
18058
|
let $container_canvas = build_ui$3(gobj).querySelector(`#${priv.canvas_id}`);
|
|
17912
18059
|
priv.gobj_nodes_tree = gobj_create_service(`${gobj_name(gobj)}-g6`, "C_G6_NODES_TREE", {
|
|
17913
18060
|
$container: $container_canvas,
|
|
@@ -18693,8 +18840,10 @@ function ac_mt_command_answer(gobj, event, kw, src) {
|
|
|
18693
18840
|
else gobj_send_event(jv, "EV_SET_JSON", { json: data }, gobj);
|
|
18694
18841
|
return 0;
|
|
18695
18842
|
}
|
|
18696
|
-
if (result < 0)
|
|
18697
|
-
|
|
18843
|
+
if (result < 0) {
|
|
18844
|
+
if (command === "descs") show_load_error(gobj, t(comment));
|
|
18845
|
+
else yui_shell_show_error(yui_shell_of(gobj), comment, { t });
|
|
18846
|
+
}
|
|
18698
18847
|
switch (command) {
|
|
18699
18848
|
case "descs":
|
|
18700
18849
|
if (result >= 0) process_treedb_descs(gobj, data);
|
|
@@ -19230,7 +19379,7 @@ function create_gclass$3(gclass_name) {
|
|
|
19230
19379
|
null
|
|
19231
19380
|
]
|
|
19232
19381
|
]]];
|
|
19233
|
-
|
|
19382
|
+
const event_types = [
|
|
19234
19383
|
["EV_MT_COMMAND_ANSWER", event_flag_t.EVF_PUBLIC_EVENT],
|
|
19235
19384
|
["EV_TREEDB_NODE_CREATED", event_flag_t.EVF_PUBLIC_EVENT],
|
|
19236
19385
|
["EV_TREEDB_NODE_UPDATED", event_flag_t.EVF_PUBLIC_EVENT],
|
|
@@ -19259,7 +19408,8 @@ function create_gclass$3(gclass_name) {
|
|
|
19259
19408
|
["EV_SHOW", 0],
|
|
19260
19409
|
["EV_HIDE", 0],
|
|
19261
19410
|
["EV_TRANSPORT_STATE", 0]
|
|
19262
|
-
]
|
|
19411
|
+
];
|
|
19412
|
+
__gclass__$3 = gclass_create(gclass_name, event_types, states, gmt$3, 0, attrs_table$3, PRIVATE_DATA$3, 0, 0, 0, 0);
|
|
19263
19413
|
if (!__gclass__$3) return -1;
|
|
19264
19414
|
return 0;
|
|
19265
19415
|
}
|
|
@@ -19338,14 +19488,15 @@ function mt_destroy$2(gobj) {
|
|
|
19338
19488
|
* Build UI
|
|
19339
19489
|
************************************************************/
|
|
19340
19490
|
function build_ui$2(gobj) {
|
|
19341
|
-
|
|
19491
|
+
let $container = createElement2([
|
|
19342
19492
|
"div",
|
|
19343
19493
|
{
|
|
19344
19494
|
class: "C_YUI_TREEDB_SCHEMA TREEDB_SCHEMA_VIEW",
|
|
19345
19495
|
style: "position:relative; height:100%; min-height:0;"
|
|
19346
19496
|
},
|
|
19347
19497
|
[]
|
|
19348
|
-
])
|
|
19498
|
+
]);
|
|
19499
|
+
gobj_write_attr(gobj, "$container", $container);
|
|
19349
19500
|
}
|
|
19350
19501
|
/************************************************************
|
|
19351
19502
|
* Derive {nodes, edges} from the schema.
|
|
@@ -19470,7 +19621,8 @@ function build_graph$1(gobj) {
|
|
|
19470
19621
|
priv.graph = graph;
|
|
19471
19622
|
graph.setTheme(dark ? "dark" : "light");
|
|
19472
19623
|
graph.on(NodeEvent.CLICK, (evt) => {
|
|
19473
|
-
|
|
19624
|
+
let node_id = evt && evt.target && evt.target.id;
|
|
19625
|
+
gobj_send_event(gobj, "EV_NODE_CLICK", { node_id }, gobj);
|
|
19474
19626
|
});
|
|
19475
19627
|
graph.render().then(() => {
|
|
19476
19628
|
try {
|
|
@@ -23599,7 +23751,6 @@ function segmentToCubic(segment, params) {
|
|
|
23599
23751
|
py
|
|
23600
23752
|
];
|
|
23601
23753
|
return ["C"].concat(lineToCubic(px1, py1, px, py));
|
|
23602
|
-
default:
|
|
23603
23754
|
}
|
|
23604
23755
|
return segment;
|
|
23605
23756
|
}
|
|
@@ -23623,7 +23774,8 @@ function path2Curve(pathInput, needZCommandIndexes) {
|
|
|
23623
23774
|
for (var i = 0; i < ii; i += 1) {
|
|
23624
23775
|
if (path[i]) pathCommand = path[i][0];
|
|
23625
23776
|
allPathCommands[i] = pathCommand;
|
|
23626
|
-
|
|
23777
|
+
var curveSegment = segmentToCubic(path[i], params);
|
|
23778
|
+
path[i] = curveSegment;
|
|
23627
23779
|
fixArc(path, allPathCommands, i);
|
|
23628
23780
|
ii = path.length;
|
|
23629
23781
|
if (pathCommand === "Z") zCommandIndexes.push(i);
|
|
@@ -23675,20 +23827,22 @@ function segmentLineFactory(x1, y1, x2, y2, distance) {
|
|
|
23675
23827
|
x: 0,
|
|
23676
23828
|
y: 0
|
|
23677
23829
|
};
|
|
23678
|
-
if (typeof distance === "number")
|
|
23679
|
-
|
|
23680
|
-
|
|
23681
|
-
|
|
23682
|
-
|
|
23683
|
-
|
|
23684
|
-
|
|
23685
|
-
|
|
23686
|
-
else {
|
|
23687
|
-
var _a = midPoint([x1, y1], [x2, y2], distance / length);
|
|
23688
|
-
point = {
|
|
23689
|
-
x: _a[0],
|
|
23690
|
-
y: _a[1]
|
|
23830
|
+
if (typeof distance === "number") {
|
|
23831
|
+
if (distance <= 0) point = {
|
|
23832
|
+
x: x1,
|
|
23833
|
+
y: y1
|
|
23834
|
+
};
|
|
23835
|
+
else if (distance >= length) point = {
|
|
23836
|
+
x: x2,
|
|
23837
|
+
y: y2
|
|
23691
23838
|
};
|
|
23839
|
+
else {
|
|
23840
|
+
var _a = midPoint([x1, y1], [x2, y2], distance / length);
|
|
23841
|
+
point = {
|
|
23842
|
+
x: _a[0],
|
|
23843
|
+
y: _a[1]
|
|
23844
|
+
};
|
|
23845
|
+
}
|
|
23692
23846
|
}
|
|
23693
23847
|
return {
|
|
23694
23848
|
length,
|
|
@@ -25244,7 +25398,11 @@ var Rectangle = /*#__PURE__*/ function() {
|
|
|
25244
25398
|
value: function toJSON() {}
|
|
25245
25399
|
}], [{
|
|
25246
25400
|
key: "fromRect",
|
|
25247
|
-
value:
|
|
25401
|
+
value:
|
|
25402
|
+
/**
|
|
25403
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/DOMRect/fromRect_static
|
|
25404
|
+
*/
|
|
25405
|
+
function fromRect(rect) {
|
|
25248
25406
|
return new Rectangle(rect.x, rect.y, rect.width, rect.height);
|
|
25249
25407
|
}
|
|
25250
25408
|
}, {
|
|
@@ -25334,14 +25492,15 @@ function getEulerFromMat4(out, m) {
|
|
|
25334
25492
|
var z;
|
|
25335
25493
|
var _mat4$getScaling2 = _slicedToArray(getScaling(create$3(), m), 3), sx = _mat4$getScaling2[0], sy = _mat4$getScaling2[1], sz = _mat4$getScaling2[2];
|
|
25336
25494
|
var y = Math.asin(-m[2] / sx);
|
|
25337
|
-
if (y < HALF_PI)
|
|
25338
|
-
|
|
25339
|
-
|
|
25495
|
+
if (y < HALF_PI) {
|
|
25496
|
+
if (y > -HALF_PI) {
|
|
25497
|
+
x = Math.atan2(m[6] / sy, m[10] / sz);
|
|
25498
|
+
z = Math.atan2(m[1] / sx, m[0] / sx);
|
|
25499
|
+
} else {
|
|
25500
|
+
z = 0;
|
|
25501
|
+
x = -Math.atan2(m[4] / sy, m[5] / sy);
|
|
25502
|
+
}
|
|
25340
25503
|
} else {
|
|
25341
|
-
z = 0;
|
|
25342
|
-
x = -Math.atan2(m[4] / sy, m[5] / sy);
|
|
25343
|
-
}
|
|
25344
|
-
else {
|
|
25345
25504
|
z = 0;
|
|
25346
25505
|
x = Math.atan2(m[4] / sy, m[5] / sy);
|
|
25347
25506
|
}
|
|
@@ -25408,8 +25567,10 @@ function decompose(mat) {
|
|
|
25408
25567
|
var row1y = mat[4];
|
|
25409
25568
|
var scalingX = Math.sqrt(row0x * row0x + row0y * row0y);
|
|
25410
25569
|
var scalingY = Math.sqrt(row1x * row1x + row1y * row1y);
|
|
25411
|
-
if (row0x * row1y - row0y * row1x < 0)
|
|
25412
|
-
|
|
25570
|
+
if (row0x * row1y - row0y * row1x < 0) {
|
|
25571
|
+
if (row0x < row1y) scalingX = -scalingX;
|
|
25572
|
+
else scalingY = -scalingY;
|
|
25573
|
+
}
|
|
25413
25574
|
if (scalingX) {
|
|
25414
25575
|
var invScalingX = 1 / scalingX;
|
|
25415
25576
|
row0x *= invScalingX;
|
|
@@ -26383,9 +26544,10 @@ function updateLocalTransform(transform) {
|
|
|
26383
26544
|
var hasRotation = localRotation[3] !== 1 || localRotation[0] !== 0 || localRotation[1] !== 0 || localRotation[2] !== 0;
|
|
26384
26545
|
var hasScale = localScale[0] !== 1 || localScale[1] !== 1 || localScale[2] !== 1;
|
|
26385
26546
|
var hasOrigin = origin[0] !== 0 || origin[1] !== 0 || origin[2] !== 0;
|
|
26386
|
-
if (!hasRotation && !hasScale && !hasOrigin)
|
|
26387
|
-
|
|
26388
|
-
|
|
26547
|
+
if (!hasRotation && !hasScale && !hasOrigin) {
|
|
26548
|
+
if (hasPosition) fromTranslation(localTransform, localPosition);
|
|
26549
|
+
else identity(localTransform);
|
|
26550
|
+
} else fromRotationTranslationScaleOrigin(localTransform, localRotation, localPosition, localScale, origin);
|
|
26389
26551
|
}
|
|
26390
26552
|
transform.localDirtyFlag = false;
|
|
26391
26553
|
}
|
|
@@ -26973,9 +27135,7 @@ var conversionToCanonicalUnitsScaleFactor = function conversionToCanonicalUnitsS
|
|
|
26973
27135
|
case UnitType.kGradians:
|
|
26974
27136
|
factor = .9;
|
|
26975
27137
|
break;
|
|
26976
|
-
case UnitType.kTurns:
|
|
26977
|
-
factor = 360;
|
|
26978
|
-
break;
|
|
27138
|
+
case UnitType.kTurns: factor = 360;
|
|
26979
27139
|
}
|
|
26980
27140
|
return factor;
|
|
26981
27141
|
};
|
|
@@ -27149,9 +27309,10 @@ var CSSKeywordValue = /*#__PURE__*/ function(_CSSStyleValue) {
|
|
|
27149
27309
|
var formatInfinityOrNaN = function formatInfinityOrNaN(number) {
|
|
27150
27310
|
var suffix = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "";
|
|
27151
27311
|
var result = "";
|
|
27152
|
-
if (!Number.isFinite(number))
|
|
27153
|
-
|
|
27154
|
-
|
|
27312
|
+
if (!Number.isFinite(number)) {
|
|
27313
|
+
if (number > 0) result = "infinity";
|
|
27314
|
+
else result = "-infinity";
|
|
27315
|
+
} else result = "NaN";
|
|
27155
27316
|
return result += suffix;
|
|
27156
27317
|
};
|
|
27157
27318
|
var toCanonicalUnit = function toCanonicalUnit(unit) {
|
|
@@ -27720,8 +27881,10 @@ var parseGradient = memoize(function(colorStr) {
|
|
|
27720
27881
|
}
|
|
27721
27882
|
} else if (type === "r") {
|
|
27722
27883
|
var parsedRadialGradient = parseRadialGradient(colorStr);
|
|
27723
|
-
if (parsedRadialGradient)
|
|
27724
|
-
|
|
27884
|
+
if (parsedRadialGradient) {
|
|
27885
|
+
if (isString(parsedRadialGradient)) colorStr = parsedRadialGradient;
|
|
27886
|
+
else return [new CSSGradientValue(GradientType.RadialGradient, parsedRadialGradient)];
|
|
27887
|
+
}
|
|
27725
27888
|
} else if (type === "p") return parsePattern(colorStr);
|
|
27726
27889
|
}
|
|
27727
27890
|
});
|
|
@@ -28138,7 +28301,6 @@ function getPathBBox(segments, lineWidth) {
|
|
|
28138
28301
|
default:
|
|
28139
28302
|
xArr.push(currentPoint[0]);
|
|
28140
28303
|
yArr.push(currentPoint[1]);
|
|
28141
|
-
break;
|
|
28142
28304
|
}
|
|
28143
28305
|
if (box$1) {
|
|
28144
28306
|
segment.box = box$1;
|
|
@@ -28313,9 +28475,7 @@ function path2Segments(path) {
|
|
|
28313
28475
|
startMovePoint = [params[1], params[2]];
|
|
28314
28476
|
lastStartMovePointIndex = i;
|
|
28315
28477
|
break;
|
|
28316
|
-
case "A":
|
|
28317
|
-
segment.arcParams = getArcParams(currentPoint, params);
|
|
28318
|
-
break;
|
|
28478
|
+
case "A": segment.arcParams = getArcParams(currentPoint, params);
|
|
28319
28479
|
}
|
|
28320
28480
|
if (command === "Z") {
|
|
28321
28481
|
currentPoint = startMovePoint;
|
|
@@ -29602,10 +29762,12 @@ var parseTransformOrigin = memoize(function(value) {
|
|
|
29602
29762
|
if (isString(value)) {
|
|
29603
29763
|
if (value === "text-anchor") return [getOrCreateUnitValue(0, "px"), getOrCreateUnitValue(0, "px")];
|
|
29604
29764
|
var values = value.split(" ");
|
|
29605
|
-
if (values.length === 1)
|
|
29606
|
-
values[
|
|
29607
|
-
|
|
29608
|
-
|
|
29765
|
+
if (values.length === 1) {
|
|
29766
|
+
if (values[0] === "top" || values[0] === "bottom") {
|
|
29767
|
+
values[1] = values[0];
|
|
29768
|
+
values[0] = "center";
|
|
29769
|
+
} else values[1] = "center";
|
|
29770
|
+
}
|
|
29609
29771
|
if (values.length !== 2) return null;
|
|
29610
29772
|
return [parseLengthOrPercentage(convertKeyword2Percent(values[0])), parseLengthOrPercentage(convertKeyword2Percent(values[1]))];
|
|
29611
29773
|
}
|
|
@@ -30483,7 +30645,14 @@ var CSSPropertyLengthOrPercentage = /*#__PURE__*/ function() {
|
|
|
30483
30645
|
}
|
|
30484
30646
|
return _createClass(CSSPropertyLengthOrPercentage, [{
|
|
30485
30647
|
key: "calculator",
|
|
30486
|
-
value:
|
|
30648
|
+
value:
|
|
30649
|
+
/**
|
|
30650
|
+
* according to parent's bounds
|
|
30651
|
+
*
|
|
30652
|
+
* @example
|
|
30653
|
+
* CSS.percent(50) -> CSS.px(0.5 * parent.width)
|
|
30654
|
+
*/
|
|
30655
|
+
function calculator(name, oldParsed, computed, object, runtime) {
|
|
30487
30656
|
if (isNumber(computed)) return computed;
|
|
30488
30657
|
if (CSSUnitValue.isRelativeUnit(computed.unit)) {
|
|
30489
30658
|
if (computed.unit === UnitType.kPercentage) return 0;
|
|
@@ -31400,7 +31569,19 @@ var FederatedEvent = /*#__PURE__*/ function() {
|
|
|
31400
31569
|
return _createClass(FederatedEvent, [
|
|
31401
31570
|
{
|
|
31402
31571
|
key: "name",
|
|
31403
|
-
get:
|
|
31572
|
+
get:
|
|
31573
|
+
/**
|
|
31574
|
+
* The type of event, supports the following:
|
|
31575
|
+
* * pointerdown
|
|
31576
|
+
* * touchstart
|
|
31577
|
+
* * mousedown
|
|
31578
|
+
* * rightdown
|
|
31579
|
+
* * ...
|
|
31580
|
+
*/
|
|
31581
|
+
/**
|
|
31582
|
+
* @deprecated
|
|
31583
|
+
*/
|
|
31584
|
+
function get() {
|
|
31404
31585
|
return this.type;
|
|
31405
31586
|
}
|
|
31406
31587
|
},
|
|
@@ -31466,7 +31647,15 @@ var FederatedEvent = /*#__PURE__*/ function() {
|
|
|
31466
31647
|
},
|
|
31467
31648
|
{
|
|
31468
31649
|
key: "composedPath",
|
|
31469
|
-
value:
|
|
31650
|
+
value:
|
|
31651
|
+
/**
|
|
31652
|
+
* The propagation path for this event
|
|
31653
|
+
* @see https://developer.mozilla.org/zh-CN/docs/Web/API/Event/composedPath
|
|
31654
|
+
*
|
|
31655
|
+
* So composedPath()[0] represents the original target.
|
|
31656
|
+
* @see https://polymer-library.polymer-project.org/3.0/docs/devguide/events#retargeting
|
|
31657
|
+
*/
|
|
31658
|
+
function composedPath() {
|
|
31470
31659
|
if (this.manager && (!this.path || this.path[0] !== this.target)) this.path = this.target ? this.manager.propagationPath(this.target) : [];
|
|
31471
31660
|
return this.path;
|
|
31472
31661
|
}
|
|
@@ -31498,7 +31687,12 @@ var FederatedEvent = /*#__PURE__*/ function() {
|
|
|
31498
31687
|
},
|
|
31499
31688
|
{
|
|
31500
31689
|
key: "initEvent",
|
|
31501
|
-
value:
|
|
31690
|
+
value:
|
|
31691
|
+
/**
|
|
31692
|
+
* added for compatibility with DOM Event,
|
|
31693
|
+
* deprecated props and methods
|
|
31694
|
+
*/
|
|
31695
|
+
function initEvent() {}
|
|
31502
31696
|
},
|
|
31503
31697
|
{
|
|
31504
31698
|
key: "initUIEvent",
|
|
@@ -31661,7 +31855,43 @@ var FederatedPointerEvent = /*#__PURE__*/ function(_FederatedMouseEvent) {
|
|
|
31661
31855
|
return _createClass(FederatedPointerEvent, [
|
|
31662
31856
|
{
|
|
31663
31857
|
key: "getCoalescedEvents",
|
|
31664
|
-
value:
|
|
31858
|
+
value:
|
|
31859
|
+
/**
|
|
31860
|
+
* The type of pointer that triggered the event.
|
|
31861
|
+
*
|
|
31862
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/pointerType
|
|
31863
|
+
*/
|
|
31864
|
+
/**
|
|
31865
|
+
* Pressure applied by the pointing device during the event.
|
|
31866
|
+
*s
|
|
31867
|
+
* A Touch's force property will be represented by this value.
|
|
31868
|
+
*
|
|
31869
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/pressure
|
|
31870
|
+
*/
|
|
31871
|
+
/**
|
|
31872
|
+
* Barrel pressure on a stylus pointer.
|
|
31873
|
+
*
|
|
31874
|
+
* @see https://w3c.github.io/pointerevents/#pointerevent-interface
|
|
31875
|
+
*/
|
|
31876
|
+
/**
|
|
31877
|
+
* The angle, in degrees, between the pointer device and the screen.
|
|
31878
|
+
*
|
|
31879
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/tiltX
|
|
31880
|
+
*/
|
|
31881
|
+
/**
|
|
31882
|
+
* The angle, in degrees, between the pointer device and the screen.
|
|
31883
|
+
*
|
|
31884
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/tiltY
|
|
31885
|
+
*/
|
|
31886
|
+
/**
|
|
31887
|
+
* Twist of a stylus pointer.
|
|
31888
|
+
*
|
|
31889
|
+
* @see https://w3c.github.io/pointerevents/#pointerevent-interface
|
|
31890
|
+
*/
|
|
31891
|
+
/**
|
|
31892
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/getCoalescedEvents
|
|
31893
|
+
*/
|
|
31894
|
+
function getCoalescedEvents() {
|
|
31665
31895
|
if (this.type === "pointermove" || this.type === "mousemove" || this.type === "touchmove") return [this];
|
|
31666
31896
|
return [];
|
|
31667
31897
|
}
|
|
@@ -31688,7 +31918,15 @@ var FederatedWheelEvent = /*#__PURE__*/ function(_FederatedMouseEvent) {
|
|
|
31688
31918
|
_inherits(FederatedWheelEvent, _FederatedMouseEvent);
|
|
31689
31919
|
return _createClass(FederatedWheelEvent, [{
|
|
31690
31920
|
key: "clone",
|
|
31691
|
-
value:
|
|
31921
|
+
value:
|
|
31922
|
+
/**
|
|
31923
|
+
* The units of `deltaX`, `deltaY`, and `deltaZ`. This is one of `DOM_DELTA_LINE`,
|
|
31924
|
+
* `DOM_DELTA_PAGE`, `DOM_DELTA_PIXEL`.
|
|
31925
|
+
*/
|
|
31926
|
+
/** Horizontal scroll amount */
|
|
31927
|
+
/** Vertical scroll amount */
|
|
31928
|
+
/** z-axis scroll amount. */
|
|
31929
|
+
function clone() {
|
|
31692
31930
|
return this.manager.cloneWheelEvent(this);
|
|
31693
31931
|
}
|
|
31694
31932
|
}]);
|
|
@@ -31777,7 +32015,11 @@ var Node$1 = /*#__PURE__*/ function(_EventTarget) {
|
|
|
31777
32015
|
return _createClass(Node, [
|
|
31778
32016
|
{
|
|
31779
32017
|
key: "textContent",
|
|
31780
|
-
get:
|
|
32018
|
+
get:
|
|
32019
|
+
/**
|
|
32020
|
+
* @see https://developer.mozilla.org/zh-CN/docs/Web/API/Node/textContent
|
|
32021
|
+
*/
|
|
32022
|
+
function get() {
|
|
31781
32023
|
var out = "";
|
|
31782
32024
|
if (this.nodeName === Shape.TEXT) out += this.style.text;
|
|
31783
32025
|
var _iterator = _createForOfIteratorHelper(this.childNodes), _step;
|
|
@@ -31855,7 +32097,12 @@ var Node$1 = /*#__PURE__*/ function(_EventTarget) {
|
|
|
31855
32097
|
},
|
|
31856
32098
|
{
|
|
31857
32099
|
key: "parent",
|
|
31858
|
-
get:
|
|
32100
|
+
get:
|
|
32101
|
+
/**
|
|
32102
|
+
* @deprecated
|
|
32103
|
+
* @alias parentNode
|
|
32104
|
+
*/
|
|
32105
|
+
function get() {
|
|
31859
32106
|
return this.parentNode;
|
|
31860
32107
|
}
|
|
31861
32108
|
},
|
|
@@ -31925,7 +32172,12 @@ var Node$1 = /*#__PURE__*/ function(_EventTarget) {
|
|
|
31925
32172
|
},
|
|
31926
32173
|
{
|
|
31927
32174
|
key: "contain",
|
|
31928
|
-
value:
|
|
32175
|
+
value:
|
|
32176
|
+
/**
|
|
32177
|
+
* @deprecated
|
|
32178
|
+
* @alias contains
|
|
32179
|
+
*/
|
|
32180
|
+
function contain(other) {
|
|
31929
32181
|
return this.contains(other);
|
|
31930
32182
|
}
|
|
31931
32183
|
},
|
|
@@ -31976,7 +32228,12 @@ var Node$1 = /*#__PURE__*/ function(_EventTarget) {
|
|
|
31976
32228
|
return _createClass(EventTarget, [
|
|
31977
32229
|
{
|
|
31978
32230
|
key: "on",
|
|
31979
|
-
value:
|
|
32231
|
+
value:
|
|
32232
|
+
/**
|
|
32233
|
+
* @deprecated
|
|
32234
|
+
* @alias addEventListener
|
|
32235
|
+
*/
|
|
32236
|
+
function on(type, listener, options) {
|
|
31980
32237
|
this.addEventListener(type, listener, options);
|
|
31981
32238
|
return this;
|
|
31982
32239
|
}
|
|
@@ -32139,7 +32396,11 @@ var OffscreenCanvasCreator = /*#__PURE__*/ function() {
|
|
|
32139
32396
|
}
|
|
32140
32397
|
}], [{
|
|
32141
32398
|
key: "createCanvas",
|
|
32142
|
-
value:
|
|
32399
|
+
value:
|
|
32400
|
+
/**
|
|
32401
|
+
* @returns new canvas instance
|
|
32402
|
+
*/
|
|
32403
|
+
function createCanvas() {
|
|
32143
32404
|
try {
|
|
32144
32405
|
return new window.OffscreenCanvas(0, 0);
|
|
32145
32406
|
} catch (_unused2) {}
|
|
@@ -32762,10 +33023,12 @@ var DefaultSceneGraphService = /*#__PURE__*/ function() {
|
|
|
32762
33023
|
var aabb = this.getTransformedGeometryBounds(element, render, existedAABB);
|
|
32763
33024
|
element.childNodes.forEach(function(child) {
|
|
32764
33025
|
var childBounds = _this.getBounds(child, render);
|
|
32765
|
-
if (childBounds)
|
|
32766
|
-
|
|
32767
|
-
|
|
32768
|
-
|
|
33026
|
+
if (childBounds) {
|
|
33027
|
+
if (!aabb) {
|
|
33028
|
+
aabb = existedAABB || new AABB();
|
|
33029
|
+
aabb.update(childBounds.center, childBounds.halfExtents);
|
|
33030
|
+
} else aabb.add(childBounds);
|
|
33031
|
+
}
|
|
32769
33032
|
});
|
|
32770
33033
|
if (!aabb) aabb = new AABB();
|
|
32771
33034
|
if (render) {
|
|
@@ -32972,12 +33235,14 @@ var DefaultSceneGraphService = /*#__PURE__*/ function() {
|
|
|
32972
33235
|
var mutations = /* @__PURE__ */ new Set();
|
|
32973
33236
|
canvas.getRoot().forEach(function(item) {
|
|
32974
33237
|
(item.mutations || []).forEach(function(mutation) {
|
|
32975
|
-
if (mutation.type === "attributes" && mutation._boundsChangeData)
|
|
32976
|
-
|
|
32977
|
-
|
|
32978
|
-
|
|
32979
|
-
|
|
32980
|
-
|
|
33238
|
+
if (mutation.type === "attributes" && mutation._boundsChangeData) {
|
|
33239
|
+
if (mutation._boundsChangeData.affectChildren) item.forEach(function(node) {
|
|
33240
|
+
var newMutation = _objectSpread2({}, mutation);
|
|
33241
|
+
newMutation.target = node;
|
|
33242
|
+
mutations.add(newMutation);
|
|
33243
|
+
});
|
|
33244
|
+
else mutations.add(mutation);
|
|
33245
|
+
}
|
|
32981
33246
|
});
|
|
32982
33247
|
item.mutations = void 0;
|
|
32983
33248
|
});
|
|
@@ -33152,7 +33417,15 @@ var TextService = /*#__PURE__*/ function() {
|
|
|
33152
33417
|
return _createClass(TextService, [
|
|
33153
33418
|
{
|
|
33154
33419
|
key: "measureFont",
|
|
33155
|
-
value:
|
|
33420
|
+
value:
|
|
33421
|
+
/**
|
|
33422
|
+
* A global cache for character widths, keyed by font string.
|
|
33423
|
+
* e.g. { '16px Arial': { 'a': 8, 'b': 9 } }
|
|
33424
|
+
*/
|
|
33425
|
+
/**
|
|
33426
|
+
* Calculates the ascent, descent and fontSize of a given font-style.
|
|
33427
|
+
*/
|
|
33428
|
+
function measureFont(font, offscreenCanvas) {
|
|
33156
33429
|
if (this.fontMetricsCache[font]) return this.fontMetricsCache[font];
|
|
33157
33430
|
var properties = {
|
|
33158
33431
|
ascent: 0,
|
|
@@ -33650,7 +33923,18 @@ var Element$1 = /*#__PURE__*/ function(_Node) {
|
|
|
33650
33923
|
return _createClass(Element, [
|
|
33651
33924
|
{
|
|
33652
33925
|
key: "dirty",
|
|
33653
|
-
value:
|
|
33926
|
+
value:
|
|
33927
|
+
/**
|
|
33928
|
+
* Marks the element as dirty, indicating it needs re-rendering or relayout.
|
|
33929
|
+
*
|
|
33930
|
+
* @param styleFlag - Whether to update style state (default: true).
|
|
33931
|
+
* When true, sets `renderable.dirty` to true.
|
|
33932
|
+
* @param layoutFlag - Optional. When provided, updates layout-related dirty flags:
|
|
33933
|
+
* - `renderable.boundsDirty`
|
|
33934
|
+
* - `renderable.renderBoundsDirty`
|
|
33935
|
+
* - `geometry.dirty`
|
|
33936
|
+
*/
|
|
33937
|
+
function dirty() {
|
|
33654
33938
|
var styleFlag = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : true;
|
|
33655
33939
|
var layoutFlag = arguments.length > 1 ? arguments[1] : void 0;
|
|
33656
33940
|
this.renderable.dirty = styleFlag;
|
|
@@ -33663,7 +33947,16 @@ var Element$1 = /*#__PURE__*/ function(_Node) {
|
|
|
33663
33947
|
},
|
|
33664
33948
|
{
|
|
33665
33949
|
key: "className",
|
|
33666
|
-
get:
|
|
33950
|
+
get:
|
|
33951
|
+
/**
|
|
33952
|
+
* used with `getElementById()`
|
|
33953
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/Element/id
|
|
33954
|
+
*/
|
|
33955
|
+
/**
|
|
33956
|
+
* used in `getElementsByClassName`
|
|
33957
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/Document/getElementsByClassName
|
|
33958
|
+
*/
|
|
33959
|
+
function get() {
|
|
33667
33960
|
return this.getAttribute("class") || "";
|
|
33668
33961
|
},
|
|
33669
33962
|
set: function set(className) {
|
|
@@ -33672,7 +33965,11 @@ var Element$1 = /*#__PURE__*/ function(_Node) {
|
|
|
33672
33965
|
},
|
|
33673
33966
|
{
|
|
33674
33967
|
key: "classList",
|
|
33675
|
-
get:
|
|
33968
|
+
get:
|
|
33969
|
+
/**
|
|
33970
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/Element/classList
|
|
33971
|
+
*/
|
|
33972
|
+
function get() {
|
|
33676
33973
|
return this.className.split(" ").filter(function(c) {
|
|
33677
33974
|
return c !== "";
|
|
33678
33975
|
});
|
|
@@ -33746,8 +34043,10 @@ var Element$1 = /*#__PURE__*/ function(_Node) {
|
|
|
33746
34043
|
var _this$ownerDocument;
|
|
33747
34044
|
if (child.destroyed) throw new Error(ERROR_MSG_APPEND_DESTROYED_ELEMENT);
|
|
33748
34045
|
runtime.sceneGraphService.attach(child, this, index);
|
|
33749
|
-
if ((_this$ownerDocument = this.ownerDocument) !== null && _this$ownerDocument !== void 0 && _this$ownerDocument.defaultView)
|
|
33750
|
-
|
|
34046
|
+
if ((_this$ownerDocument = this.ownerDocument) !== null && _this$ownerDocument !== void 0 && _this$ownerDocument.defaultView) {
|
|
34047
|
+
if (!isInFragment(this) && child.nodeName === Shape.FRAGMENT) this.ownerDocument.defaultView.mountFragment(child);
|
|
34048
|
+
else this.ownerDocument.defaultView.mountChildren(child);
|
|
34049
|
+
}
|
|
33751
34050
|
if (this.isMutationObserved) {
|
|
33752
34051
|
insertedEvent.relatedNode = this;
|
|
33753
34052
|
child.dispatchEvent(insertedEvent);
|
|
@@ -34013,13 +34312,22 @@ var Element$1 = /*#__PURE__*/ function(_Node) {
|
|
|
34013
34312
|
},
|
|
34014
34313
|
{
|
|
34015
34314
|
key: "computedStyleMap",
|
|
34016
|
-
value:
|
|
34315
|
+
value:
|
|
34316
|
+
/**
|
|
34317
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/Element/computedStyleMap
|
|
34318
|
+
* eg. circle.computedStyleMap().get('fill');
|
|
34319
|
+
*/
|
|
34320
|
+
function computedStyleMap() {
|
|
34017
34321
|
return new Map(Object.entries(this.computedStyle));
|
|
34018
34322
|
}
|
|
34019
34323
|
},
|
|
34020
34324
|
{
|
|
34021
34325
|
key: "getAttributeNames",
|
|
34022
|
-
value:
|
|
34326
|
+
value:
|
|
34327
|
+
/**
|
|
34328
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/Element/getAttributeNames
|
|
34329
|
+
*/
|
|
34330
|
+
function getAttributeNames() {
|
|
34023
34331
|
return Object.keys(this.attributes);
|
|
34024
34332
|
}
|
|
34025
34333
|
},
|
|
@@ -36663,7 +36971,11 @@ var HTMLRenderingPlugin = /*#__PURE__*/ function() {
|
|
|
36663
36971
|
return _createClass(HTMLRenderingPlugin, [
|
|
36664
36972
|
{
|
|
36665
36973
|
key: "joinTransformMatrix",
|
|
36666
|
-
value:
|
|
36974
|
+
value:
|
|
36975
|
+
/**
|
|
36976
|
+
* ! The reason for adding `offset` is that the `transform-origin` coordinate system of DOM is the local coordinate system of the element, while the `transform-origin` coordinate system of canvas drawing is the local coordinate system of the element's parent element. At the same time, the `transform` attribute value of the DOM element does not include `transform-origin`.
|
|
36977
|
+
*/
|
|
36978
|
+
function joinTransformMatrix(matrix) {
|
|
36667
36979
|
var offset = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [
|
|
36668
36980
|
0,
|
|
36669
36981
|
0,
|
|
@@ -36862,18 +37174,20 @@ var HTMLRenderingPlugin = /*#__PURE__*/ function() {
|
|
|
36862
37174
|
case "fill":
|
|
36863
37175
|
var fill = object.parsedStyle.fill;
|
|
36864
37176
|
var color = "";
|
|
36865
|
-
if (isCSSRGB(fill))
|
|
36866
|
-
|
|
36867
|
-
|
|
37177
|
+
if (isCSSRGB(fill)) {
|
|
37178
|
+
if (fill.isNone) color = "transparent";
|
|
37179
|
+
else color = object.getAttribute("fill");
|
|
37180
|
+
} else if (Array.isArray(fill)) color = object.getAttribute("fill");
|
|
36868
37181
|
else if (isPattern(fill));
|
|
36869
37182
|
$el.style.background = color;
|
|
36870
37183
|
break;
|
|
36871
37184
|
case "stroke":
|
|
36872
37185
|
var stroke = object.parsedStyle.stroke;
|
|
36873
37186
|
var borderColor = "";
|
|
36874
|
-
if (isCSSRGB(stroke))
|
|
36875
|
-
|
|
36876
|
-
|
|
37187
|
+
if (isCSSRGB(stroke)) {
|
|
37188
|
+
if (stroke.isNone) borderColor = "transparent";
|
|
37189
|
+
else borderColor = object.getAttribute("stroke");
|
|
37190
|
+
} else if (Array.isArray(stroke)) borderColor = object.getAttribute("stroke");
|
|
36877
37191
|
else if (isPattern(stroke));
|
|
36878
37192
|
$el.style["border-color"] = borderColor;
|
|
36879
37193
|
$el.style["border-style"] = "solid";
|
|
@@ -37565,8 +37879,10 @@ PERFORMANCE OF THIS SOFTWARE.
|
|
|
37565
37879
|
if (classType === CJ) return types.push(lineBreak === "strict" ? NS : ID);
|
|
37566
37880
|
if (classType === SA) return types.push(AL);
|
|
37567
37881
|
if (classType === AI) return types.push(AL);
|
|
37568
|
-
if (classType === XX)
|
|
37569
|
-
|
|
37882
|
+
if (classType === XX) {
|
|
37883
|
+
if (codePoint >= 131072 && codePoint <= 196605 || codePoint >= 196608 && codePoint <= 262141) return types.push(ID);
|
|
37884
|
+
else return types.push(AL);
|
|
37885
|
+
}
|
|
37570
37886
|
types.push(classType);
|
|
37571
37887
|
});
|
|
37572
37888
|
return [
|
|
@@ -38228,12 +38544,13 @@ PERFORMANCE OF THIS SOFTWARE.
|
|
|
38228
38544
|
} else if (codePoint === QUOTATION_MARK || codePoint === APOSTROPHE || codePoint === LEFT_PARENTHESIS || isNonPrintableCodePoint(codePoint)) {
|
|
38229
38545
|
this.consumeBadUrlRemnants();
|
|
38230
38546
|
return BAD_URL_TOKEN;
|
|
38231
|
-
} else if (codePoint === REVERSE_SOLIDUS)
|
|
38232
|
-
|
|
38233
|
-
|
|
38234
|
-
|
|
38235
|
-
|
|
38236
|
-
|
|
38547
|
+
} else if (codePoint === REVERSE_SOLIDUS) {
|
|
38548
|
+
if (isValidEscape(codePoint, this.peekCodePoint(0))) value.push(this.consumeEscapedCodePoint());
|
|
38549
|
+
else {
|
|
38550
|
+
this.consumeBadUrlRemnants();
|
|
38551
|
+
return BAD_URL_TOKEN;
|
|
38552
|
+
}
|
|
38553
|
+
} else value.push(codePoint);
|
|
38237
38554
|
}
|
|
38238
38555
|
};
|
|
38239
38556
|
Tokenizer.prototype.consumeWhiteSpace = function() {
|
|
@@ -38977,15 +39294,13 @@ PERFORMANCE OF THIS SOFTWARE.
|
|
|
38977
39294
|
ry = Math.max(Math.abs(y), Math.abs(y - height));
|
|
38978
39295
|
}
|
|
38979
39296
|
break;
|
|
38980
|
-
case 3:
|
|
38981
|
-
|
|
38982
|
-
|
|
38983
|
-
|
|
38984
|
-
|
|
38985
|
-
|
|
38986
|
-
|
|
38987
|
-
}
|
|
38988
|
-
break;
|
|
39297
|
+
case 3: if (gradient.shape === 0) rx = ry = Math.max(distance(x, y), distance(x, y - height), distance(x - width, y), distance(x - width, y - height));
|
|
39298
|
+
else if (gradient.shape === 1) {
|
|
39299
|
+
var c = Math.max(Math.abs(y), Math.abs(y - height)) / Math.max(Math.abs(x), Math.abs(x - width));
|
|
39300
|
+
var _b = findCorner(width, height, x, y, false), cx = _b[0], cy = _b[1];
|
|
39301
|
+
rx = distance(cx - x, (cy - y) / c);
|
|
39302
|
+
ry = c * rx;
|
|
39303
|
+
}
|
|
38989
39304
|
}
|
|
38990
39305
|
if (Array.isArray(gradient.size)) {
|
|
38991
39306
|
rx = getAbsoluteValue(gradient.size[0], width);
|
|
@@ -39965,7 +40280,6 @@ PERFORMANCE OF THIS SOFTWARE.
|
|
|
39965
40280
|
case 4:
|
|
39966
40281
|
results.push(accumulator.join(" "));
|
|
39967
40282
|
accumulator.length = 0;
|
|
39968
|
-
break;
|
|
39969
40283
|
}
|
|
39970
40284
|
});
|
|
39971
40285
|
if (accumulator.length) results.push(accumulator.join(" "));
|
|
@@ -40174,9 +40488,7 @@ PERFORMANCE OF THIS SOFTWARE.
|
|
|
40174
40488
|
case "fill":
|
|
40175
40489
|
layers.push(0);
|
|
40176
40490
|
break;
|
|
40177
|
-
case "markers":
|
|
40178
|
-
layers.push(2);
|
|
40179
|
-
break;
|
|
40491
|
+
case "markers": layers.push(2);
|
|
40180
40492
|
}
|
|
40181
40493
|
});
|
|
40182
40494
|
DEFAULT_VALUE.forEach(function(value) {
|
|
@@ -40322,20 +40634,18 @@ PERFORMANCE OF THIS SOFTWARE.
|
|
|
40322
40634
|
case 0: return descriptor.parse(context, parser.parseComponentValue());
|
|
40323
40635
|
case 1: return descriptor.parse(context, parser.parseComponentValues());
|
|
40324
40636
|
case 4: return parser.parseComponentValue();
|
|
40325
|
-
case 3:
|
|
40326
|
-
|
|
40327
|
-
|
|
40328
|
-
|
|
40329
|
-
|
|
40330
|
-
|
|
40331
|
-
|
|
40332
|
-
|
|
40333
|
-
|
|
40334
|
-
|
|
40335
|
-
|
|
40336
|
-
|
|
40337
|
-
}
|
|
40338
|
-
break;
|
|
40637
|
+
case 3: switch (descriptor.format) {
|
|
40638
|
+
case "angle": return angle.parse(context, parser.parseComponentValue());
|
|
40639
|
+
case "color": return color$1.parse(context, parser.parseComponentValue());
|
|
40640
|
+
case "image": return image.parse(context, parser.parseComponentValue());
|
|
40641
|
+
case "length":
|
|
40642
|
+
var length_1 = parser.parseComponentValue();
|
|
40643
|
+
return isLength(length_1) ? length_1 : ZERO_LENGTH;
|
|
40644
|
+
case "length-percentage":
|
|
40645
|
+
var value_1 = parser.parseComponentValue();
|
|
40646
|
+
return isLengthPercentage(value_1) ? value_1 : ZERO_LENGTH;
|
|
40647
|
+
case "time": return time.parse(context, parser.parseComponentValue());
|
|
40648
|
+
}
|
|
40339
40649
|
}
|
|
40340
40650
|
};
|
|
40341
40651
|
var elementDebuggerAttribute = "data-html2canvas-debug";
|
|
@@ -40820,22 +41130,23 @@ PERFORMANCE OF THIS SOFTWARE.
|
|
|
40820
41130
|
var textBounds = [];
|
|
40821
41131
|
var offset = 0;
|
|
40822
41132
|
textList.forEach(function(text) {
|
|
40823
|
-
if (styles.textDecorationLine.length || text.trim().length > 0)
|
|
40824
|
-
|
|
40825
|
-
|
|
40826
|
-
|
|
40827
|
-
|
|
40828
|
-
|
|
40829
|
-
|
|
40830
|
-
|
|
40831
|
-
|
|
40832
|
-
|
|
40833
|
-
|
|
40834
|
-
|
|
40835
|
-
|
|
40836
|
-
|
|
40837
|
-
|
|
40838
|
-
|
|
41133
|
+
if (styles.textDecorationLine.length || text.trim().length > 0) {
|
|
41134
|
+
if (FEATURES.SUPPORT_RANGE_BOUNDS) {
|
|
41135
|
+
var clientRects = createRange(node, offset, text.length).getClientRects();
|
|
41136
|
+
if (clientRects.length > 1) {
|
|
41137
|
+
var subSegments = segmentGraphemes(text);
|
|
41138
|
+
var subOffset_1 = 0;
|
|
41139
|
+
subSegments.forEach(function(subSegment) {
|
|
41140
|
+
textBounds.push(new TextBounds(subSegment, Bounds.fromDOMRectList(context, createRange(node, subOffset_1 + offset, subSegment.length).getClientRects())));
|
|
41141
|
+
subOffset_1 += subSegment.length;
|
|
41142
|
+
});
|
|
41143
|
+
} else textBounds.push(new TextBounds(text, Bounds.fromDOMRectList(context, clientRects)));
|
|
41144
|
+
} else {
|
|
41145
|
+
var replacementNode = node.splitText(text.length);
|
|
41146
|
+
textBounds.push(new TextBounds(text, getWrapperBounds(context, node)));
|
|
41147
|
+
node = replacementNode;
|
|
41148
|
+
}
|
|
41149
|
+
} else if (!FEATURES.SUPPORT_RANGE_BOUNDS) node = node.splitText(text.length);
|
|
40839
41150
|
offset += text.length;
|
|
40840
41151
|
});
|
|
40841
41152
|
return textBounds;
|
|
@@ -41040,9 +41351,7 @@ PERFORMANCE OF THIS SOFTWARE.
|
|
|
41040
41351
|
case CHECKBOX:
|
|
41041
41352
|
_this.styles.borderTopRightRadius = _this.styles.borderTopLeftRadius = _this.styles.borderBottomRightRadius = _this.styles.borderBottomLeftRadius = CHECKBOX_BORDER_RADIUS;
|
|
41042
41353
|
break;
|
|
41043
|
-
case RADIO:
|
|
41044
|
-
_this.styles.borderTopRightRadius = _this.styles.borderTopLeftRadius = _this.styles.borderBottomRightRadius = _this.styles.borderBottomLeftRadius = RADIO_BORDER_RADIUS;
|
|
41045
|
-
break;
|
|
41354
|
+
case RADIO: _this.styles.borderTopRightRadius = _this.styles.borderTopLeftRadius = _this.styles.borderBottomRightRadius = _this.styles.borderBottomLeftRadius = RADIO_BORDER_RADIUS;
|
|
41046
41355
|
}
|
|
41047
41356
|
return _this;
|
|
41048
41357
|
}
|
|
@@ -41096,19 +41405,21 @@ PERFORMANCE OF THIS SOFTWARE.
|
|
|
41096
41405
|
for (var childNode = node.firstChild, nextNode = void 0; childNode; childNode = nextNode) {
|
|
41097
41406
|
nextNode = childNode.nextSibling;
|
|
41098
41407
|
if (isTextNode(childNode) && childNode.data.trim().length > 0) parent.textNodes.push(new TextContainer(context, childNode, parent.styles));
|
|
41099
|
-
else if (isElementNode(childNode))
|
|
41100
|
-
|
|
41101
|
-
|
|
41102
|
-
|
|
41103
|
-
|
|
41104
|
-
|
|
41105
|
-
if (
|
|
41106
|
-
|
|
41107
|
-
|
|
41108
|
-
|
|
41109
|
-
|
|
41110
|
-
|
|
41111
|
-
|
|
41408
|
+
else if (isElementNode(childNode)) {
|
|
41409
|
+
if (isSlotElement(childNode) && childNode.assignedNodes) childNode.assignedNodes().forEach(function(childNode) {
|
|
41410
|
+
return parseNodeTree(context, childNode, parent, root);
|
|
41411
|
+
});
|
|
41412
|
+
else {
|
|
41413
|
+
var container = createContainer(context, childNode);
|
|
41414
|
+
if (container.styles.isVisible()) {
|
|
41415
|
+
if (createsRealStackingContext(childNode, container, root)) container.flags |= 4;
|
|
41416
|
+
else if (createsStackingContext(container.styles)) container.flags |= 2;
|
|
41417
|
+
if (LIST_OWNERS.indexOf(childNode.tagName) !== -1) container.flags |= 8;
|
|
41418
|
+
parent.elements.push(container);
|
|
41419
|
+
childNode.slot;
|
|
41420
|
+
if (childNode.shadowRoot) parseNodeTree(context, childNode.shadowRoot, container, root);
|
|
41421
|
+
else if (!isTextareaElement(childNode) && !isSVGElement(childNode) && !isSelectElement(childNode)) parseNodeTree(context, childNode, container, root);
|
|
41422
|
+
}
|
|
41112
41423
|
}
|
|
41113
41424
|
}
|
|
41114
41425
|
}
|
|
@@ -41745,14 +42056,16 @@ PERFORMANCE OF THIS SOFTWARE.
|
|
|
41745
42056
|
clonedCanvas.height = canvas.height;
|
|
41746
42057
|
var ctx = canvas.getContext("2d");
|
|
41747
42058
|
var clonedCtx = clonedCanvas.getContext("2d");
|
|
41748
|
-
if (clonedCtx)
|
|
41749
|
-
|
|
41750
|
-
|
|
41751
|
-
|
|
41752
|
-
|
|
41753
|
-
|
|
42059
|
+
if (clonedCtx) {
|
|
42060
|
+
if (!this.options.allowTaint && ctx) clonedCtx.putImageData(ctx.getImageData(0, 0, canvas.width, canvas.height), 0, 0);
|
|
42061
|
+
else {
|
|
42062
|
+
var gl = (_a = canvas.getContext("webgl2")) !== null && _a !== void 0 ? _a : canvas.getContext("webgl");
|
|
42063
|
+
if (gl) {
|
|
42064
|
+
var attribs = gl.getContextAttributes();
|
|
42065
|
+
if ((attribs === null || attribs === void 0 ? void 0 : attribs.preserveDrawingBuffer) === false) this.context.logger.warn("Unable to clone WebGL context as it has preserveDrawingBuffer=false", canvas);
|
|
42066
|
+
}
|
|
42067
|
+
clonedCtx.drawImage(canvas, 0, 0);
|
|
41754
42068
|
}
|
|
41755
|
-
clonedCtx.drawImage(canvas, 0, 0);
|
|
41756
42069
|
}
|
|
41757
42070
|
return clonedCanvas;
|
|
41758
42071
|
} catch (e) {
|
|
@@ -42081,18 +42394,19 @@ PERFORMANCE OF THIS SOFTWARE.
|
|
|
42081
42394
|
var responseType = FEATURES.SUPPORT_RESPONSE_TYPE ? "blob" : "text";
|
|
42082
42395
|
var xhr = new XMLHttpRequest();
|
|
42083
42396
|
xhr.onload = function() {
|
|
42084
|
-
if (xhr.status === 200)
|
|
42085
|
-
|
|
42086
|
-
|
|
42087
|
-
|
|
42088
|
-
|
|
42089
|
-
|
|
42090
|
-
|
|
42091
|
-
|
|
42092
|
-
|
|
42093
|
-
|
|
42094
|
-
|
|
42095
|
-
|
|
42397
|
+
if (xhr.status === 200) {
|
|
42398
|
+
if (responseType === "text") resolve(xhr.response);
|
|
42399
|
+
else {
|
|
42400
|
+
var reader_1 = new FileReader();
|
|
42401
|
+
reader_1.addEventListener("load", function() {
|
|
42402
|
+
return resolve(reader_1.result);
|
|
42403
|
+
}, false);
|
|
42404
|
+
reader_1.addEventListener("error", function(e) {
|
|
42405
|
+
return reject(e);
|
|
42406
|
+
}, false);
|
|
42407
|
+
reader_1.readAsDataURL(xhr.response);
|
|
42408
|
+
}
|
|
42409
|
+
} else reject("Failed to proxy resource " + key + " with status code " + xhr.status);
|
|
42096
42410
|
};
|
|
42097
42411
|
xhr.onerror = reject;
|
|
42098
42412
|
var queryString = proxy.indexOf("?") > -1 ? "&" : "?";
|
|
@@ -42830,9 +43144,7 @@ PERFORMANCE OF THIS SOFTWARE.
|
|
|
42830
43144
|
case 2:
|
|
42831
43145
|
_this.ctx.fillRect(text.bounds.left, Math.round(text.bounds.top), text.bounds.width, 1);
|
|
42832
43146
|
break;
|
|
42833
|
-
case 3:
|
|
42834
|
-
_this.ctx.fillRect(text.bounds.left, Math.ceil(text.bounds.top + middle), text.bounds.width, 1);
|
|
42835
|
-
break;
|
|
43147
|
+
case 3: _this.ctx.fillRect(text.bounds.left, Math.ceil(text.bounds.top + middle), text.bounds.width, 1);
|
|
42836
43148
|
}
|
|
42837
43149
|
});
|
|
42838
43150
|
}
|
|
@@ -42847,7 +43159,6 @@ PERFORMANCE OF THIS SOFTWARE.
|
|
|
42847
43159
|
_this.ctx.strokeStyle = "";
|
|
42848
43160
|
_this.ctx.lineWidth = 0;
|
|
42849
43161
|
_this.ctx.lineJoin = "miter";
|
|
42850
|
-
break;
|
|
42851
43162
|
}
|
|
42852
43163
|
});
|
|
42853
43164
|
});
|
|
@@ -42985,9 +43296,7 @@ PERFORMANCE OF THIS SOFTWARE.
|
|
|
42985
43296
|
case 1:
|
|
42986
43297
|
x += bounds.width / 2;
|
|
42987
43298
|
break;
|
|
42988
|
-
case 2:
|
|
42989
|
-
x += bounds.width;
|
|
42990
|
-
break;
|
|
43299
|
+
case 2: x += bounds.width;
|
|
42991
43300
|
}
|
|
42992
43301
|
textBounds = bounds.add(x, 0, 0, -bounds.height / 2 + 1);
|
|
42993
43302
|
this.ctx.save();
|
|
@@ -43502,8 +43811,10 @@ PERFORMANCE OF THIS SOFTWARE.
|
|
|
43502
43811
|
maxSpace = (length - (numberOfDashes + 1) * dashLength) / numberOfDashes;
|
|
43503
43812
|
spaceLength = maxSpace <= 0 || Math.abs(spaceLength - minSpace) < Math.abs(spaceLength - maxSpace) ? minSpace : maxSpace;
|
|
43504
43813
|
}
|
|
43505
|
-
if (useLineDash)
|
|
43506
|
-
|
|
43814
|
+
if (useLineDash) {
|
|
43815
|
+
if (style === 3) this.ctx.setLineDash([0, dashLength + spaceLength]);
|
|
43816
|
+
else this.ctx.setLineDash([dashLength, spaceLength]);
|
|
43817
|
+
}
|
|
43507
43818
|
if (style === 3) {
|
|
43508
43819
|
this.ctx.lineCap = "round";
|
|
43509
43820
|
this.ctx.lineWidth = width;
|
|
@@ -43638,8 +43949,10 @@ PERFORMANCE OF THIS SOFTWARE.
|
|
|
43638
43949
|
Logger.prototype.debug = function() {
|
|
43639
43950
|
var args = [];
|
|
43640
43951
|
for (var _i = 0; _i < arguments.length; _i++) args[_i] = arguments[_i];
|
|
43641
|
-
if (this.enabled)
|
|
43642
|
-
|
|
43952
|
+
if (this.enabled) {
|
|
43953
|
+
if (typeof window !== "undefined" && window.console && typeof console.debug === "function") console.debug.apply(console, __spreadArray([this.id, this.getTime() + "ms"], args));
|
|
43954
|
+
else this.info.apply(this, args);
|
|
43955
|
+
}
|
|
43643
43956
|
};
|
|
43644
43957
|
Logger.prototype.getTime = function() {
|
|
43645
43958
|
return Date.now() - this.start;
|
|
@@ -43654,14 +43967,18 @@ PERFORMANCE OF THIS SOFTWARE.
|
|
|
43654
43967
|
Logger.prototype.warn = function() {
|
|
43655
43968
|
var args = [];
|
|
43656
43969
|
for (var _i = 0; _i < arguments.length; _i++) args[_i] = arguments[_i];
|
|
43657
|
-
if (this.enabled)
|
|
43658
|
-
|
|
43970
|
+
if (this.enabled) {
|
|
43971
|
+
if (typeof window !== "undefined" && window.console && typeof console.warn === "function") console.warn.apply(console, __spreadArray([this.id, this.getTime() + "ms"], args));
|
|
43972
|
+
else this.info.apply(this, args);
|
|
43973
|
+
}
|
|
43659
43974
|
};
|
|
43660
43975
|
Logger.prototype.error = function() {
|
|
43661
43976
|
var args = [];
|
|
43662
43977
|
for (var _i = 0; _i < arguments.length; _i++) args[_i] = arguments[_i];
|
|
43663
|
-
if (this.enabled)
|
|
43664
|
-
|
|
43978
|
+
if (this.enabled) {
|
|
43979
|
+
if (typeof window !== "undefined" && window.console && typeof console.error === "function") console.error.apply(console, __spreadArray([this.id, this.getTime() + "ms"], args));
|
|
43980
|
+
else this.info.apply(this, args);
|
|
43981
|
+
}
|
|
43665
43982
|
};
|
|
43666
43983
|
Logger.instances = {};
|
|
43667
43984
|
return Logger;
|
|
@@ -43842,7 +44159,20 @@ var Animation = /*#__PURE__*/ function() {
|
|
|
43842
44159
|
return _createClass(Animation, [
|
|
43843
44160
|
{
|
|
43844
44161
|
key: "pending",
|
|
43845
|
-
get:
|
|
44162
|
+
get:
|
|
44163
|
+
/**
|
|
44164
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/Animation/effect
|
|
44165
|
+
*/
|
|
44166
|
+
/**
|
|
44167
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/Animation/timeline
|
|
44168
|
+
*/
|
|
44169
|
+
/**
|
|
44170
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/Animation/id
|
|
44171
|
+
*/
|
|
44172
|
+
/**
|
|
44173
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/Animation/pending
|
|
44174
|
+
*/
|
|
44175
|
+
function get() {
|
|
43846
44176
|
return this._startTime === null && !this._paused && this.playbackRate !== 0 || this.currentTimePending;
|
|
43847
44177
|
}
|
|
43848
44178
|
},
|
|
@@ -43857,7 +44187,18 @@ var Animation = /*#__PURE__*/ function() {
|
|
|
43857
44187
|
},
|
|
43858
44188
|
{
|
|
43859
44189
|
key: "ready",
|
|
43860
|
-
get:
|
|
44190
|
+
get:
|
|
44191
|
+
/**
|
|
44192
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/Animation/ready
|
|
44193
|
+
* @example
|
|
44194
|
+
animation.pause();
|
|
44195
|
+
animation.ready.then(function() {
|
|
44196
|
+
// Displays 'running'
|
|
44197
|
+
alert(animation.playState);
|
|
44198
|
+
});
|
|
44199
|
+
animation.play();
|
|
44200
|
+
*/
|
|
44201
|
+
function get() {
|
|
43861
44202
|
var _this = this;
|
|
43862
44203
|
if (!this.readyPromise) {
|
|
43863
44204
|
if (this.timeline.animationsWithPromises.indexOf(this) === -1) this.timeline.animationsWithPromises.push(this);
|
|
@@ -44891,8 +45232,10 @@ function normalizeTimingInput(timingInput, forGroup) {
|
|
|
44891
45232
|
return makeTiming(timingInput, forGroup);
|
|
44892
45233
|
}
|
|
44893
45234
|
function numericTimingToObject(timingInput) {
|
|
44894
|
-
if (typeof timingInput === "number")
|
|
44895
|
-
|
|
45235
|
+
if (typeof timingInput === "number") {
|
|
45236
|
+
if (isNaN(timingInput)) timingInput = { duration: "auto" };
|
|
45237
|
+
else timingInput = { duration: timingInput };
|
|
45238
|
+
}
|
|
44896
45239
|
return timingInput;
|
|
44897
45240
|
}
|
|
44898
45241
|
/**
|
|
@@ -45201,7 +45544,14 @@ runtime.CameraContribution = /* @__PURE__ */ function(_Camera) {
|
|
|
45201
45544
|
return _createClass(AdvancedCamera, [
|
|
45202
45545
|
{
|
|
45203
45546
|
key: "rotate",
|
|
45204
|
-
value:
|
|
45547
|
+
value:
|
|
45548
|
+
/**
|
|
45549
|
+
* Changes the azimuth and elevation with respect to the current camera axes
|
|
45550
|
+
* @param {Number} azimuth the relative azimuth
|
|
45551
|
+
* @param {Number} elevation the relative elevation
|
|
45552
|
+
* @param {Number} roll the relative roll
|
|
45553
|
+
*/
|
|
45554
|
+
function rotate(azimuth, elevation, roll) {
|
|
45205
45555
|
this.relElevation = getAngle(elevation);
|
|
45206
45556
|
this.relAzimuth = getAngle(azimuth);
|
|
45207
45557
|
this.relRoll = getAngle(roll);
|
|
@@ -46680,18 +47030,20 @@ function configure_toolbar(gobj) {
|
|
|
46680
47030
|
title: t("reset zoom")
|
|
46681
47031
|
}
|
|
46682
47032
|
];
|
|
46683
|
-
if (gobj_read_bool_attr(gobj, "with_fullscreen"))
|
|
46684
|
-
|
|
46685
|
-
|
|
46686
|
-
|
|
46687
|
-
|
|
46688
|
-
|
|
46689
|
-
|
|
46690
|
-
|
|
46691
|
-
|
|
46692
|
-
|
|
46693
|
-
|
|
46694
|
-
|
|
47033
|
+
if (gobj_read_bool_attr(gobj, "with_fullscreen")) {
|
|
47034
|
+
if (priv.is_fullscreen) items.push({
|
|
47035
|
+
id: "g6-icon-fullscreen-exit",
|
|
47036
|
+
value: "exit-fullscreen",
|
|
47037
|
+
className: "EV_EXIT_FULLSCREEN",
|
|
47038
|
+
title: t("exit full screen")
|
|
47039
|
+
});
|
|
47040
|
+
else items.push({
|
|
47041
|
+
id: "g6-icon-fullscreen",
|
|
47042
|
+
value: "request-fullscreen",
|
|
47043
|
+
className: "EV_REQUEST_FULLSCREEN",
|
|
47044
|
+
title: t("enter full screen")
|
|
47045
|
+
});
|
|
47046
|
+
}
|
|
46695
47047
|
return items;
|
|
46696
47048
|
},
|
|
46697
47049
|
onClick: (value) => {
|
|
@@ -46714,9 +47066,7 @@ function configure_toolbar(gobj) {
|
|
|
46714
47066
|
case "request-fullscreen":
|
|
46715
47067
|
gobj_send_event(gobj, "EV_REQUEST_FULLSCREEN", {}, gobj);
|
|
46716
47068
|
break;
|
|
46717
|
-
case "exit-fullscreen":
|
|
46718
|
-
gobj_send_event(gobj, "EV_EXIT_FULLSCREEN", {}, gobj);
|
|
46719
|
-
break;
|
|
47069
|
+
case "exit-fullscreen": gobj_send_event(gobj, "EV_EXIT_FULLSCREEN", {}, gobj);
|
|
46720
47070
|
}
|
|
46721
47071
|
}
|
|
46722
47072
|
});
|
|
@@ -46787,9 +47137,7 @@ function configure_toolbar_edit(gobj) {
|
|
|
46787
47137
|
case "redo":
|
|
46788
47138
|
gobj_send_event(gobj, "EV_HISTORY_REDO", {}, gobj);
|
|
46789
47139
|
break;
|
|
46790
|
-
case "save":
|
|
46791
|
-
gobj_send_event(gobj, "EV_SAVE_GRAPH", {}, gobj);
|
|
46792
|
-
break;
|
|
47140
|
+
case "save": gobj_send_event(gobj, "EV_SAVE_GRAPH", {}, gobj);
|
|
46793
47141
|
}
|
|
46794
47142
|
}
|
|
46795
47143
|
});
|
|
@@ -46830,9 +47178,7 @@ function configure_behaviour(gobj) {
|
|
|
46830
47178
|
case "operation":
|
|
46831
47179
|
priv.edit_mode = false;
|
|
46832
47180
|
break;
|
|
46833
|
-
default:
|
|
46834
|
-
log_error(`operation mode unknown: ${operation_mode}`);
|
|
46835
|
-
break;
|
|
47181
|
+
default: log_error(`operation mode unknown: ${operation_mode}`);
|
|
46836
47182
|
}
|
|
46837
47183
|
if (!priv.edit_mode) deselect_node(gobj);
|
|
46838
47184
|
graph_write_behaviors(gobj, behaviors);
|
|
@@ -46867,9 +47213,7 @@ function calculate_hooks_fkeys_counter(desc) {
|
|
|
46867
47213
|
case "hook":
|
|
46868
47214
|
desc.hooks_counter++;
|
|
46869
47215
|
break;
|
|
46870
|
-
case "fkey":
|
|
46871
|
-
desc.fkeys_counter++;
|
|
46872
|
-
break;
|
|
47216
|
+
case "fkey": desc.fkeys_counter++;
|
|
46873
47217
|
}
|
|
46874
47218
|
}
|
|
46875
47219
|
if (desc.hooks_counter === 0) desc.node_treedb_type = "child";
|
|
@@ -46909,7 +47253,6 @@ function build_ports(gobj, desc) {
|
|
|
46909
47253
|
stroke: getStrokeColor(desc.color)
|
|
46910
47254
|
};
|
|
46911
47255
|
top_ports.push(port);
|
|
46912
|
-
break;
|
|
46913
47256
|
}
|
|
46914
47257
|
}
|
|
46915
47258
|
for (let i = 0; i < top_ports.length; i++) top_ports[i].placement = [.5, 0];
|
|
@@ -47104,13 +47447,15 @@ function collect_fkey_refs(desc, record) {
|
|
|
47104
47447
|
let col = cols[i];
|
|
47105
47448
|
if (!col.fkey) continue;
|
|
47106
47449
|
let fkeys = record[col.id];
|
|
47107
|
-
if (fkeys)
|
|
47108
|
-
let
|
|
47109
|
-
|
|
47110
|
-
|
|
47111
|
-
|
|
47112
|
-
|
|
47113
|
-
|
|
47450
|
+
if (fkeys) {
|
|
47451
|
+
if (is_array(fkeys)) for (let j = 0; j < fkeys.length; j++) {
|
|
47452
|
+
let key = treedb_encoder_fkey(col, fkeys[j]);
|
|
47453
|
+
if (key) refs.add(i + " " + key);
|
|
47454
|
+
}
|
|
47455
|
+
else {
|
|
47456
|
+
let key = treedb_encoder_fkey(col, fkeys);
|
|
47457
|
+
if (key) refs.add(i + " " + key);
|
|
47458
|
+
}
|
|
47114
47459
|
}
|
|
47115
47460
|
}
|
|
47116
47461
|
return refs;
|
|
@@ -47126,8 +47471,10 @@ function draw_links(gobj, desc, record, initial_load) {
|
|
|
47126
47471
|
let col = cols[i];
|
|
47127
47472
|
if (!col.fkey) continue;
|
|
47128
47473
|
let fkeys = record[col.id];
|
|
47129
|
-
if (fkeys)
|
|
47130
|
-
|
|
47474
|
+
if (fkeys) {
|
|
47475
|
+
if (is_array(fkeys)) for (let j = 0; j < fkeys.length; j++) draw_link(gobj, topic_name, record_id, col, fkeys[j], initial_load);
|
|
47476
|
+
else draw_link(gobj, topic_name, record_id, col, fkeys, initial_load);
|
|
47477
|
+
}
|
|
47131
47478
|
}
|
|
47132
47479
|
}
|
|
47133
47480
|
/************************************************************
|
|
@@ -47237,8 +47584,10 @@ function clear_links(gobj, desc, record, verbose) {
|
|
|
47237
47584
|
let col = cols[i];
|
|
47238
47585
|
if (!col.fkey) continue;
|
|
47239
47586
|
let fkeys = record[col.id];
|
|
47240
|
-
if (fkeys)
|
|
47241
|
-
|
|
47587
|
+
if (fkeys) {
|
|
47588
|
+
if (is_array(fkeys)) for (let j = 0; j < fkeys.length; j++) clear_link(gobj, topic_name, record_id, col, fkeys[j], verbose);
|
|
47589
|
+
else clear_link(gobj, topic_name, record_id, col, fkeys, verbose);
|
|
47590
|
+
}
|
|
47242
47591
|
}
|
|
47243
47592
|
}
|
|
47244
47593
|
/************************************************************
|
|
@@ -47335,7 +47684,7 @@ function save_geometry(gobj) {
|
|
|
47335
47684
|
let origin = gobj_read_str_attr(gobj_yuno(), "node_uuid");
|
|
47336
47685
|
for (const [topic_name, properties] of Object.entries(priv._graph_properties)) {
|
|
47337
47686
|
properties.__origin__ = origin;
|
|
47338
|
-
|
|
47687
|
+
let kw_update = {
|
|
47339
47688
|
treedb_name: priv.treedb_name,
|
|
47340
47689
|
topic_name: "__graphs__",
|
|
47341
47690
|
record: {
|
|
@@ -47349,7 +47698,8 @@ function save_geometry(gobj) {
|
|
|
47349
47698
|
autolink: false,
|
|
47350
47699
|
create: true
|
|
47351
47700
|
}
|
|
47352
|
-
}
|
|
47701
|
+
};
|
|
47702
|
+
gobj_publish_event(gobj, "EV_UPDATE_NODE", kw_update);
|
|
47353
47703
|
}
|
|
47354
47704
|
}
|
|
47355
47705
|
/************************************************************
|
|
@@ -47360,7 +47710,7 @@ function save_topic_graph_properties(gobj, topic_name) {
|
|
|
47360
47710
|
let properties = priv._graph_properties[topic_name];
|
|
47361
47711
|
if (!properties) return;
|
|
47362
47712
|
properties.__origin__ = gobj_read_str_attr(gobj_yuno(), "node_uuid");
|
|
47363
|
-
|
|
47713
|
+
let kw_update = {
|
|
47364
47714
|
treedb_name: priv.treedb_name,
|
|
47365
47715
|
topic_name: "__graphs__",
|
|
47366
47716
|
record: {
|
|
@@ -47374,7 +47724,8 @@ function save_topic_graph_properties(gobj, topic_name) {
|
|
|
47374
47724
|
autolink: false,
|
|
47375
47725
|
create: true
|
|
47376
47726
|
}
|
|
47377
|
-
}
|
|
47727
|
+
};
|
|
47728
|
+
gobj_publish_event(gobj, "EV_UPDATE_NODE", kw_update);
|
|
47378
47729
|
}
|
|
47379
47730
|
/************************************************************
|
|
47380
47731
|
* Pause/resume history recording.
|
|
@@ -47563,19 +47914,17 @@ function graph_add_plugin(gobj, plugin_key, options) {
|
|
|
47563
47914
|
}
|
|
47564
47915
|
plugin = graph_get_plugin(gobj, plugin_key);
|
|
47565
47916
|
switch (plugin_key) {
|
|
47566
|
-
case "history":
|
|
47567
|
-
|
|
47568
|
-
|
|
47569
|
-
|
|
47570
|
-
|
|
47571
|
-
|
|
47572
|
-
|
|
47573
|
-
|
|
47574
|
-
|
|
47575
|
-
|
|
47576
|
-
|
|
47577
|
-
}
|
|
47578
|
-
break;
|
|
47917
|
+
case "history": if (plugin) {
|
|
47918
|
+
plugin.on(HistoryEvent.CHANGE, () => {
|
|
47919
|
+
update_history_buttons(gobj);
|
|
47920
|
+
});
|
|
47921
|
+
graph.updatePlugin({
|
|
47922
|
+
key: plugin_key,
|
|
47923
|
+
beforeAddCommand: () => {
|
|
47924
|
+
return !priv._history_paused;
|
|
47925
|
+
}
|
|
47926
|
+
});
|
|
47927
|
+
}
|
|
47579
47928
|
}
|
|
47580
47929
|
}
|
|
47581
47930
|
function graph_remove_plugin(gobj, plugin_key) {
|
|
@@ -49614,9 +49963,7 @@ function handle_context_menu_click(gobj, value) {
|
|
|
49614
49963
|
case "resize_all_ports":
|
|
49615
49964
|
copy_size_to_ports(gobj, false);
|
|
49616
49965
|
break;
|
|
49617
|
-
case "resize_topic_ports":
|
|
49618
|
-
copy_size_to_ports(gobj, true);
|
|
49619
|
-
break;
|
|
49966
|
+
case "resize_topic_ports": copy_size_to_ports(gobj, true);
|
|
49620
49967
|
}
|
|
49621
49968
|
}
|
|
49622
49969
|
/************************************************************
|
|
@@ -50404,7 +50751,7 @@ function create_gclass$1(gclass_name) {
|
|
|
50404
50751
|
null
|
|
50405
50752
|
]
|
|
50406
50753
|
]]];
|
|
50407
|
-
|
|
50754
|
+
const event_types = [
|
|
50408
50755
|
["EV_DESCS", 0],
|
|
50409
50756
|
["EV_CLEAR_DATA", 0],
|
|
50410
50757
|
["EV_LOAD_DATA", 0],
|
|
@@ -50441,7 +50788,8 @@ function create_gclass$1(gclass_name) {
|
|
|
50441
50788
|
["EV_HIDE", 0],
|
|
50442
50789
|
["EV_RESIZE", 0],
|
|
50443
50790
|
["EV_THEME", 0]
|
|
50444
|
-
]
|
|
50791
|
+
];
|
|
50792
|
+
__gclass__$1 = gclass_create(gclass_name, event_types, states, gmt$1, 0, attrs_table$1, PRIVATE_DATA$1, 0, 0, 0, gclass_flag_t.gcflag_manual_start);
|
|
50445
50793
|
if (!__gclass__$1) return -1;
|
|
50446
50794
|
return 0;
|
|
50447
50795
|
}
|
|
@@ -50592,22 +50940,22 @@ var YUI_ROLLING = {
|
|
|
50592
50940
|
},
|
|
50593
50941
|
"6h": {
|
|
50594
50942
|
id: "6h",
|
|
50595
|
-
secs:
|
|
50943
|
+
secs: 21600,
|
|
50596
50944
|
label: "last 6h"
|
|
50597
50945
|
},
|
|
50598
50946
|
"24h": {
|
|
50599
50947
|
id: "24h",
|
|
50600
|
-
secs:
|
|
50948
|
+
secs: 86400,
|
|
50601
50949
|
label: "last 24h"
|
|
50602
50950
|
},
|
|
50603
50951
|
"7d": {
|
|
50604
50952
|
id: "7d",
|
|
50605
|
-
secs:
|
|
50953
|
+
secs: 604800,
|
|
50606
50954
|
label: "last 7 days"
|
|
50607
50955
|
},
|
|
50608
50956
|
"30d": {
|
|
50609
50957
|
id: "30d",
|
|
50610
|
-
secs:
|
|
50958
|
+
secs: 2592e3,
|
|
50611
50959
|
label: "last 30 days"
|
|
50612
50960
|
}
|
|
50613
50961
|
};
|
|
@@ -51970,7 +52318,8 @@ function ac_set_mode(gobj, event, kw, src) {
|
|
|
51970
52318
|
*
|
|
51971
52319
|
***************************************************************/
|
|
51972
52320
|
function ac_prev(gobj, event, kw, src) {
|
|
51973
|
-
|
|
52321
|
+
let mode = cur_mode(gobj);
|
|
52322
|
+
gobj_write_attr(gobj, "anchor", period_shift(mode.spec, gobj_read_integer_attr(gobj, "anchor"), -1));
|
|
51974
52323
|
close_calendar(gobj);
|
|
51975
52324
|
repaint(gobj);
|
|
51976
52325
|
publish_period(gobj);
|
|
@@ -51980,7 +52329,8 @@ function ac_prev(gobj, event, kw, src) {
|
|
|
51980
52329
|
*
|
|
51981
52330
|
***************************************************************/
|
|
51982
52331
|
function ac_next(gobj, event, kw, src) {
|
|
51983
|
-
|
|
52332
|
+
let mode = cur_mode(gobj);
|
|
52333
|
+
gobj_write_attr(gobj, "anchor", period_shift(mode.spec, gobj_read_integer_attr(gobj, "anchor"), 1));
|
|
51984
52334
|
close_calendar(gobj);
|
|
51985
52335
|
repaint(gobj);
|
|
51986
52336
|
publish_period(gobj);
|
|
@@ -52158,7 +52508,7 @@ function create_gclass(gclass_name) {
|
|
|
52158
52508
|
null
|
|
52159
52509
|
]
|
|
52160
52510
|
]]];
|
|
52161
|
-
|
|
52511
|
+
const event_types = [
|
|
52162
52512
|
["EV_SET_MODE", 0],
|
|
52163
52513
|
["EV_PREV", 0],
|
|
52164
52514
|
["EV_NEXT", 0],
|
|
@@ -52169,7 +52519,8 @@ function create_gclass(gclass_name) {
|
|
|
52169
52519
|
["EV_REFRESH", 0],
|
|
52170
52520
|
["EV_LANGUAGE_CHANGED", 0],
|
|
52171
52521
|
["EV_PERIOD_CHANGED", event_flag_t.EVF_OUTPUT_EVENT]
|
|
52172
|
-
]
|
|
52522
|
+
];
|
|
52523
|
+
__gclass__ = gclass_create(gclass_name, event_types, states, gmt, 0, attrs_table, PRIVATE_DATA, 0, 0, 0, 0);
|
|
52173
52524
|
if (!__gclass__) return -1;
|
|
52174
52525
|
return 0;
|
|
52175
52526
|
}
|
|
@@ -52269,8 +52620,8 @@ function traffic_now() {
|
|
|
52269
52620
|
function traffic_size(n) {
|
|
52270
52621
|
n = Number(n) || 0;
|
|
52271
52622
|
if (n < 1024) return n + " B";
|
|
52272
|
-
if (n <
|
|
52273
|
-
return (n /
|
|
52623
|
+
if (n < 1048576) return (n / 1024).toFixed(1) + " KB";
|
|
52624
|
+
return (n / 1048576).toFixed(1) + " MB";
|
|
52274
52625
|
}
|
|
52275
52626
|
/************************************************************
|
|
52276
52627
|
* Seconds-since-epoch → ISO string, or null if not a plausible
|
|
@@ -52353,7 +52704,8 @@ function set_output_route(v) {
|
|
|
52353
52704
|
refresh_dev_chrome();
|
|
52354
52705
|
}
|
|
52355
52706
|
function toggle_pref(key, def) {
|
|
52356
|
-
|
|
52707
|
+
let v = dev_num(key, def) ? 0 : 1;
|
|
52708
|
+
kw_set_local_storage_value(key, v);
|
|
52357
52709
|
rerender_all();
|
|
52358
52710
|
refresh_dev_chrome();
|
|
52359
52711
|
}
|
|
@@ -53613,7 +53965,7 @@ function apply_dev_traces() {
|
|
|
53613
53965
|
function setup_dev(self, show) {
|
|
53614
53966
|
if (show) {
|
|
53615
53967
|
ensure_dev_style();
|
|
53616
|
-
|
|
53968
|
+
let win = gobj_create_service("Developer-Window", "C_YUI_WINDOW", {
|
|
53617
53969
|
$parent: document.getElementById("top-layer") || null,
|
|
53618
53970
|
subscriber: null,
|
|
53619
53971
|
showMax: true,
|
|
@@ -53630,7 +53982,8 @@ function setup_dev(self, show) {
|
|
|
53630
53982
|
on_close: function() {
|
|
53631
53983
|
kw_set_local_storage_value("open_developer_window", 0);
|
|
53632
53984
|
}
|
|
53633
|
-
}, self)
|
|
53985
|
+
}, self);
|
|
53986
|
+
gobj_start(win);
|
|
53634
53987
|
kw_set_local_storage_value("open_developer_window", 1);
|
|
53635
53988
|
setTimeout(() => {
|
|
53636
53989
|
refresh_dev_chrome();
|
|
@@ -53734,7 +54087,8 @@ function setup_frontend_view(self) {
|
|
|
53734
54087
|
log_error("yui_frontend_view: cannot create the frontend-view window");
|
|
53735
54088
|
return null;
|
|
53736
54089
|
}
|
|
53737
|
-
let
|
|
54090
|
+
let tree = gobj_create_pure_child("frontend_view_tree", "C_YUI_GOBJ_TREE_JS", {}, win);
|
|
54091
|
+
let $tree = gobj_read_attr(tree, "$container");
|
|
53738
54092
|
if (!$tree) {
|
|
53739
54093
|
log_error("yui_frontend_view: C_YUI_GOBJ_TREE_JS without $container");
|
|
53740
54094
|
return win;
|