@yuneta/gobj-ui 5.11.1 → 5.13.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 +1035 -527
- package/dist/gobj-ui.es.js +1037 -528
- package/package.json +2 -2
- package/src/c_yui_json.js +8 -0
- package/src/c_yui_treedb_topic_with_form.css +18 -0
- package/src/c_yui_treedb_topic_with_form.js +356 -4
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,11 @@ 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,
|
|
16141
|
+
cell_json_gobj: null,
|
|
16142
|
+
cell_json_modal: null
|
|
16112
16143
|
};
|
|
16113
16144
|
var __gclass__$4 = null;
|
|
16114
16145
|
function popup_mount_layer(gobj) {
|
|
@@ -16147,6 +16178,8 @@ function mt_stop$4(gobj) {
|
|
|
16147
16178
|
let shell = yui_shell_of(gobj);
|
|
16148
16179
|
if (shell) gobj_unsubscribe_event(shell, "EV_LANGUAGE_CHANGED", {}, gobj);
|
|
16149
16180
|
close_form_dialog(gobj);
|
|
16181
|
+
close_schema_dialog(gobj);
|
|
16182
|
+
close_cell_json_dialog(gobj);
|
|
16150
16183
|
table__destroy(gobj);
|
|
16151
16184
|
}
|
|
16152
16185
|
/***************************************************************
|
|
@@ -16154,6 +16187,8 @@ function mt_stop$4(gobj) {
|
|
|
16154
16187
|
***************************************************************/
|
|
16155
16188
|
function mt_destroy$4(gobj) {
|
|
16156
16189
|
close_form_dialog(gobj);
|
|
16190
|
+
close_schema_dialog(gobj);
|
|
16191
|
+
close_cell_json_dialog(gobj);
|
|
16157
16192
|
destroy_ui$1(gobj);
|
|
16158
16193
|
}
|
|
16159
16194
|
/************************************************************
|
|
@@ -16209,7 +16244,8 @@ function cmd_get_topic_data(gobj, cmd, kw, src) {
|
|
|
16209
16244
|
async function readClipboard(gobj) {
|
|
16210
16245
|
try {
|
|
16211
16246
|
const text = await navigator.clipboard.readText();
|
|
16212
|
-
|
|
16247
|
+
let kw = JSON.parse(text);
|
|
16248
|
+
gobj_send_event(gobj, "EV_PASTE_ROWS", kw, gobj);
|
|
16213
16249
|
} catch (error) {
|
|
16214
16250
|
log_error(`Failed to read clipboard contents: ${error}`);
|
|
16215
16251
|
}
|
|
@@ -16355,7 +16391,9 @@ function build_ui$4(gobj) {
|
|
|
16355
16391
|
let toolbar_id = gobj_read_str_attr(gobj, "toolbar_id");
|
|
16356
16392
|
let $view_toolbar = createElement2(["div", { class: "TREEDB_TABLE_TOOLS is-flex is-align-items-center" }]);
|
|
16357
16393
|
let with_refresh_button = gobj_read_bool_attr(gobj, "with_refresh_button");
|
|
16358
|
-
|
|
16394
|
+
let with_search_button = gobj_read_bool_attr(gobj, "with_search_button");
|
|
16395
|
+
let with_schema_button = gobj_read_bool_attr(gobj, "with_schema_button");
|
|
16396
|
+
if (with_search_button) {
|
|
16359
16397
|
let search_id = `${toolbar_id}_search`;
|
|
16360
16398
|
let $search_box = createElement2([
|
|
16361
16399
|
"div",
|
|
@@ -16413,6 +16451,33 @@ function build_ui$4(gobj) {
|
|
|
16413
16451
|
]);
|
|
16414
16452
|
$view_toolbar.appendChild($refresh);
|
|
16415
16453
|
}
|
|
16454
|
+
if (with_schema_button) {
|
|
16455
|
+
let $schema = createElement2([
|
|
16456
|
+
"button",
|
|
16457
|
+
{
|
|
16458
|
+
class: "TREEDB_TABLE_SCHEMA button mr-1",
|
|
16459
|
+
title: t("schema"),
|
|
16460
|
+
"data-i18n-title": "schema",
|
|
16461
|
+
"aria-label": t("schema"),
|
|
16462
|
+
"data-i18n-aria-label": "schema"
|
|
16463
|
+
},
|
|
16464
|
+
[["i", { class: "yi-hexagon-nodes" }], [
|
|
16465
|
+
"span",
|
|
16466
|
+
{
|
|
16467
|
+
class: "is-hidden-mobile",
|
|
16468
|
+
i18n: "schema",
|
|
16469
|
+
style: "padding-left:5px;"
|
|
16470
|
+
},
|
|
16471
|
+
"schema"
|
|
16472
|
+
]],
|
|
16473
|
+
{ "click": (event) => {
|
|
16474
|
+
event.stopPropagation();
|
|
16475
|
+
gobj_send_event(gobj, "EV_SHOW_SCHEMA", {}, gobj);
|
|
16476
|
+
} }
|
|
16477
|
+
]);
|
|
16478
|
+
$view_toolbar.appendChild($schema);
|
|
16479
|
+
}
|
|
16480
|
+
let table_id = gobj_read_str_attr(gobj, "table_id");
|
|
16416
16481
|
let $container = createElement2([
|
|
16417
16482
|
"div",
|
|
16418
16483
|
{
|
|
@@ -16423,7 +16488,7 @@ function build_ui$4(gobj) {
|
|
|
16423
16488
|
class: "TREEDB_TABLE_TOOLBAR toolbar_tabulator_table m-1",
|
|
16424
16489
|
style: "display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap;"
|
|
16425
16490
|
}], ["div", {
|
|
16426
|
-
id: `${
|
|
16491
|
+
id: `${table_id}`,
|
|
16427
16492
|
style: "margin-top:0px !important;"
|
|
16428
16493
|
}]]
|
|
16429
16494
|
]);
|
|
@@ -16466,7 +16531,8 @@ function destroy_ui$1(gobj) {
|
|
|
16466
16531
|
* columns); leave the rest on the flat shared key.
|
|
16467
16532
|
******************************************************************/
|
|
16468
16533
|
function col_label(col, topic_name) {
|
|
16469
|
-
|
|
16534
|
+
let keys = topic_name ? [topic_name + "." + col.id, col.id] : [col.id];
|
|
16535
|
+
return t(keys, { defaultValue: col.header || col.id });
|
|
16470
16536
|
}
|
|
16471
16537
|
/******************************************************************
|
|
16472
16538
|
* Column-title formatter: render the header as a span carrying
|
|
@@ -16528,6 +16594,20 @@ function create_tabulator(gobj) {
|
|
|
16528
16594
|
if (col) return transform__treedb_value_2_table_value(gobj, col, value, row, field);
|
|
16529
16595
|
return "???";
|
|
16530
16596
|
}
|
|
16597
|
+
function json_cell_click(e, cell) {
|
|
16598
|
+
if (!cell.getElement().querySelector(".JSON_CELL")) return;
|
|
16599
|
+
e.stopPropagation();
|
|
16600
|
+
let pkey = desc.pkey || "id";
|
|
16601
|
+
let row_id = cell.getData()[pkey];
|
|
16602
|
+
if (row_id === void 0 || row_id === null) {
|
|
16603
|
+
log_error(`${gobj_short_name(gobj)}: row without pkey '${pkey}', cannot open the json of '${cell.getField()}'`);
|
|
16604
|
+
return;
|
|
16605
|
+
}
|
|
16606
|
+
gobj_send_event(gobj, "EV_SHOW_CELL_JSON", {
|
|
16607
|
+
row_id,
|
|
16608
|
+
col_id: cell.getField()
|
|
16609
|
+
}, gobj);
|
|
16610
|
+
}
|
|
16531
16611
|
for (let i = 0; i < desc.cols.length; i++) {
|
|
16532
16612
|
let col = desc.cols[i];
|
|
16533
16613
|
if (!col.id || col.id[0] === "_") continue;
|
|
@@ -16581,7 +16661,10 @@ function create_tabulator(gobj) {
|
|
|
16581
16661
|
case "array":
|
|
16582
16662
|
case "list":
|
|
16583
16663
|
case "coordinates":
|
|
16584
|
-
case "blob":
|
|
16664
|
+
case "blob":
|
|
16665
|
+
case "gbuffer":
|
|
16666
|
+
cellClick = json_cell_click;
|
|
16667
|
+
break;
|
|
16585
16668
|
case "boolean":
|
|
16586
16669
|
hozAlign = "center";
|
|
16587
16670
|
vertAlign = "middle";
|
|
@@ -16592,7 +16675,6 @@ function create_tabulator(gobj) {
|
|
|
16592
16675
|
case "real":
|
|
16593
16676
|
hozAlign = "right";
|
|
16594
16677
|
sorter = "number";
|
|
16595
|
-
break;
|
|
16596
16678
|
}
|
|
16597
16679
|
let colDef = {
|
|
16598
16680
|
title: col_label(col, gobj_read_str_attr(gobj, "topic_name")),
|
|
@@ -16707,6 +16789,36 @@ function table__destroy(gobj) {
|
|
|
16707
16789
|
}
|
|
16708
16790
|
}
|
|
16709
16791
|
/************************************************************
|
|
16792
|
+
* Cell of a col holding a JSON document (dict/list/blob/
|
|
16793
|
+
* template/coordinates/…): a one-line truncated preview,
|
|
16794
|
+
* marked as a link because the click opens the whole value
|
|
16795
|
+
* in a viewer (json_cell_click -> EV_SHOW_CELL_JSON).
|
|
16796
|
+
*
|
|
16797
|
+
* An empty document gets no link — there is nothing to open,
|
|
16798
|
+
* and json_cell_click uses its absence to ignore the click.
|
|
16799
|
+
*
|
|
16800
|
+
* Built as a DOM node and not as an HTML string: the preview
|
|
16801
|
+
* is raw record data, so it must never be parsed as markup.
|
|
16802
|
+
************************************************************/
|
|
16803
|
+
function build_json_cell_preview(value) {
|
|
16804
|
+
if (value === null || value === void 0 || json_size(value) === 0) return "";
|
|
16805
|
+
let text = JSON.stringify(value);
|
|
16806
|
+
if (text && text.length > 20) text = text.substring(0, 20) + "…";
|
|
16807
|
+
return createElement2([
|
|
16808
|
+
"a",
|
|
16809
|
+
{
|
|
16810
|
+
class: "JSON_CELL",
|
|
16811
|
+
title: t("show json"),
|
|
16812
|
+
"data-i18n-title": "show json"
|
|
16813
|
+
},
|
|
16814
|
+
[["span", { class: "JSON_CELL_ICON icon yi-eye" }], [
|
|
16815
|
+
"span",
|
|
16816
|
+
{ class: "JSON_CELL_PREVIEW" },
|
|
16817
|
+
text
|
|
16818
|
+
]]
|
|
16819
|
+
]);
|
|
16820
|
+
}
|
|
16821
|
+
/************************************************************
|
|
16710
16822
|
* Convert a record column value from backend to frontend
|
|
16711
16823
|
************************************************************/
|
|
16712
16824
|
function transform__treedb_value_2_table_value(gobj, col, value, row, field) {
|
|
@@ -16728,8 +16840,7 @@ function transform__treedb_value_2_table_value(gobj, col, value, row, field) {
|
|
|
16728
16840
|
case "coordinates":
|
|
16729
16841
|
case "blob":
|
|
16730
16842
|
case "gbuffer":
|
|
16731
|
-
value =
|
|
16732
|
-
if (value && value.length > 20) value = value.substring(0, 20) + "…";
|
|
16843
|
+
value = build_json_cell_preview(value);
|
|
16733
16844
|
break;
|
|
16734
16845
|
case "enum":
|
|
16735
16846
|
switch (field_desc.real_type) {
|
|
@@ -16737,9 +16848,7 @@ function transform__treedb_value_2_table_value(gobj, col, value, row, field) {
|
|
|
16737
16848
|
case "object":
|
|
16738
16849
|
case "dict":
|
|
16739
16850
|
case "array":
|
|
16740
|
-
case "list":
|
|
16741
|
-
value = JSON.stringify(value);
|
|
16742
|
-
break;
|
|
16851
|
+
case "list": value = JSON.stringify(value);
|
|
16743
16852
|
}
|
|
16744
16853
|
break;
|
|
16745
16854
|
case "hook":
|
|
@@ -16756,14 +16865,16 @@ function transform__treedb_value_2_table_value(gobj, col, value, row, field) {
|
|
|
16756
16865
|
break;
|
|
16757
16866
|
case "fkey":
|
|
16758
16867
|
let new_value = [];
|
|
16759
|
-
if (value)
|
|
16760
|
-
|
|
16761
|
-
|
|
16762
|
-
|
|
16763
|
-
let
|
|
16764
|
-
|
|
16868
|
+
if (value) {
|
|
16869
|
+
if (is_string(value)) {
|
|
16870
|
+
let fkey = treedb_decoder_fkey(col, value);
|
|
16871
|
+
if (fkey) new_value.push(fkey.id);
|
|
16872
|
+
} else if (is_array(value)) for (let i = 0; i < value.length; i++) {
|
|
16873
|
+
let fkey = treedb_decoder_fkey(col, value[i]);
|
|
16874
|
+
if (fkey) new_value.push(fkey.id);
|
|
16875
|
+
}
|
|
16876
|
+
else log_error("fkey type unsupported: " + JSON.stringify(value));
|
|
16765
16877
|
}
|
|
16766
|
-
else log_error("fkey type unsupported: " + JSON.stringify(value));
|
|
16767
16878
|
value = new_value.join(", ");
|
|
16768
16879
|
break;
|
|
16769
16880
|
case "now":
|
|
@@ -16784,14 +16895,11 @@ function transform__treedb_value_2_table_value(gobj, col, value, row, field) {
|
|
|
16784
16895
|
second: "2-digit",
|
|
16785
16896
|
hour12: true
|
|
16786
16897
|
}).format(value) + "</span>";
|
|
16787
|
-
break;
|
|
16788
16898
|
}
|
|
16789
16899
|
break;
|
|
16790
16900
|
case "color": break;
|
|
16791
16901
|
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;
|
|
16902
|
+
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
16903
|
}
|
|
16796
16904
|
if (value !== null && value !== void 0 && typeof value === "object" && !(value instanceof Node)) {
|
|
16797
16905
|
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 +17067,171 @@ function close_form_dialog(gobj) {
|
|
|
16959
17067
|
teardown_form_child(gobj);
|
|
16960
17068
|
}
|
|
16961
17069
|
/************************************************************
|
|
17070
|
+
* Show the topic's SCHEMA: its `desc` — pkey, cols, types,
|
|
17071
|
+
* flags and fkey targets — in the standardized adaptive
|
|
17072
|
+
* dialog, rendered by a C_YUI_JSON child. A viewer and not a
|
|
17073
|
+
* <pre> dump because a forty-column topic is only readable
|
|
17074
|
+
* collapsed and searchable.
|
|
17075
|
+
*
|
|
17076
|
+
* Read-only and offline: the desc is already in this gobj,
|
|
17077
|
+
* so no command is issued and nothing can be edited here.
|
|
17078
|
+
************************************************************/
|
|
17079
|
+
function open_schema_dialog(gobj) {
|
|
17080
|
+
close_schema_dialog(gobj);
|
|
17081
|
+
let priv = gobj.priv;
|
|
17082
|
+
let desc = gobj_read_attr(gobj, "desc");
|
|
17083
|
+
if (!desc) {
|
|
17084
|
+
log_error(`${gobj_short_name(gobj)}: no desc, no schema to show`);
|
|
17085
|
+
return;
|
|
17086
|
+
}
|
|
17087
|
+
let shell = yui_shell_of(gobj);
|
|
17088
|
+
if (!shell) {
|
|
17089
|
+
log_error(`${gobj_short_name(gobj)}: no shell, cannot open the schema view`);
|
|
17090
|
+
return;
|
|
17091
|
+
}
|
|
17092
|
+
let json_view = gobj_create_pure_child("schema_" + clean_name(gobj_name(gobj)), "C_YUI_JSON", {}, gobj);
|
|
17093
|
+
if (!json_view) {
|
|
17094
|
+
log_error(`${gobj_short_name(gobj)}: cannot create the schema viewer`);
|
|
17095
|
+
return;
|
|
17096
|
+
}
|
|
17097
|
+
priv.schema_gobj = json_view;
|
|
17098
|
+
gobj_start(json_view);
|
|
17099
|
+
let $box = gobj_read_attr(json_view, "$container");
|
|
17100
|
+
if (!$box) {
|
|
17101
|
+
log_error(`${gobj_short_name(gobj)}: the schema viewer built no $container`);
|
|
17102
|
+
teardown_schema_child(gobj);
|
|
17103
|
+
return;
|
|
17104
|
+
}
|
|
17105
|
+
priv.schema_modal = yui_shell_show_modal(shell, $box, {
|
|
17106
|
+
dialog: true,
|
|
17107
|
+
logical_class: "TREEDB_SCHEMA_SHEET",
|
|
17108
|
+
title_prefix: gobj_read_str_attr(gobj, "topic_name"),
|
|
17109
|
+
title: "schema",
|
|
17110
|
+
t,
|
|
17111
|
+
on_close: function() {
|
|
17112
|
+
teardown_schema_child(gobj);
|
|
17113
|
+
}
|
|
17114
|
+
});
|
|
17115
|
+
gobj_send_event(json_view, "EV_SET_JSON", { json: desc }, gobj);
|
|
17116
|
+
}
|
|
17117
|
+
/************************************************************
|
|
17118
|
+
* Destroy the hosted C_YUI_JSON child. Called from the
|
|
17119
|
+
* schema modal's on_close — the shell has already removed
|
|
17120
|
+
* the dialog DOM and retired its Escape / history entries.
|
|
17121
|
+
************************************************************/
|
|
17122
|
+
function teardown_schema_child(gobj) {
|
|
17123
|
+
let priv = gobj.priv;
|
|
17124
|
+
if (priv.schema_gobj) {
|
|
17125
|
+
if (gobj_is_running(priv.schema_gobj)) gobj_stop(priv.schema_gobj);
|
|
17126
|
+
gobj_destroy(priv.schema_gobj);
|
|
17127
|
+
priv.schema_gobj = null;
|
|
17128
|
+
}
|
|
17129
|
+
priv.schema_modal = null;
|
|
17130
|
+
}
|
|
17131
|
+
/************************************************************
|
|
17132
|
+
* Close the schema dialog (teardown, or a second open).
|
|
17133
|
+
* Closing the modal runs its on_close, which tears the
|
|
17134
|
+
* viewer child down.
|
|
17135
|
+
************************************************************/
|
|
17136
|
+
function close_schema_dialog(gobj) {
|
|
17137
|
+
let priv = gobj.priv;
|
|
17138
|
+
if (priv.schema_modal) {
|
|
17139
|
+
let modal = priv.schema_modal;
|
|
17140
|
+
priv.schema_modal = null;
|
|
17141
|
+
modal.close();
|
|
17142
|
+
return;
|
|
17143
|
+
}
|
|
17144
|
+
teardown_schema_child(gobj);
|
|
17145
|
+
}
|
|
17146
|
+
/************************************************************
|
|
17147
|
+
* Show the JSON document held by ONE CELL — the value of a
|
|
17148
|
+
* dict/list/object/array/blob/template/coordinates col — in
|
|
17149
|
+
* the standardized adaptive dialog, rendered by a C_YUI_JSON
|
|
17150
|
+
* child. The cell can only show a 20-char preview; this is
|
|
17151
|
+
* where the value is actually readable (collapsed, searchable).
|
|
17152
|
+
*
|
|
17153
|
+
* Read-only and offline: the record is already in the table,
|
|
17154
|
+
* so no command is issued and nothing can be edited here (the
|
|
17155
|
+
* edit form remains the way to change the value).
|
|
17156
|
+
************************************************************/
|
|
17157
|
+
function open_cell_json_dialog(gobj, row_id, col_id) {
|
|
17158
|
+
close_cell_json_dialog(gobj);
|
|
17159
|
+
let priv = gobj.priv;
|
|
17160
|
+
let tabulator = gobj_read_attr(gobj, "tabulator");
|
|
17161
|
+
if (!tabulator) {
|
|
17162
|
+
log_error(`${gobj_short_name(gobj)}: no table, no cell to show`);
|
|
17163
|
+
return;
|
|
17164
|
+
}
|
|
17165
|
+
let row = tabulator.getRow(row_id);
|
|
17166
|
+
if (!row) {
|
|
17167
|
+
log_error(`${gobj_short_name(gobj)}: row '${row_id}' not found in the table`);
|
|
17168
|
+
return;
|
|
17169
|
+
}
|
|
17170
|
+
let value = row.getData()[col_id];
|
|
17171
|
+
if (value === void 0) {
|
|
17172
|
+
log_error(`${gobj_short_name(gobj)}: row '${row_id}' has no col '${col_id}'`);
|
|
17173
|
+
return;
|
|
17174
|
+
}
|
|
17175
|
+
let shell = yui_shell_of(gobj);
|
|
17176
|
+
if (!shell) {
|
|
17177
|
+
log_error(`${gobj_short_name(gobj)}: no shell, cannot open the cell json`);
|
|
17178
|
+
return;
|
|
17179
|
+
}
|
|
17180
|
+
let json_view = gobj_create_pure_child("cell_" + clean_name(gobj_name(gobj)), "C_YUI_JSON", {}, gobj);
|
|
17181
|
+
if (!json_view) {
|
|
17182
|
+
log_error(`${gobj_short_name(gobj)}: cannot create the cell json viewer`);
|
|
17183
|
+
return;
|
|
17184
|
+
}
|
|
17185
|
+
priv.cell_json_gobj = json_view;
|
|
17186
|
+
gobj_start(json_view);
|
|
17187
|
+
let $box = gobj_read_attr(json_view, "$container");
|
|
17188
|
+
if (!$box) {
|
|
17189
|
+
log_error(`${gobj_short_name(gobj)}: the cell json viewer built no $container`);
|
|
17190
|
+
teardown_cell_json_child(gobj);
|
|
17191
|
+
return;
|
|
17192
|
+
}
|
|
17193
|
+
priv.cell_json_modal = yui_shell_show_modal(shell, $box, {
|
|
17194
|
+
dialog: true,
|
|
17195
|
+
logical_class: "TREEDB_CELL_JSON_SHEET",
|
|
17196
|
+
title_prefix: String(row_id),
|
|
17197
|
+
title: col_id,
|
|
17198
|
+
t,
|
|
17199
|
+
on_close: function() {
|
|
17200
|
+
teardown_cell_json_child(gobj);
|
|
17201
|
+
}
|
|
17202
|
+
});
|
|
17203
|
+
gobj_send_event(json_view, "EV_SET_JSON", { json: value }, gobj);
|
|
17204
|
+
}
|
|
17205
|
+
/************************************************************
|
|
17206
|
+
* Destroy the hosted C_YUI_JSON child. Called from the cell
|
|
17207
|
+
* modal's on_close — the shell has already removed the dialog
|
|
17208
|
+
* DOM and retired its Escape / history entries.
|
|
17209
|
+
************************************************************/
|
|
17210
|
+
function teardown_cell_json_child(gobj) {
|
|
17211
|
+
let priv = gobj.priv;
|
|
17212
|
+
if (priv.cell_json_gobj) {
|
|
17213
|
+
if (gobj_is_running(priv.cell_json_gobj)) gobj_stop(priv.cell_json_gobj);
|
|
17214
|
+
gobj_destroy(priv.cell_json_gobj);
|
|
17215
|
+
priv.cell_json_gobj = null;
|
|
17216
|
+
}
|
|
17217
|
+
priv.cell_json_modal = null;
|
|
17218
|
+
}
|
|
17219
|
+
/************************************************************
|
|
17220
|
+
* Close the cell json dialog (teardown, or a second open).
|
|
17221
|
+
* Closing the modal runs its on_close, which tears the
|
|
17222
|
+
* viewer child down.
|
|
17223
|
+
************************************************************/
|
|
17224
|
+
function close_cell_json_dialog(gobj) {
|
|
17225
|
+
let priv = gobj.priv;
|
|
17226
|
+
if (priv.cell_json_modal) {
|
|
17227
|
+
let modal = priv.cell_json_modal;
|
|
17228
|
+
priv.cell_json_modal = null;
|
|
17229
|
+
modal.close();
|
|
17230
|
+
return;
|
|
17231
|
+
}
|
|
17232
|
+
teardown_cell_json_child(gobj);
|
|
17233
|
+
}
|
|
17234
|
+
/************************************************************
|
|
16962
17235
|
* True if the topic's pkey col carries the "rowid" flag.
|
|
16963
17236
|
************************************************************/
|
|
16964
17237
|
function pkey_is_rowid(gobj) {
|
|
@@ -17072,16 +17345,16 @@ function transform__form_value_2_treedb_value(gobj, col, value, operation) {
|
|
|
17072
17345
|
case "enum":
|
|
17073
17346
|
switch (field_desc.real_type) {
|
|
17074
17347
|
case "string":
|
|
17075
|
-
if (is_array(value))
|
|
17076
|
-
|
|
17348
|
+
if (is_array(value)) {
|
|
17349
|
+
if (value.length > 0) value = value[0];
|
|
17350
|
+
else value = "";
|
|
17351
|
+
}
|
|
17077
17352
|
break;
|
|
17078
17353
|
case "object":
|
|
17079
17354
|
case "dict":
|
|
17080
17355
|
case "array":
|
|
17081
17356
|
case "list": break;
|
|
17082
|
-
default:
|
|
17083
|
-
log_error("col type unknown 6: " + field_desc.real_type);
|
|
17084
|
-
break;
|
|
17357
|
+
default: log_error("col type unknown 6: " + field_desc.real_type);
|
|
17085
17358
|
}
|
|
17086
17359
|
break;
|
|
17087
17360
|
case "now":
|
|
@@ -17093,23 +17366,17 @@ function transform__form_value_2_treedb_value(gobj, col, value, operation) {
|
|
|
17093
17366
|
case "integer":
|
|
17094
17367
|
if (value && is_date(value)) value = value.getTime() / 1e3;
|
|
17095
17368
|
break;
|
|
17096
|
-
default:
|
|
17097
|
-
log_error("col type unknown 7: " + field_desc.real_type);
|
|
17098
|
-
break;
|
|
17369
|
+
default: log_error("col type unknown 7: " + field_desc.real_type);
|
|
17099
17370
|
}
|
|
17100
17371
|
break;
|
|
17101
17372
|
case "color":
|
|
17102
17373
|
switch (field_desc.real_type) {
|
|
17103
17374
|
case "string": break;
|
|
17104
17375
|
case "integer": break;
|
|
17105
|
-
default:
|
|
17106
|
-
log_error("col type unknown 7: " + field_desc.real_type);
|
|
17107
|
-
break;
|
|
17376
|
+
default: log_error("col type unknown 7: " + field_desc.real_type);
|
|
17108
17377
|
}
|
|
17109
17378
|
break;
|
|
17110
|
-
default:
|
|
17111
|
-
log_error("col type unknown 8: " + field_desc.type);
|
|
17112
|
-
break;
|
|
17379
|
+
default: log_error("col type unknown 8: " + field_desc.type);
|
|
17113
17380
|
}
|
|
17114
17381
|
return value;
|
|
17115
17382
|
}
|
|
@@ -17151,9 +17418,7 @@ function build_fkey_ref(gobj, col, value) {
|
|
|
17151
17418
|
refs[topic_name + "^" + v + "^" + hook] = true;
|
|
17152
17419
|
break;
|
|
17153
17420
|
case "array":
|
|
17154
|
-
case "list":
|
|
17155
|
-
refs.push(topic_name + "^" + v + "^" + hook);
|
|
17156
|
-
break;
|
|
17421
|
+
case "list": refs.push(topic_name + "^" + v + "^" + hook);
|
|
17157
17422
|
}
|
|
17158
17423
|
} else if (is_object(v)) {
|
|
17159
17424
|
let topic_name = v.topic_name;
|
|
@@ -17166,9 +17431,7 @@ function build_fkey_ref(gobj, col, value) {
|
|
|
17166
17431
|
refs[topic_name + "^" + v.id + "^" + hook] = true;
|
|
17167
17432
|
break;
|
|
17168
17433
|
case "array":
|
|
17169
|
-
case "list":
|
|
17170
|
-
refs.push(topic_name + "^" + v.id + "^" + hook);
|
|
17171
|
-
break;
|
|
17434
|
+
case "list": refs.push(topic_name + "^" + v.id + "^" + hook);
|
|
17172
17435
|
}
|
|
17173
17436
|
} else {
|
|
17174
17437
|
log_error("Merde value1: " + v);
|
|
@@ -17285,8 +17548,10 @@ function ac_load_nodes(gobj, event, kw, src) {
|
|
|
17285
17548
|
return -1;
|
|
17286
17549
|
}
|
|
17287
17550
|
let tabulator = gobj_read_attr(gobj, "tabulator");
|
|
17288
|
-
if (tabulator)
|
|
17289
|
-
|
|
17551
|
+
if (tabulator) {
|
|
17552
|
+
if (tabulator._ready) tabulator.setData(data);
|
|
17553
|
+
else tabulator._pendingData = data;
|
|
17554
|
+
}
|
|
17290
17555
|
return 0;
|
|
17291
17556
|
}
|
|
17292
17557
|
/************************************************************
|
|
@@ -17395,9 +17660,7 @@ function ac_new_row(gobj, event, kw, src) {
|
|
|
17395
17660
|
case "template":
|
|
17396
17661
|
if (col.template) row[col.id] = col.template;
|
|
17397
17662
|
break;
|
|
17398
|
-
default:
|
|
17399
|
-
if (field_desc.default_value !== void 0) row[col.id] = field_desc.default_value;
|
|
17400
|
-
break;
|
|
17663
|
+
default: if (field_desc.default_value !== void 0) row[col.id] = field_desc.default_value;
|
|
17401
17664
|
}
|
|
17402
17665
|
}
|
|
17403
17666
|
show_create_form(gobj, row);
|
|
@@ -17488,7 +17751,8 @@ function ac_paste_rows(gobj, event, kw, src) {
|
|
|
17488
17751
|
* fkeys, times and numbers). Route by the form's mode.
|
|
17489
17752
|
************************************************************/
|
|
17490
17753
|
function ac_form_save_record(gobj, event, kw, src) {
|
|
17491
|
-
|
|
17754
|
+
let mode = gobj_read_str_attr(src, "form_mode");
|
|
17755
|
+
gobj_publish_event(gobj, mode === "create" ? "EV_CREATE_RECORD" : "EV_UPDATE_RECORD", {
|
|
17492
17756
|
topic_name: gobj_read_str_attr(gobj, "topic_name"),
|
|
17493
17757
|
record: kw
|
|
17494
17758
|
});
|
|
@@ -17505,12 +17769,14 @@ function ac_select_rows(gobj, event, kw, src) {
|
|
|
17505
17769
|
let $container = gobj_read_attr(gobj, "$container");
|
|
17506
17770
|
let $button_delete_record = $container.querySelector(`.button-delete-record`);
|
|
17507
17771
|
let $button_copy_record = $container.querySelector(`.button-copy-record`);
|
|
17508
|
-
if ($button_delete_record)
|
|
17509
|
-
|
|
17510
|
-
|
|
17511
|
-
|
|
17512
|
-
|
|
17513
|
-
|
|
17772
|
+
if ($button_delete_record) {
|
|
17773
|
+
if (tabulator.getSelectedData().length && gobj_read_bool_attr(gobj, "editable")) {
|
|
17774
|
+
$button_delete_record.removeAttribute("disabled");
|
|
17775
|
+
$button_copy_record.removeAttribute("disabled");
|
|
17776
|
+
} else {
|
|
17777
|
+
$button_delete_record.setAttribute("disabled", true);
|
|
17778
|
+
$button_copy_record.setAttribute("disabled", true);
|
|
17779
|
+
}
|
|
17514
17780
|
}
|
|
17515
17781
|
if (gobj_read_bool_attr(gobj, "broadcast_select_rows_event")) gobj_publish_event(gobj, event, kw);
|
|
17516
17782
|
return 0;
|
|
@@ -17523,12 +17789,14 @@ function ac_unselect_rows(gobj, event, kw, src) {
|
|
|
17523
17789
|
let $container = gobj_read_attr(gobj, "$container");
|
|
17524
17790
|
let $button_delete_record = $container.querySelector(`.button-delete-record`);
|
|
17525
17791
|
let $button_copy_record = $container.querySelector(`.button-copy-record`);
|
|
17526
|
-
if ($button_delete_record)
|
|
17527
|
-
|
|
17528
|
-
|
|
17529
|
-
|
|
17530
|
-
|
|
17531
|
-
|
|
17792
|
+
if ($button_delete_record) {
|
|
17793
|
+
if (tabulator.getSelectedData().length && gobj_read_bool_attr(gobj, "editable")) {
|
|
17794
|
+
$button_delete_record.removeAttribute("disabled");
|
|
17795
|
+
$button_copy_record.removeAttribute("disabled");
|
|
17796
|
+
} else {
|
|
17797
|
+
$button_delete_record.setAttribute("disabled", true);
|
|
17798
|
+
$button_copy_record.setAttribute("disabled", true);
|
|
17799
|
+
}
|
|
17532
17800
|
}
|
|
17533
17801
|
if (gobj_read_bool_attr(gobj, "broadcast_select_rows_event")) gobj_publish_event(gobj, event, kw);
|
|
17534
17802
|
return 0;
|
|
@@ -17550,7 +17818,8 @@ function ac_change_locale(gobj, event, kw, src) {
|
|
|
17550
17818
|
* };
|
|
17551
17819
|
************************************************************/
|
|
17552
17820
|
function ac_show_hook_data$1(gobj, event, kw, src) {
|
|
17553
|
-
let
|
|
17821
|
+
let webix = gobj_command(gobj_parent(gobj), "get_topic_data", kw, gobj);
|
|
17822
|
+
let row = kwid_find_one_record(gobj, webix.data, kw.row_id, null);
|
|
17554
17823
|
if (row) {
|
|
17555
17824
|
let cell = row[kw.col_id];
|
|
17556
17825
|
show_dropdown_popup_menu(gobj, kw.click_x, kw.click_y, cell);
|
|
@@ -17565,6 +17834,24 @@ function ac_refresh$1(gobj, event, kw, src) {
|
|
|
17565
17834
|
return 0;
|
|
17566
17835
|
}
|
|
17567
17836
|
/************************************************************
|
|
17837
|
+
* Show the JSON document of one cell
|
|
17838
|
+
* {
|
|
17839
|
+
* row_id:
|
|
17840
|
+
* col_id:
|
|
17841
|
+
* }
|
|
17842
|
+
************************************************************/
|
|
17843
|
+
function ac_show_cell_json(gobj, event, kw, src) {
|
|
17844
|
+
open_cell_json_dialog(gobj, kw.row_id, kw.col_id);
|
|
17845
|
+
return 0;
|
|
17846
|
+
}
|
|
17847
|
+
/************************************************************
|
|
17848
|
+
* Show the schema (desc) of this topic
|
|
17849
|
+
************************************************************/
|
|
17850
|
+
function ac_show_schema(gobj, event, kw, src) {
|
|
17851
|
+
open_schema_dialog(gobj);
|
|
17852
|
+
return 0;
|
|
17853
|
+
}
|
|
17854
|
+
/************************************************************
|
|
17568
17855
|
* {
|
|
17569
17856
|
* href: href
|
|
17570
17857
|
* }
|
|
@@ -17668,6 +17955,11 @@ function create_gclass$4(gclass_name) {
|
|
|
17668
17955
|
ac_show_hook_data$1,
|
|
17669
17956
|
null
|
|
17670
17957
|
],
|
|
17958
|
+
[
|
|
17959
|
+
"EV_SHOW_CELL_JSON",
|
|
17960
|
+
ac_show_cell_json,
|
|
17961
|
+
null
|
|
17962
|
+
],
|
|
17671
17963
|
[
|
|
17672
17964
|
"EV_CHANGE_LOCALE",
|
|
17673
17965
|
ac_change_locale,
|
|
@@ -17678,6 +17970,11 @@ function create_gclass$4(gclass_name) {
|
|
|
17678
17970
|
ac_refresh$1,
|
|
17679
17971
|
null
|
|
17680
17972
|
],
|
|
17973
|
+
[
|
|
17974
|
+
"EV_SHOW_SCHEMA",
|
|
17975
|
+
ac_show_schema,
|
|
17976
|
+
null
|
|
17977
|
+
],
|
|
17681
17978
|
[
|
|
17682
17979
|
"EV_SHOW",
|
|
17683
17980
|
ac_show$3,
|
|
@@ -17689,7 +17986,7 @@ function create_gclass$4(gclass_name) {
|
|
|
17689
17986
|
null
|
|
17690
17987
|
]
|
|
17691
17988
|
]]];
|
|
17692
|
-
|
|
17989
|
+
const event_types = [
|
|
17693
17990
|
["EV_LANGUAGE_CHANGED", 0],
|
|
17694
17991
|
["EV_LOAD_NODES", 0],
|
|
17695
17992
|
["EV_LOAD_NODE_CREATED", 0],
|
|
@@ -17704,15 +18001,18 @@ function create_gclass$4(gclass_name) {
|
|
|
17704
18001
|
["EV_SELECT_ROWS", event_flag_t.EVF_OUTPUT_EVENT],
|
|
17705
18002
|
["EV_UNSELECT_ROWS", event_flag_t.EVF_OUTPUT_EVENT],
|
|
17706
18003
|
["EV_SHOW_HOOK_DATA", event_flag_t.EVF_OUTPUT_EVENT],
|
|
18004
|
+
["EV_SHOW_CELL_JSON", 0],
|
|
17707
18005
|
["EV_CHANGE_LOCALE", 0],
|
|
17708
18006
|
["EV_REFRESH", 0],
|
|
18007
|
+
["EV_SHOW_SCHEMA", 0],
|
|
17709
18008
|
["EV_CREATE_RECORD", event_flag_t.EVF_OUTPUT_EVENT],
|
|
17710
18009
|
["EV_UPDATE_RECORD", event_flag_t.EVF_OUTPUT_EVENT],
|
|
17711
18010
|
["EV_DELETE_RECORD", event_flag_t.EVF_OUTPUT_EVENT],
|
|
17712
18011
|
["EV_REFRESH_TOPIC", event_flag_t.EVF_OUTPUT_EVENT],
|
|
17713
18012
|
["EV_SHOW", 0],
|
|
17714
18013
|
["EV_HIDE", 0]
|
|
17715
|
-
]
|
|
18014
|
+
];
|
|
18015
|
+
__gclass__$4 = gclass_create(gclass_name, event_types, states, gmt$4, 0, attrs_table$4, PRIVATE_DATA$4, 0, 0, 0, 0);
|
|
17716
18016
|
if (!__gclass__$4) return -1;
|
|
17717
18017
|
return 0;
|
|
17718
18018
|
}
|
|
@@ -17721,6 +18021,7 @@ function create_gclass$4(gclass_name) {
|
|
|
17721
18021
|
***************************************************************/
|
|
17722
18022
|
function register_c_yui_treedb_topic_with_form() {
|
|
17723
18023
|
if (!gclass_find_by_name("C_YUI_FORM", false)) register_c_yui_form();
|
|
18024
|
+
if (!gclass_find_by_name("C_YUI_JSON", false)) register_c_yui_json();
|
|
17724
18025
|
return create_gclass$4(GCLASS_NAME$4);
|
|
17725
18026
|
}
|
|
17726
18027
|
//#endregion
|
|
@@ -17907,7 +18208,8 @@ function mt_create$3(gobj) {
|
|
|
17907
18208
|
if (!subscriber) subscriber = gobj_parent(gobj);
|
|
17908
18209
|
gobj_subscribe_event(gobj, null, {}, subscriber);
|
|
17909
18210
|
if (!priv.treedb_name) log_error(`${gobj_name(gobj)} -> treedb_name not configured`);
|
|
17910
|
-
|
|
18211
|
+
let canvas_id = clean_name(gobj_name(gobj)) + "-canvas";
|
|
18212
|
+
gobj_write_attr(gobj, "canvas_id", canvas_id);
|
|
17911
18213
|
let $container_canvas = build_ui$3(gobj).querySelector(`#${priv.canvas_id}`);
|
|
17912
18214
|
priv.gobj_nodes_tree = gobj_create_service(`${gobj_name(gobj)}-g6`, "C_G6_NODES_TREE", {
|
|
17913
18215
|
$container: $container_canvas,
|
|
@@ -18693,8 +18995,10 @@ function ac_mt_command_answer(gobj, event, kw, src) {
|
|
|
18693
18995
|
else gobj_send_event(jv, "EV_SET_JSON", { json: data }, gobj);
|
|
18694
18996
|
return 0;
|
|
18695
18997
|
}
|
|
18696
|
-
if (result < 0)
|
|
18697
|
-
|
|
18998
|
+
if (result < 0) {
|
|
18999
|
+
if (command === "descs") show_load_error(gobj, t(comment));
|
|
19000
|
+
else yui_shell_show_error(yui_shell_of(gobj), comment, { t });
|
|
19001
|
+
}
|
|
18698
19002
|
switch (command) {
|
|
18699
19003
|
case "descs":
|
|
18700
19004
|
if (result >= 0) process_treedb_descs(gobj, data);
|
|
@@ -19230,7 +19534,7 @@ function create_gclass$3(gclass_name) {
|
|
|
19230
19534
|
null
|
|
19231
19535
|
]
|
|
19232
19536
|
]]];
|
|
19233
|
-
|
|
19537
|
+
const event_types = [
|
|
19234
19538
|
["EV_MT_COMMAND_ANSWER", event_flag_t.EVF_PUBLIC_EVENT],
|
|
19235
19539
|
["EV_TREEDB_NODE_CREATED", event_flag_t.EVF_PUBLIC_EVENT],
|
|
19236
19540
|
["EV_TREEDB_NODE_UPDATED", event_flag_t.EVF_PUBLIC_EVENT],
|
|
@@ -19259,7 +19563,8 @@ function create_gclass$3(gclass_name) {
|
|
|
19259
19563
|
["EV_SHOW", 0],
|
|
19260
19564
|
["EV_HIDE", 0],
|
|
19261
19565
|
["EV_TRANSPORT_STATE", 0]
|
|
19262
|
-
]
|
|
19566
|
+
];
|
|
19567
|
+
__gclass__$3 = gclass_create(gclass_name, event_types, states, gmt$3, 0, attrs_table$3, PRIVATE_DATA$3, 0, 0, 0, 0);
|
|
19263
19568
|
if (!__gclass__$3) return -1;
|
|
19264
19569
|
return 0;
|
|
19265
19570
|
}
|
|
@@ -19338,14 +19643,15 @@ function mt_destroy$2(gobj) {
|
|
|
19338
19643
|
* Build UI
|
|
19339
19644
|
************************************************************/
|
|
19340
19645
|
function build_ui$2(gobj) {
|
|
19341
|
-
|
|
19646
|
+
let $container = createElement2([
|
|
19342
19647
|
"div",
|
|
19343
19648
|
{
|
|
19344
19649
|
class: "C_YUI_TREEDB_SCHEMA TREEDB_SCHEMA_VIEW",
|
|
19345
19650
|
style: "position:relative; height:100%; min-height:0;"
|
|
19346
19651
|
},
|
|
19347
19652
|
[]
|
|
19348
|
-
])
|
|
19653
|
+
]);
|
|
19654
|
+
gobj_write_attr(gobj, "$container", $container);
|
|
19349
19655
|
}
|
|
19350
19656
|
/************************************************************
|
|
19351
19657
|
* Derive {nodes, edges} from the schema.
|
|
@@ -19470,7 +19776,8 @@ function build_graph$1(gobj) {
|
|
|
19470
19776
|
priv.graph = graph;
|
|
19471
19777
|
graph.setTheme(dark ? "dark" : "light");
|
|
19472
19778
|
graph.on(NodeEvent.CLICK, (evt) => {
|
|
19473
|
-
|
|
19779
|
+
let node_id = evt && evt.target && evt.target.id;
|
|
19780
|
+
gobj_send_event(gobj, "EV_NODE_CLICK", { node_id }, gobj);
|
|
19474
19781
|
});
|
|
19475
19782
|
graph.render().then(() => {
|
|
19476
19783
|
try {
|
|
@@ -23599,7 +23906,6 @@ function segmentToCubic(segment, params) {
|
|
|
23599
23906
|
py
|
|
23600
23907
|
];
|
|
23601
23908
|
return ["C"].concat(lineToCubic(px1, py1, px, py));
|
|
23602
|
-
default:
|
|
23603
23909
|
}
|
|
23604
23910
|
return segment;
|
|
23605
23911
|
}
|
|
@@ -23623,7 +23929,8 @@ function path2Curve(pathInput, needZCommandIndexes) {
|
|
|
23623
23929
|
for (var i = 0; i < ii; i += 1) {
|
|
23624
23930
|
if (path[i]) pathCommand = path[i][0];
|
|
23625
23931
|
allPathCommands[i] = pathCommand;
|
|
23626
|
-
|
|
23932
|
+
var curveSegment = segmentToCubic(path[i], params);
|
|
23933
|
+
path[i] = curveSegment;
|
|
23627
23934
|
fixArc(path, allPathCommands, i);
|
|
23628
23935
|
ii = path.length;
|
|
23629
23936
|
if (pathCommand === "Z") zCommandIndexes.push(i);
|
|
@@ -23675,20 +23982,22 @@ function segmentLineFactory(x1, y1, x2, y2, distance) {
|
|
|
23675
23982
|
x: 0,
|
|
23676
23983
|
y: 0
|
|
23677
23984
|
};
|
|
23678
|
-
if (typeof distance === "number")
|
|
23679
|
-
|
|
23680
|
-
|
|
23681
|
-
|
|
23682
|
-
else if (distance >= length) point = {
|
|
23683
|
-
x: x2,
|
|
23684
|
-
y: y2
|
|
23685
|
-
};
|
|
23686
|
-
else {
|
|
23687
|
-
var _a = midPoint([x1, y1], [x2, y2], distance / length);
|
|
23688
|
-
point = {
|
|
23689
|
-
x: _a[0],
|
|
23690
|
-
y: _a[1]
|
|
23985
|
+
if (typeof distance === "number") {
|
|
23986
|
+
if (distance <= 0) point = {
|
|
23987
|
+
x: x1,
|
|
23988
|
+
y: y1
|
|
23691
23989
|
};
|
|
23990
|
+
else if (distance >= length) point = {
|
|
23991
|
+
x: x2,
|
|
23992
|
+
y: y2
|
|
23993
|
+
};
|
|
23994
|
+
else {
|
|
23995
|
+
var _a = midPoint([x1, y1], [x2, y2], distance / length);
|
|
23996
|
+
point = {
|
|
23997
|
+
x: _a[0],
|
|
23998
|
+
y: _a[1]
|
|
23999
|
+
};
|
|
24000
|
+
}
|
|
23692
24001
|
}
|
|
23693
24002
|
return {
|
|
23694
24003
|
length,
|
|
@@ -25244,7 +25553,11 @@ var Rectangle = /*#__PURE__*/ function() {
|
|
|
25244
25553
|
value: function toJSON() {}
|
|
25245
25554
|
}], [{
|
|
25246
25555
|
key: "fromRect",
|
|
25247
|
-
value:
|
|
25556
|
+
value:
|
|
25557
|
+
/**
|
|
25558
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/DOMRect/fromRect_static
|
|
25559
|
+
*/
|
|
25560
|
+
function fromRect(rect) {
|
|
25248
25561
|
return new Rectangle(rect.x, rect.y, rect.width, rect.height);
|
|
25249
25562
|
}
|
|
25250
25563
|
}, {
|
|
@@ -25334,14 +25647,15 @@ function getEulerFromMat4(out, m) {
|
|
|
25334
25647
|
var z;
|
|
25335
25648
|
var _mat4$getScaling2 = _slicedToArray(getScaling(create$3(), m), 3), sx = _mat4$getScaling2[0], sy = _mat4$getScaling2[1], sz = _mat4$getScaling2[2];
|
|
25336
25649
|
var y = Math.asin(-m[2] / sx);
|
|
25337
|
-
if (y < HALF_PI)
|
|
25338
|
-
|
|
25339
|
-
|
|
25650
|
+
if (y < HALF_PI) {
|
|
25651
|
+
if (y > -HALF_PI) {
|
|
25652
|
+
x = Math.atan2(m[6] / sy, m[10] / sz);
|
|
25653
|
+
z = Math.atan2(m[1] / sx, m[0] / sx);
|
|
25654
|
+
} else {
|
|
25655
|
+
z = 0;
|
|
25656
|
+
x = -Math.atan2(m[4] / sy, m[5] / sy);
|
|
25657
|
+
}
|
|
25340
25658
|
} else {
|
|
25341
|
-
z = 0;
|
|
25342
|
-
x = -Math.atan2(m[4] / sy, m[5] / sy);
|
|
25343
|
-
}
|
|
25344
|
-
else {
|
|
25345
25659
|
z = 0;
|
|
25346
25660
|
x = Math.atan2(m[4] / sy, m[5] / sy);
|
|
25347
25661
|
}
|
|
@@ -25408,8 +25722,10 @@ function decompose(mat) {
|
|
|
25408
25722
|
var row1y = mat[4];
|
|
25409
25723
|
var scalingX = Math.sqrt(row0x * row0x + row0y * row0y);
|
|
25410
25724
|
var scalingY = Math.sqrt(row1x * row1x + row1y * row1y);
|
|
25411
|
-
if (row0x * row1y - row0y * row1x < 0)
|
|
25412
|
-
|
|
25725
|
+
if (row0x * row1y - row0y * row1x < 0) {
|
|
25726
|
+
if (row0x < row1y) scalingX = -scalingX;
|
|
25727
|
+
else scalingY = -scalingY;
|
|
25728
|
+
}
|
|
25413
25729
|
if (scalingX) {
|
|
25414
25730
|
var invScalingX = 1 / scalingX;
|
|
25415
25731
|
row0x *= invScalingX;
|
|
@@ -26383,9 +26699,10 @@ function updateLocalTransform(transform) {
|
|
|
26383
26699
|
var hasRotation = localRotation[3] !== 1 || localRotation[0] !== 0 || localRotation[1] !== 0 || localRotation[2] !== 0;
|
|
26384
26700
|
var hasScale = localScale[0] !== 1 || localScale[1] !== 1 || localScale[2] !== 1;
|
|
26385
26701
|
var hasOrigin = origin[0] !== 0 || origin[1] !== 0 || origin[2] !== 0;
|
|
26386
|
-
if (!hasRotation && !hasScale && !hasOrigin)
|
|
26387
|
-
|
|
26388
|
-
|
|
26702
|
+
if (!hasRotation && !hasScale && !hasOrigin) {
|
|
26703
|
+
if (hasPosition) fromTranslation(localTransform, localPosition);
|
|
26704
|
+
else identity(localTransform);
|
|
26705
|
+
} else fromRotationTranslationScaleOrigin(localTransform, localRotation, localPosition, localScale, origin);
|
|
26389
26706
|
}
|
|
26390
26707
|
transform.localDirtyFlag = false;
|
|
26391
26708
|
}
|
|
@@ -26973,9 +27290,7 @@ var conversionToCanonicalUnitsScaleFactor = function conversionToCanonicalUnitsS
|
|
|
26973
27290
|
case UnitType.kGradians:
|
|
26974
27291
|
factor = .9;
|
|
26975
27292
|
break;
|
|
26976
|
-
case UnitType.kTurns:
|
|
26977
|
-
factor = 360;
|
|
26978
|
-
break;
|
|
27293
|
+
case UnitType.kTurns: factor = 360;
|
|
26979
27294
|
}
|
|
26980
27295
|
return factor;
|
|
26981
27296
|
};
|
|
@@ -27149,9 +27464,10 @@ var CSSKeywordValue = /*#__PURE__*/ function(_CSSStyleValue) {
|
|
|
27149
27464
|
var formatInfinityOrNaN = function formatInfinityOrNaN(number) {
|
|
27150
27465
|
var suffix = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "";
|
|
27151
27466
|
var result = "";
|
|
27152
|
-
if (!Number.isFinite(number))
|
|
27153
|
-
|
|
27154
|
-
|
|
27467
|
+
if (!Number.isFinite(number)) {
|
|
27468
|
+
if (number > 0) result = "infinity";
|
|
27469
|
+
else result = "-infinity";
|
|
27470
|
+
} else result = "NaN";
|
|
27155
27471
|
return result += suffix;
|
|
27156
27472
|
};
|
|
27157
27473
|
var toCanonicalUnit = function toCanonicalUnit(unit) {
|
|
@@ -27720,8 +28036,10 @@ var parseGradient = memoize(function(colorStr) {
|
|
|
27720
28036
|
}
|
|
27721
28037
|
} else if (type === "r") {
|
|
27722
28038
|
var parsedRadialGradient = parseRadialGradient(colorStr);
|
|
27723
|
-
if (parsedRadialGradient)
|
|
27724
|
-
|
|
28039
|
+
if (parsedRadialGradient) {
|
|
28040
|
+
if (isString(parsedRadialGradient)) colorStr = parsedRadialGradient;
|
|
28041
|
+
else return [new CSSGradientValue(GradientType.RadialGradient, parsedRadialGradient)];
|
|
28042
|
+
}
|
|
27725
28043
|
} else if (type === "p") return parsePattern(colorStr);
|
|
27726
28044
|
}
|
|
27727
28045
|
});
|
|
@@ -28138,7 +28456,6 @@ function getPathBBox(segments, lineWidth) {
|
|
|
28138
28456
|
default:
|
|
28139
28457
|
xArr.push(currentPoint[0]);
|
|
28140
28458
|
yArr.push(currentPoint[1]);
|
|
28141
|
-
break;
|
|
28142
28459
|
}
|
|
28143
28460
|
if (box$1) {
|
|
28144
28461
|
segment.box = box$1;
|
|
@@ -28313,9 +28630,7 @@ function path2Segments(path) {
|
|
|
28313
28630
|
startMovePoint = [params[1], params[2]];
|
|
28314
28631
|
lastStartMovePointIndex = i;
|
|
28315
28632
|
break;
|
|
28316
|
-
case "A":
|
|
28317
|
-
segment.arcParams = getArcParams(currentPoint, params);
|
|
28318
|
-
break;
|
|
28633
|
+
case "A": segment.arcParams = getArcParams(currentPoint, params);
|
|
28319
28634
|
}
|
|
28320
28635
|
if (command === "Z") {
|
|
28321
28636
|
currentPoint = startMovePoint;
|
|
@@ -29602,10 +29917,12 @@ var parseTransformOrigin = memoize(function(value) {
|
|
|
29602
29917
|
if (isString(value)) {
|
|
29603
29918
|
if (value === "text-anchor") return [getOrCreateUnitValue(0, "px"), getOrCreateUnitValue(0, "px")];
|
|
29604
29919
|
var values = value.split(" ");
|
|
29605
|
-
if (values.length === 1)
|
|
29606
|
-
values[
|
|
29607
|
-
|
|
29608
|
-
|
|
29920
|
+
if (values.length === 1) {
|
|
29921
|
+
if (values[0] === "top" || values[0] === "bottom") {
|
|
29922
|
+
values[1] = values[0];
|
|
29923
|
+
values[0] = "center";
|
|
29924
|
+
} else values[1] = "center";
|
|
29925
|
+
}
|
|
29609
29926
|
if (values.length !== 2) return null;
|
|
29610
29927
|
return [parseLengthOrPercentage(convertKeyword2Percent(values[0])), parseLengthOrPercentage(convertKeyword2Percent(values[1]))];
|
|
29611
29928
|
}
|
|
@@ -30483,7 +30800,14 @@ var CSSPropertyLengthOrPercentage = /*#__PURE__*/ function() {
|
|
|
30483
30800
|
}
|
|
30484
30801
|
return _createClass(CSSPropertyLengthOrPercentage, [{
|
|
30485
30802
|
key: "calculator",
|
|
30486
|
-
value:
|
|
30803
|
+
value:
|
|
30804
|
+
/**
|
|
30805
|
+
* according to parent's bounds
|
|
30806
|
+
*
|
|
30807
|
+
* @example
|
|
30808
|
+
* CSS.percent(50) -> CSS.px(0.5 * parent.width)
|
|
30809
|
+
*/
|
|
30810
|
+
function calculator(name, oldParsed, computed, object, runtime) {
|
|
30487
30811
|
if (isNumber(computed)) return computed;
|
|
30488
30812
|
if (CSSUnitValue.isRelativeUnit(computed.unit)) {
|
|
30489
30813
|
if (computed.unit === UnitType.kPercentage) return 0;
|
|
@@ -31400,7 +31724,19 @@ var FederatedEvent = /*#__PURE__*/ function() {
|
|
|
31400
31724
|
return _createClass(FederatedEvent, [
|
|
31401
31725
|
{
|
|
31402
31726
|
key: "name",
|
|
31403
|
-
get:
|
|
31727
|
+
get:
|
|
31728
|
+
/**
|
|
31729
|
+
* The type of event, supports the following:
|
|
31730
|
+
* * pointerdown
|
|
31731
|
+
* * touchstart
|
|
31732
|
+
* * mousedown
|
|
31733
|
+
* * rightdown
|
|
31734
|
+
* * ...
|
|
31735
|
+
*/
|
|
31736
|
+
/**
|
|
31737
|
+
* @deprecated
|
|
31738
|
+
*/
|
|
31739
|
+
function get() {
|
|
31404
31740
|
return this.type;
|
|
31405
31741
|
}
|
|
31406
31742
|
},
|
|
@@ -31466,7 +31802,15 @@ var FederatedEvent = /*#__PURE__*/ function() {
|
|
|
31466
31802
|
},
|
|
31467
31803
|
{
|
|
31468
31804
|
key: "composedPath",
|
|
31469
|
-
value:
|
|
31805
|
+
value:
|
|
31806
|
+
/**
|
|
31807
|
+
* The propagation path for this event
|
|
31808
|
+
* @see https://developer.mozilla.org/zh-CN/docs/Web/API/Event/composedPath
|
|
31809
|
+
*
|
|
31810
|
+
* So composedPath()[0] represents the original target.
|
|
31811
|
+
* @see https://polymer-library.polymer-project.org/3.0/docs/devguide/events#retargeting
|
|
31812
|
+
*/
|
|
31813
|
+
function composedPath() {
|
|
31470
31814
|
if (this.manager && (!this.path || this.path[0] !== this.target)) this.path = this.target ? this.manager.propagationPath(this.target) : [];
|
|
31471
31815
|
return this.path;
|
|
31472
31816
|
}
|
|
@@ -31498,7 +31842,12 @@ var FederatedEvent = /*#__PURE__*/ function() {
|
|
|
31498
31842
|
},
|
|
31499
31843
|
{
|
|
31500
31844
|
key: "initEvent",
|
|
31501
|
-
value:
|
|
31845
|
+
value:
|
|
31846
|
+
/**
|
|
31847
|
+
* added for compatibility with DOM Event,
|
|
31848
|
+
* deprecated props and methods
|
|
31849
|
+
*/
|
|
31850
|
+
function initEvent() {}
|
|
31502
31851
|
},
|
|
31503
31852
|
{
|
|
31504
31853
|
key: "initUIEvent",
|
|
@@ -31661,7 +32010,43 @@ var FederatedPointerEvent = /*#__PURE__*/ function(_FederatedMouseEvent) {
|
|
|
31661
32010
|
return _createClass(FederatedPointerEvent, [
|
|
31662
32011
|
{
|
|
31663
32012
|
key: "getCoalescedEvents",
|
|
31664
|
-
value:
|
|
32013
|
+
value:
|
|
32014
|
+
/**
|
|
32015
|
+
* The type of pointer that triggered the event.
|
|
32016
|
+
*
|
|
32017
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/pointerType
|
|
32018
|
+
*/
|
|
32019
|
+
/**
|
|
32020
|
+
* Pressure applied by the pointing device during the event.
|
|
32021
|
+
*s
|
|
32022
|
+
* A Touch's force property will be represented by this value.
|
|
32023
|
+
*
|
|
32024
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/pressure
|
|
32025
|
+
*/
|
|
32026
|
+
/**
|
|
32027
|
+
* Barrel pressure on a stylus pointer.
|
|
32028
|
+
*
|
|
32029
|
+
* @see https://w3c.github.io/pointerevents/#pointerevent-interface
|
|
32030
|
+
*/
|
|
32031
|
+
/**
|
|
32032
|
+
* The angle, in degrees, between the pointer device and the screen.
|
|
32033
|
+
*
|
|
32034
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/tiltX
|
|
32035
|
+
*/
|
|
32036
|
+
/**
|
|
32037
|
+
* The angle, in degrees, between the pointer device and the screen.
|
|
32038
|
+
*
|
|
32039
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/tiltY
|
|
32040
|
+
*/
|
|
32041
|
+
/**
|
|
32042
|
+
* Twist of a stylus pointer.
|
|
32043
|
+
*
|
|
32044
|
+
* @see https://w3c.github.io/pointerevents/#pointerevent-interface
|
|
32045
|
+
*/
|
|
32046
|
+
/**
|
|
32047
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/getCoalescedEvents
|
|
32048
|
+
*/
|
|
32049
|
+
function getCoalescedEvents() {
|
|
31665
32050
|
if (this.type === "pointermove" || this.type === "mousemove" || this.type === "touchmove") return [this];
|
|
31666
32051
|
return [];
|
|
31667
32052
|
}
|
|
@@ -31688,7 +32073,15 @@ var FederatedWheelEvent = /*#__PURE__*/ function(_FederatedMouseEvent) {
|
|
|
31688
32073
|
_inherits(FederatedWheelEvent, _FederatedMouseEvent);
|
|
31689
32074
|
return _createClass(FederatedWheelEvent, [{
|
|
31690
32075
|
key: "clone",
|
|
31691
|
-
value:
|
|
32076
|
+
value:
|
|
32077
|
+
/**
|
|
32078
|
+
* The units of `deltaX`, `deltaY`, and `deltaZ`. This is one of `DOM_DELTA_LINE`,
|
|
32079
|
+
* `DOM_DELTA_PAGE`, `DOM_DELTA_PIXEL`.
|
|
32080
|
+
*/
|
|
32081
|
+
/** Horizontal scroll amount */
|
|
32082
|
+
/** Vertical scroll amount */
|
|
32083
|
+
/** z-axis scroll amount. */
|
|
32084
|
+
function clone() {
|
|
31692
32085
|
return this.manager.cloneWheelEvent(this);
|
|
31693
32086
|
}
|
|
31694
32087
|
}]);
|
|
@@ -31777,7 +32170,11 @@ var Node$1 = /*#__PURE__*/ function(_EventTarget) {
|
|
|
31777
32170
|
return _createClass(Node, [
|
|
31778
32171
|
{
|
|
31779
32172
|
key: "textContent",
|
|
31780
|
-
get:
|
|
32173
|
+
get:
|
|
32174
|
+
/**
|
|
32175
|
+
* @see https://developer.mozilla.org/zh-CN/docs/Web/API/Node/textContent
|
|
32176
|
+
*/
|
|
32177
|
+
function get() {
|
|
31781
32178
|
var out = "";
|
|
31782
32179
|
if (this.nodeName === Shape.TEXT) out += this.style.text;
|
|
31783
32180
|
var _iterator = _createForOfIteratorHelper(this.childNodes), _step;
|
|
@@ -31855,7 +32252,12 @@ var Node$1 = /*#__PURE__*/ function(_EventTarget) {
|
|
|
31855
32252
|
},
|
|
31856
32253
|
{
|
|
31857
32254
|
key: "parent",
|
|
31858
|
-
get:
|
|
32255
|
+
get:
|
|
32256
|
+
/**
|
|
32257
|
+
* @deprecated
|
|
32258
|
+
* @alias parentNode
|
|
32259
|
+
*/
|
|
32260
|
+
function get() {
|
|
31859
32261
|
return this.parentNode;
|
|
31860
32262
|
}
|
|
31861
32263
|
},
|
|
@@ -31925,7 +32327,12 @@ var Node$1 = /*#__PURE__*/ function(_EventTarget) {
|
|
|
31925
32327
|
},
|
|
31926
32328
|
{
|
|
31927
32329
|
key: "contain",
|
|
31928
|
-
value:
|
|
32330
|
+
value:
|
|
32331
|
+
/**
|
|
32332
|
+
* @deprecated
|
|
32333
|
+
* @alias contains
|
|
32334
|
+
*/
|
|
32335
|
+
function contain(other) {
|
|
31929
32336
|
return this.contains(other);
|
|
31930
32337
|
}
|
|
31931
32338
|
},
|
|
@@ -31976,7 +32383,12 @@ var Node$1 = /*#__PURE__*/ function(_EventTarget) {
|
|
|
31976
32383
|
return _createClass(EventTarget, [
|
|
31977
32384
|
{
|
|
31978
32385
|
key: "on",
|
|
31979
|
-
value:
|
|
32386
|
+
value:
|
|
32387
|
+
/**
|
|
32388
|
+
* @deprecated
|
|
32389
|
+
* @alias addEventListener
|
|
32390
|
+
*/
|
|
32391
|
+
function on(type, listener, options) {
|
|
31980
32392
|
this.addEventListener(type, listener, options);
|
|
31981
32393
|
return this;
|
|
31982
32394
|
}
|
|
@@ -32139,7 +32551,11 @@ var OffscreenCanvasCreator = /*#__PURE__*/ function() {
|
|
|
32139
32551
|
}
|
|
32140
32552
|
}], [{
|
|
32141
32553
|
key: "createCanvas",
|
|
32142
|
-
value:
|
|
32554
|
+
value:
|
|
32555
|
+
/**
|
|
32556
|
+
* @returns new canvas instance
|
|
32557
|
+
*/
|
|
32558
|
+
function createCanvas() {
|
|
32143
32559
|
try {
|
|
32144
32560
|
return new window.OffscreenCanvas(0, 0);
|
|
32145
32561
|
} catch (_unused2) {}
|
|
@@ -32762,10 +33178,12 @@ var DefaultSceneGraphService = /*#__PURE__*/ function() {
|
|
|
32762
33178
|
var aabb = this.getTransformedGeometryBounds(element, render, existedAABB);
|
|
32763
33179
|
element.childNodes.forEach(function(child) {
|
|
32764
33180
|
var childBounds = _this.getBounds(child, render);
|
|
32765
|
-
if (childBounds)
|
|
32766
|
-
|
|
32767
|
-
|
|
32768
|
-
|
|
33181
|
+
if (childBounds) {
|
|
33182
|
+
if (!aabb) {
|
|
33183
|
+
aabb = existedAABB || new AABB();
|
|
33184
|
+
aabb.update(childBounds.center, childBounds.halfExtents);
|
|
33185
|
+
} else aabb.add(childBounds);
|
|
33186
|
+
}
|
|
32769
33187
|
});
|
|
32770
33188
|
if (!aabb) aabb = new AABB();
|
|
32771
33189
|
if (render) {
|
|
@@ -32972,12 +33390,14 @@ var DefaultSceneGraphService = /*#__PURE__*/ function() {
|
|
|
32972
33390
|
var mutations = /* @__PURE__ */ new Set();
|
|
32973
33391
|
canvas.getRoot().forEach(function(item) {
|
|
32974
33392
|
(item.mutations || []).forEach(function(mutation) {
|
|
32975
|
-
if (mutation.type === "attributes" && mutation._boundsChangeData)
|
|
32976
|
-
|
|
32977
|
-
|
|
32978
|
-
|
|
32979
|
-
|
|
32980
|
-
|
|
33393
|
+
if (mutation.type === "attributes" && mutation._boundsChangeData) {
|
|
33394
|
+
if (mutation._boundsChangeData.affectChildren) item.forEach(function(node) {
|
|
33395
|
+
var newMutation = _objectSpread2({}, mutation);
|
|
33396
|
+
newMutation.target = node;
|
|
33397
|
+
mutations.add(newMutation);
|
|
33398
|
+
});
|
|
33399
|
+
else mutations.add(mutation);
|
|
33400
|
+
}
|
|
32981
33401
|
});
|
|
32982
33402
|
item.mutations = void 0;
|
|
32983
33403
|
});
|
|
@@ -33152,7 +33572,15 @@ var TextService = /*#__PURE__*/ function() {
|
|
|
33152
33572
|
return _createClass(TextService, [
|
|
33153
33573
|
{
|
|
33154
33574
|
key: "measureFont",
|
|
33155
|
-
value:
|
|
33575
|
+
value:
|
|
33576
|
+
/**
|
|
33577
|
+
* A global cache for character widths, keyed by font string.
|
|
33578
|
+
* e.g. { '16px Arial': { 'a': 8, 'b': 9 } }
|
|
33579
|
+
*/
|
|
33580
|
+
/**
|
|
33581
|
+
* Calculates the ascent, descent and fontSize of a given font-style.
|
|
33582
|
+
*/
|
|
33583
|
+
function measureFont(font, offscreenCanvas) {
|
|
33156
33584
|
if (this.fontMetricsCache[font]) return this.fontMetricsCache[font];
|
|
33157
33585
|
var properties = {
|
|
33158
33586
|
ascent: 0,
|
|
@@ -33650,7 +34078,18 @@ var Element$1 = /*#__PURE__*/ function(_Node) {
|
|
|
33650
34078
|
return _createClass(Element, [
|
|
33651
34079
|
{
|
|
33652
34080
|
key: "dirty",
|
|
33653
|
-
value:
|
|
34081
|
+
value:
|
|
34082
|
+
/**
|
|
34083
|
+
* Marks the element as dirty, indicating it needs re-rendering or relayout.
|
|
34084
|
+
*
|
|
34085
|
+
* @param styleFlag - Whether to update style state (default: true).
|
|
34086
|
+
* When true, sets `renderable.dirty` to true.
|
|
34087
|
+
* @param layoutFlag - Optional. When provided, updates layout-related dirty flags:
|
|
34088
|
+
* - `renderable.boundsDirty`
|
|
34089
|
+
* - `renderable.renderBoundsDirty`
|
|
34090
|
+
* - `geometry.dirty`
|
|
34091
|
+
*/
|
|
34092
|
+
function dirty() {
|
|
33654
34093
|
var styleFlag = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : true;
|
|
33655
34094
|
var layoutFlag = arguments.length > 1 ? arguments[1] : void 0;
|
|
33656
34095
|
this.renderable.dirty = styleFlag;
|
|
@@ -33663,7 +34102,16 @@ var Element$1 = /*#__PURE__*/ function(_Node) {
|
|
|
33663
34102
|
},
|
|
33664
34103
|
{
|
|
33665
34104
|
key: "className",
|
|
33666
|
-
get:
|
|
34105
|
+
get:
|
|
34106
|
+
/**
|
|
34107
|
+
* used with `getElementById()`
|
|
34108
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/Element/id
|
|
34109
|
+
*/
|
|
34110
|
+
/**
|
|
34111
|
+
* used in `getElementsByClassName`
|
|
34112
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/Document/getElementsByClassName
|
|
34113
|
+
*/
|
|
34114
|
+
function get() {
|
|
33667
34115
|
return this.getAttribute("class") || "";
|
|
33668
34116
|
},
|
|
33669
34117
|
set: function set(className) {
|
|
@@ -33672,7 +34120,11 @@ var Element$1 = /*#__PURE__*/ function(_Node) {
|
|
|
33672
34120
|
},
|
|
33673
34121
|
{
|
|
33674
34122
|
key: "classList",
|
|
33675
|
-
get:
|
|
34123
|
+
get:
|
|
34124
|
+
/**
|
|
34125
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/Element/classList
|
|
34126
|
+
*/
|
|
34127
|
+
function get() {
|
|
33676
34128
|
return this.className.split(" ").filter(function(c) {
|
|
33677
34129
|
return c !== "";
|
|
33678
34130
|
});
|
|
@@ -33746,8 +34198,10 @@ var Element$1 = /*#__PURE__*/ function(_Node) {
|
|
|
33746
34198
|
var _this$ownerDocument;
|
|
33747
34199
|
if (child.destroyed) throw new Error(ERROR_MSG_APPEND_DESTROYED_ELEMENT);
|
|
33748
34200
|
runtime.sceneGraphService.attach(child, this, index);
|
|
33749
|
-
if ((_this$ownerDocument = this.ownerDocument) !== null && _this$ownerDocument !== void 0 && _this$ownerDocument.defaultView)
|
|
33750
|
-
|
|
34201
|
+
if ((_this$ownerDocument = this.ownerDocument) !== null && _this$ownerDocument !== void 0 && _this$ownerDocument.defaultView) {
|
|
34202
|
+
if (!isInFragment(this) && child.nodeName === Shape.FRAGMENT) this.ownerDocument.defaultView.mountFragment(child);
|
|
34203
|
+
else this.ownerDocument.defaultView.mountChildren(child);
|
|
34204
|
+
}
|
|
33751
34205
|
if (this.isMutationObserved) {
|
|
33752
34206
|
insertedEvent.relatedNode = this;
|
|
33753
34207
|
child.dispatchEvent(insertedEvent);
|
|
@@ -34013,13 +34467,22 @@ var Element$1 = /*#__PURE__*/ function(_Node) {
|
|
|
34013
34467
|
},
|
|
34014
34468
|
{
|
|
34015
34469
|
key: "computedStyleMap",
|
|
34016
|
-
value:
|
|
34470
|
+
value:
|
|
34471
|
+
/**
|
|
34472
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/Element/computedStyleMap
|
|
34473
|
+
* eg. circle.computedStyleMap().get('fill');
|
|
34474
|
+
*/
|
|
34475
|
+
function computedStyleMap() {
|
|
34017
34476
|
return new Map(Object.entries(this.computedStyle));
|
|
34018
34477
|
}
|
|
34019
34478
|
},
|
|
34020
34479
|
{
|
|
34021
34480
|
key: "getAttributeNames",
|
|
34022
|
-
value:
|
|
34481
|
+
value:
|
|
34482
|
+
/**
|
|
34483
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/Element/getAttributeNames
|
|
34484
|
+
*/
|
|
34485
|
+
function getAttributeNames() {
|
|
34023
34486
|
return Object.keys(this.attributes);
|
|
34024
34487
|
}
|
|
34025
34488
|
},
|
|
@@ -36663,7 +37126,11 @@ var HTMLRenderingPlugin = /*#__PURE__*/ function() {
|
|
|
36663
37126
|
return _createClass(HTMLRenderingPlugin, [
|
|
36664
37127
|
{
|
|
36665
37128
|
key: "joinTransformMatrix",
|
|
36666
|
-
value:
|
|
37129
|
+
value:
|
|
37130
|
+
/**
|
|
37131
|
+
* ! 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`.
|
|
37132
|
+
*/
|
|
37133
|
+
function joinTransformMatrix(matrix) {
|
|
36667
37134
|
var offset = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [
|
|
36668
37135
|
0,
|
|
36669
37136
|
0,
|
|
@@ -36862,18 +37329,20 @@ var HTMLRenderingPlugin = /*#__PURE__*/ function() {
|
|
|
36862
37329
|
case "fill":
|
|
36863
37330
|
var fill = object.parsedStyle.fill;
|
|
36864
37331
|
var color = "";
|
|
36865
|
-
if (isCSSRGB(fill))
|
|
36866
|
-
|
|
36867
|
-
|
|
37332
|
+
if (isCSSRGB(fill)) {
|
|
37333
|
+
if (fill.isNone) color = "transparent";
|
|
37334
|
+
else color = object.getAttribute("fill");
|
|
37335
|
+
} else if (Array.isArray(fill)) color = object.getAttribute("fill");
|
|
36868
37336
|
else if (isPattern(fill));
|
|
36869
37337
|
$el.style.background = color;
|
|
36870
37338
|
break;
|
|
36871
37339
|
case "stroke":
|
|
36872
37340
|
var stroke = object.parsedStyle.stroke;
|
|
36873
37341
|
var borderColor = "";
|
|
36874
|
-
if (isCSSRGB(stroke))
|
|
36875
|
-
|
|
36876
|
-
|
|
37342
|
+
if (isCSSRGB(stroke)) {
|
|
37343
|
+
if (stroke.isNone) borderColor = "transparent";
|
|
37344
|
+
else borderColor = object.getAttribute("stroke");
|
|
37345
|
+
} else if (Array.isArray(stroke)) borderColor = object.getAttribute("stroke");
|
|
36877
37346
|
else if (isPattern(stroke));
|
|
36878
37347
|
$el.style["border-color"] = borderColor;
|
|
36879
37348
|
$el.style["border-style"] = "solid";
|
|
@@ -37565,8 +38034,10 @@ PERFORMANCE OF THIS SOFTWARE.
|
|
|
37565
38034
|
if (classType === CJ) return types.push(lineBreak === "strict" ? NS : ID);
|
|
37566
38035
|
if (classType === SA) return types.push(AL);
|
|
37567
38036
|
if (classType === AI) return types.push(AL);
|
|
37568
|
-
if (classType === XX)
|
|
37569
|
-
|
|
38037
|
+
if (classType === XX) {
|
|
38038
|
+
if (codePoint >= 131072 && codePoint <= 196605 || codePoint >= 196608 && codePoint <= 262141) return types.push(ID);
|
|
38039
|
+
else return types.push(AL);
|
|
38040
|
+
}
|
|
37570
38041
|
types.push(classType);
|
|
37571
38042
|
});
|
|
37572
38043
|
return [
|
|
@@ -38228,12 +38699,13 @@ PERFORMANCE OF THIS SOFTWARE.
|
|
|
38228
38699
|
} else if (codePoint === QUOTATION_MARK || codePoint === APOSTROPHE || codePoint === LEFT_PARENTHESIS || isNonPrintableCodePoint(codePoint)) {
|
|
38229
38700
|
this.consumeBadUrlRemnants();
|
|
38230
38701
|
return BAD_URL_TOKEN;
|
|
38231
|
-
} else if (codePoint === REVERSE_SOLIDUS)
|
|
38232
|
-
|
|
38233
|
-
|
|
38234
|
-
|
|
38235
|
-
|
|
38236
|
-
|
|
38702
|
+
} else if (codePoint === REVERSE_SOLIDUS) {
|
|
38703
|
+
if (isValidEscape(codePoint, this.peekCodePoint(0))) value.push(this.consumeEscapedCodePoint());
|
|
38704
|
+
else {
|
|
38705
|
+
this.consumeBadUrlRemnants();
|
|
38706
|
+
return BAD_URL_TOKEN;
|
|
38707
|
+
}
|
|
38708
|
+
} else value.push(codePoint);
|
|
38237
38709
|
}
|
|
38238
38710
|
};
|
|
38239
38711
|
Tokenizer.prototype.consumeWhiteSpace = function() {
|
|
@@ -38977,15 +39449,13 @@ PERFORMANCE OF THIS SOFTWARE.
|
|
|
38977
39449
|
ry = Math.max(Math.abs(y), Math.abs(y - height));
|
|
38978
39450
|
}
|
|
38979
39451
|
break;
|
|
38980
|
-
case 3:
|
|
38981
|
-
|
|
38982
|
-
|
|
38983
|
-
|
|
38984
|
-
|
|
38985
|
-
|
|
38986
|
-
|
|
38987
|
-
}
|
|
38988
|
-
break;
|
|
39452
|
+
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));
|
|
39453
|
+
else if (gradient.shape === 1) {
|
|
39454
|
+
var c = Math.max(Math.abs(y), Math.abs(y - height)) / Math.max(Math.abs(x), Math.abs(x - width));
|
|
39455
|
+
var _b = findCorner(width, height, x, y, false), cx = _b[0], cy = _b[1];
|
|
39456
|
+
rx = distance(cx - x, (cy - y) / c);
|
|
39457
|
+
ry = c * rx;
|
|
39458
|
+
}
|
|
38989
39459
|
}
|
|
38990
39460
|
if (Array.isArray(gradient.size)) {
|
|
38991
39461
|
rx = getAbsoluteValue(gradient.size[0], width);
|
|
@@ -39965,7 +40435,6 @@ PERFORMANCE OF THIS SOFTWARE.
|
|
|
39965
40435
|
case 4:
|
|
39966
40436
|
results.push(accumulator.join(" "));
|
|
39967
40437
|
accumulator.length = 0;
|
|
39968
|
-
break;
|
|
39969
40438
|
}
|
|
39970
40439
|
});
|
|
39971
40440
|
if (accumulator.length) results.push(accumulator.join(" "));
|
|
@@ -40174,9 +40643,7 @@ PERFORMANCE OF THIS SOFTWARE.
|
|
|
40174
40643
|
case "fill":
|
|
40175
40644
|
layers.push(0);
|
|
40176
40645
|
break;
|
|
40177
|
-
case "markers":
|
|
40178
|
-
layers.push(2);
|
|
40179
|
-
break;
|
|
40646
|
+
case "markers": layers.push(2);
|
|
40180
40647
|
}
|
|
40181
40648
|
});
|
|
40182
40649
|
DEFAULT_VALUE.forEach(function(value) {
|
|
@@ -40322,20 +40789,18 @@ PERFORMANCE OF THIS SOFTWARE.
|
|
|
40322
40789
|
case 0: return descriptor.parse(context, parser.parseComponentValue());
|
|
40323
40790
|
case 1: return descriptor.parse(context, parser.parseComponentValues());
|
|
40324
40791
|
case 4: return parser.parseComponentValue();
|
|
40325
|
-
case 3:
|
|
40326
|
-
|
|
40327
|
-
|
|
40328
|
-
|
|
40329
|
-
|
|
40330
|
-
|
|
40331
|
-
|
|
40332
|
-
|
|
40333
|
-
|
|
40334
|
-
|
|
40335
|
-
|
|
40336
|
-
|
|
40337
|
-
}
|
|
40338
|
-
break;
|
|
40792
|
+
case 3: switch (descriptor.format) {
|
|
40793
|
+
case "angle": return angle.parse(context, parser.parseComponentValue());
|
|
40794
|
+
case "color": return color$1.parse(context, parser.parseComponentValue());
|
|
40795
|
+
case "image": return image.parse(context, parser.parseComponentValue());
|
|
40796
|
+
case "length":
|
|
40797
|
+
var length_1 = parser.parseComponentValue();
|
|
40798
|
+
return isLength(length_1) ? length_1 : ZERO_LENGTH;
|
|
40799
|
+
case "length-percentage":
|
|
40800
|
+
var value_1 = parser.parseComponentValue();
|
|
40801
|
+
return isLengthPercentage(value_1) ? value_1 : ZERO_LENGTH;
|
|
40802
|
+
case "time": return time.parse(context, parser.parseComponentValue());
|
|
40803
|
+
}
|
|
40339
40804
|
}
|
|
40340
40805
|
};
|
|
40341
40806
|
var elementDebuggerAttribute = "data-html2canvas-debug";
|
|
@@ -40820,22 +41285,23 @@ PERFORMANCE OF THIS SOFTWARE.
|
|
|
40820
41285
|
var textBounds = [];
|
|
40821
41286
|
var offset = 0;
|
|
40822
41287
|
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
|
-
|
|
41288
|
+
if (styles.textDecorationLine.length || text.trim().length > 0) {
|
|
41289
|
+
if (FEATURES.SUPPORT_RANGE_BOUNDS) {
|
|
41290
|
+
var clientRects = createRange(node, offset, text.length).getClientRects();
|
|
41291
|
+
if (clientRects.length > 1) {
|
|
41292
|
+
var subSegments = segmentGraphemes(text);
|
|
41293
|
+
var subOffset_1 = 0;
|
|
41294
|
+
subSegments.forEach(function(subSegment) {
|
|
41295
|
+
textBounds.push(new TextBounds(subSegment, Bounds.fromDOMRectList(context, createRange(node, subOffset_1 + offset, subSegment.length).getClientRects())));
|
|
41296
|
+
subOffset_1 += subSegment.length;
|
|
41297
|
+
});
|
|
41298
|
+
} else textBounds.push(new TextBounds(text, Bounds.fromDOMRectList(context, clientRects)));
|
|
41299
|
+
} else {
|
|
41300
|
+
var replacementNode = node.splitText(text.length);
|
|
41301
|
+
textBounds.push(new TextBounds(text, getWrapperBounds(context, node)));
|
|
41302
|
+
node = replacementNode;
|
|
41303
|
+
}
|
|
41304
|
+
} else if (!FEATURES.SUPPORT_RANGE_BOUNDS) node = node.splitText(text.length);
|
|
40839
41305
|
offset += text.length;
|
|
40840
41306
|
});
|
|
40841
41307
|
return textBounds;
|
|
@@ -41040,9 +41506,7 @@ PERFORMANCE OF THIS SOFTWARE.
|
|
|
41040
41506
|
case CHECKBOX:
|
|
41041
41507
|
_this.styles.borderTopRightRadius = _this.styles.borderTopLeftRadius = _this.styles.borderBottomRightRadius = _this.styles.borderBottomLeftRadius = CHECKBOX_BORDER_RADIUS;
|
|
41042
41508
|
break;
|
|
41043
|
-
case RADIO:
|
|
41044
|
-
_this.styles.borderTopRightRadius = _this.styles.borderTopLeftRadius = _this.styles.borderBottomRightRadius = _this.styles.borderBottomLeftRadius = RADIO_BORDER_RADIUS;
|
|
41045
|
-
break;
|
|
41509
|
+
case RADIO: _this.styles.borderTopRightRadius = _this.styles.borderTopLeftRadius = _this.styles.borderBottomRightRadius = _this.styles.borderBottomLeftRadius = RADIO_BORDER_RADIUS;
|
|
41046
41510
|
}
|
|
41047
41511
|
return _this;
|
|
41048
41512
|
}
|
|
@@ -41096,19 +41560,21 @@ PERFORMANCE OF THIS SOFTWARE.
|
|
|
41096
41560
|
for (var childNode = node.firstChild, nextNode = void 0; childNode; childNode = nextNode) {
|
|
41097
41561
|
nextNode = childNode.nextSibling;
|
|
41098
41562
|
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
|
-
|
|
41563
|
+
else if (isElementNode(childNode)) {
|
|
41564
|
+
if (isSlotElement(childNode) && childNode.assignedNodes) childNode.assignedNodes().forEach(function(childNode) {
|
|
41565
|
+
return parseNodeTree(context, childNode, parent, root);
|
|
41566
|
+
});
|
|
41567
|
+
else {
|
|
41568
|
+
var container = createContainer(context, childNode);
|
|
41569
|
+
if (container.styles.isVisible()) {
|
|
41570
|
+
if (createsRealStackingContext(childNode, container, root)) container.flags |= 4;
|
|
41571
|
+
else if (createsStackingContext(container.styles)) container.flags |= 2;
|
|
41572
|
+
if (LIST_OWNERS.indexOf(childNode.tagName) !== -1) container.flags |= 8;
|
|
41573
|
+
parent.elements.push(container);
|
|
41574
|
+
childNode.slot;
|
|
41575
|
+
if (childNode.shadowRoot) parseNodeTree(context, childNode.shadowRoot, container, root);
|
|
41576
|
+
else if (!isTextareaElement(childNode) && !isSVGElement(childNode) && !isSelectElement(childNode)) parseNodeTree(context, childNode, container, root);
|
|
41577
|
+
}
|
|
41112
41578
|
}
|
|
41113
41579
|
}
|
|
41114
41580
|
}
|
|
@@ -41745,14 +42211,16 @@ PERFORMANCE OF THIS SOFTWARE.
|
|
|
41745
42211
|
clonedCanvas.height = canvas.height;
|
|
41746
42212
|
var ctx = canvas.getContext("2d");
|
|
41747
42213
|
var clonedCtx = clonedCanvas.getContext("2d");
|
|
41748
|
-
if (clonedCtx)
|
|
41749
|
-
|
|
41750
|
-
|
|
41751
|
-
|
|
41752
|
-
|
|
41753
|
-
|
|
42214
|
+
if (clonedCtx) {
|
|
42215
|
+
if (!this.options.allowTaint && ctx) clonedCtx.putImageData(ctx.getImageData(0, 0, canvas.width, canvas.height), 0, 0);
|
|
42216
|
+
else {
|
|
42217
|
+
var gl = (_a = canvas.getContext("webgl2")) !== null && _a !== void 0 ? _a : canvas.getContext("webgl");
|
|
42218
|
+
if (gl) {
|
|
42219
|
+
var attribs = gl.getContextAttributes();
|
|
42220
|
+
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);
|
|
42221
|
+
}
|
|
42222
|
+
clonedCtx.drawImage(canvas, 0, 0);
|
|
41754
42223
|
}
|
|
41755
|
-
clonedCtx.drawImage(canvas, 0, 0);
|
|
41756
42224
|
}
|
|
41757
42225
|
return clonedCanvas;
|
|
41758
42226
|
} catch (e) {
|
|
@@ -42081,18 +42549,19 @@ PERFORMANCE OF THIS SOFTWARE.
|
|
|
42081
42549
|
var responseType = FEATURES.SUPPORT_RESPONSE_TYPE ? "blob" : "text";
|
|
42082
42550
|
var xhr = new XMLHttpRequest();
|
|
42083
42551
|
xhr.onload = function() {
|
|
42084
|
-
if (xhr.status === 200)
|
|
42085
|
-
|
|
42086
|
-
|
|
42087
|
-
|
|
42088
|
-
|
|
42089
|
-
|
|
42090
|
-
|
|
42091
|
-
|
|
42092
|
-
|
|
42093
|
-
|
|
42094
|
-
|
|
42095
|
-
|
|
42552
|
+
if (xhr.status === 200) {
|
|
42553
|
+
if (responseType === "text") resolve(xhr.response);
|
|
42554
|
+
else {
|
|
42555
|
+
var reader_1 = new FileReader();
|
|
42556
|
+
reader_1.addEventListener("load", function() {
|
|
42557
|
+
return resolve(reader_1.result);
|
|
42558
|
+
}, false);
|
|
42559
|
+
reader_1.addEventListener("error", function(e) {
|
|
42560
|
+
return reject(e);
|
|
42561
|
+
}, false);
|
|
42562
|
+
reader_1.readAsDataURL(xhr.response);
|
|
42563
|
+
}
|
|
42564
|
+
} else reject("Failed to proxy resource " + key + " with status code " + xhr.status);
|
|
42096
42565
|
};
|
|
42097
42566
|
xhr.onerror = reject;
|
|
42098
42567
|
var queryString = proxy.indexOf("?") > -1 ? "&" : "?";
|
|
@@ -42830,9 +43299,7 @@ PERFORMANCE OF THIS SOFTWARE.
|
|
|
42830
43299
|
case 2:
|
|
42831
43300
|
_this.ctx.fillRect(text.bounds.left, Math.round(text.bounds.top), text.bounds.width, 1);
|
|
42832
43301
|
break;
|
|
42833
|
-
case 3:
|
|
42834
|
-
_this.ctx.fillRect(text.bounds.left, Math.ceil(text.bounds.top + middle), text.bounds.width, 1);
|
|
42835
|
-
break;
|
|
43302
|
+
case 3: _this.ctx.fillRect(text.bounds.left, Math.ceil(text.bounds.top + middle), text.bounds.width, 1);
|
|
42836
43303
|
}
|
|
42837
43304
|
});
|
|
42838
43305
|
}
|
|
@@ -42847,7 +43314,6 @@ PERFORMANCE OF THIS SOFTWARE.
|
|
|
42847
43314
|
_this.ctx.strokeStyle = "";
|
|
42848
43315
|
_this.ctx.lineWidth = 0;
|
|
42849
43316
|
_this.ctx.lineJoin = "miter";
|
|
42850
|
-
break;
|
|
42851
43317
|
}
|
|
42852
43318
|
});
|
|
42853
43319
|
});
|
|
@@ -42985,9 +43451,7 @@ PERFORMANCE OF THIS SOFTWARE.
|
|
|
42985
43451
|
case 1:
|
|
42986
43452
|
x += bounds.width / 2;
|
|
42987
43453
|
break;
|
|
42988
|
-
case 2:
|
|
42989
|
-
x += bounds.width;
|
|
42990
|
-
break;
|
|
43454
|
+
case 2: x += bounds.width;
|
|
42991
43455
|
}
|
|
42992
43456
|
textBounds = bounds.add(x, 0, 0, -bounds.height / 2 + 1);
|
|
42993
43457
|
this.ctx.save();
|
|
@@ -43502,8 +43966,10 @@ PERFORMANCE OF THIS SOFTWARE.
|
|
|
43502
43966
|
maxSpace = (length - (numberOfDashes + 1) * dashLength) / numberOfDashes;
|
|
43503
43967
|
spaceLength = maxSpace <= 0 || Math.abs(spaceLength - minSpace) < Math.abs(spaceLength - maxSpace) ? minSpace : maxSpace;
|
|
43504
43968
|
}
|
|
43505
|
-
if (useLineDash)
|
|
43506
|
-
|
|
43969
|
+
if (useLineDash) {
|
|
43970
|
+
if (style === 3) this.ctx.setLineDash([0, dashLength + spaceLength]);
|
|
43971
|
+
else this.ctx.setLineDash([dashLength, spaceLength]);
|
|
43972
|
+
}
|
|
43507
43973
|
if (style === 3) {
|
|
43508
43974
|
this.ctx.lineCap = "round";
|
|
43509
43975
|
this.ctx.lineWidth = width;
|
|
@@ -43638,8 +44104,10 @@ PERFORMANCE OF THIS SOFTWARE.
|
|
|
43638
44104
|
Logger.prototype.debug = function() {
|
|
43639
44105
|
var args = [];
|
|
43640
44106
|
for (var _i = 0; _i < arguments.length; _i++) args[_i] = arguments[_i];
|
|
43641
|
-
if (this.enabled)
|
|
43642
|
-
|
|
44107
|
+
if (this.enabled) {
|
|
44108
|
+
if (typeof window !== "undefined" && window.console && typeof console.debug === "function") console.debug.apply(console, __spreadArray([this.id, this.getTime() + "ms"], args));
|
|
44109
|
+
else this.info.apply(this, args);
|
|
44110
|
+
}
|
|
43643
44111
|
};
|
|
43644
44112
|
Logger.prototype.getTime = function() {
|
|
43645
44113
|
return Date.now() - this.start;
|
|
@@ -43654,14 +44122,18 @@ PERFORMANCE OF THIS SOFTWARE.
|
|
|
43654
44122
|
Logger.prototype.warn = function() {
|
|
43655
44123
|
var args = [];
|
|
43656
44124
|
for (var _i = 0; _i < arguments.length; _i++) args[_i] = arguments[_i];
|
|
43657
|
-
if (this.enabled)
|
|
43658
|
-
|
|
44125
|
+
if (this.enabled) {
|
|
44126
|
+
if (typeof window !== "undefined" && window.console && typeof console.warn === "function") console.warn.apply(console, __spreadArray([this.id, this.getTime() + "ms"], args));
|
|
44127
|
+
else this.info.apply(this, args);
|
|
44128
|
+
}
|
|
43659
44129
|
};
|
|
43660
44130
|
Logger.prototype.error = function() {
|
|
43661
44131
|
var args = [];
|
|
43662
44132
|
for (var _i = 0; _i < arguments.length; _i++) args[_i] = arguments[_i];
|
|
43663
|
-
if (this.enabled)
|
|
43664
|
-
|
|
44133
|
+
if (this.enabled) {
|
|
44134
|
+
if (typeof window !== "undefined" && window.console && typeof console.error === "function") console.error.apply(console, __spreadArray([this.id, this.getTime() + "ms"], args));
|
|
44135
|
+
else this.info.apply(this, args);
|
|
44136
|
+
}
|
|
43665
44137
|
};
|
|
43666
44138
|
Logger.instances = {};
|
|
43667
44139
|
return Logger;
|
|
@@ -43842,7 +44314,20 @@ var Animation = /*#__PURE__*/ function() {
|
|
|
43842
44314
|
return _createClass(Animation, [
|
|
43843
44315
|
{
|
|
43844
44316
|
key: "pending",
|
|
43845
|
-
get:
|
|
44317
|
+
get:
|
|
44318
|
+
/**
|
|
44319
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/Animation/effect
|
|
44320
|
+
*/
|
|
44321
|
+
/**
|
|
44322
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/Animation/timeline
|
|
44323
|
+
*/
|
|
44324
|
+
/**
|
|
44325
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/Animation/id
|
|
44326
|
+
*/
|
|
44327
|
+
/**
|
|
44328
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/Animation/pending
|
|
44329
|
+
*/
|
|
44330
|
+
function get() {
|
|
43846
44331
|
return this._startTime === null && !this._paused && this.playbackRate !== 0 || this.currentTimePending;
|
|
43847
44332
|
}
|
|
43848
44333
|
},
|
|
@@ -43857,7 +44342,18 @@ var Animation = /*#__PURE__*/ function() {
|
|
|
43857
44342
|
},
|
|
43858
44343
|
{
|
|
43859
44344
|
key: "ready",
|
|
43860
|
-
get:
|
|
44345
|
+
get:
|
|
44346
|
+
/**
|
|
44347
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/Animation/ready
|
|
44348
|
+
* @example
|
|
44349
|
+
animation.pause();
|
|
44350
|
+
animation.ready.then(function() {
|
|
44351
|
+
// Displays 'running'
|
|
44352
|
+
alert(animation.playState);
|
|
44353
|
+
});
|
|
44354
|
+
animation.play();
|
|
44355
|
+
*/
|
|
44356
|
+
function get() {
|
|
43861
44357
|
var _this = this;
|
|
43862
44358
|
if (!this.readyPromise) {
|
|
43863
44359
|
if (this.timeline.animationsWithPromises.indexOf(this) === -1) this.timeline.animationsWithPromises.push(this);
|
|
@@ -44891,8 +45387,10 @@ function normalizeTimingInput(timingInput, forGroup) {
|
|
|
44891
45387
|
return makeTiming(timingInput, forGroup);
|
|
44892
45388
|
}
|
|
44893
45389
|
function numericTimingToObject(timingInput) {
|
|
44894
|
-
if (typeof timingInput === "number")
|
|
44895
|
-
|
|
45390
|
+
if (typeof timingInput === "number") {
|
|
45391
|
+
if (isNaN(timingInput)) timingInput = { duration: "auto" };
|
|
45392
|
+
else timingInput = { duration: timingInput };
|
|
45393
|
+
}
|
|
44896
45394
|
return timingInput;
|
|
44897
45395
|
}
|
|
44898
45396
|
/**
|
|
@@ -45201,7 +45699,14 @@ runtime.CameraContribution = /* @__PURE__ */ function(_Camera) {
|
|
|
45201
45699
|
return _createClass(AdvancedCamera, [
|
|
45202
45700
|
{
|
|
45203
45701
|
key: "rotate",
|
|
45204
|
-
value:
|
|
45702
|
+
value:
|
|
45703
|
+
/**
|
|
45704
|
+
* Changes the azimuth and elevation with respect to the current camera axes
|
|
45705
|
+
* @param {Number} azimuth the relative azimuth
|
|
45706
|
+
* @param {Number} elevation the relative elevation
|
|
45707
|
+
* @param {Number} roll the relative roll
|
|
45708
|
+
*/
|
|
45709
|
+
function rotate(azimuth, elevation, roll) {
|
|
45205
45710
|
this.relElevation = getAngle(elevation);
|
|
45206
45711
|
this.relAzimuth = getAngle(azimuth);
|
|
45207
45712
|
this.relRoll = getAngle(roll);
|
|
@@ -46680,18 +47185,20 @@ function configure_toolbar(gobj) {
|
|
|
46680
47185
|
title: t("reset zoom")
|
|
46681
47186
|
}
|
|
46682
47187
|
];
|
|
46683
|
-
if (gobj_read_bool_attr(gobj, "with_fullscreen"))
|
|
46684
|
-
|
|
46685
|
-
|
|
46686
|
-
|
|
46687
|
-
|
|
46688
|
-
|
|
46689
|
-
|
|
46690
|
-
|
|
46691
|
-
|
|
46692
|
-
|
|
46693
|
-
|
|
46694
|
-
|
|
47188
|
+
if (gobj_read_bool_attr(gobj, "with_fullscreen")) {
|
|
47189
|
+
if (priv.is_fullscreen) items.push({
|
|
47190
|
+
id: "g6-icon-fullscreen-exit",
|
|
47191
|
+
value: "exit-fullscreen",
|
|
47192
|
+
className: "EV_EXIT_FULLSCREEN",
|
|
47193
|
+
title: t("exit full screen")
|
|
47194
|
+
});
|
|
47195
|
+
else items.push({
|
|
47196
|
+
id: "g6-icon-fullscreen",
|
|
47197
|
+
value: "request-fullscreen",
|
|
47198
|
+
className: "EV_REQUEST_FULLSCREEN",
|
|
47199
|
+
title: t("enter full screen")
|
|
47200
|
+
});
|
|
47201
|
+
}
|
|
46695
47202
|
return items;
|
|
46696
47203
|
},
|
|
46697
47204
|
onClick: (value) => {
|
|
@@ -46714,9 +47221,7 @@ function configure_toolbar(gobj) {
|
|
|
46714
47221
|
case "request-fullscreen":
|
|
46715
47222
|
gobj_send_event(gobj, "EV_REQUEST_FULLSCREEN", {}, gobj);
|
|
46716
47223
|
break;
|
|
46717
|
-
case "exit-fullscreen":
|
|
46718
|
-
gobj_send_event(gobj, "EV_EXIT_FULLSCREEN", {}, gobj);
|
|
46719
|
-
break;
|
|
47224
|
+
case "exit-fullscreen": gobj_send_event(gobj, "EV_EXIT_FULLSCREEN", {}, gobj);
|
|
46720
47225
|
}
|
|
46721
47226
|
}
|
|
46722
47227
|
});
|
|
@@ -46787,9 +47292,7 @@ function configure_toolbar_edit(gobj) {
|
|
|
46787
47292
|
case "redo":
|
|
46788
47293
|
gobj_send_event(gobj, "EV_HISTORY_REDO", {}, gobj);
|
|
46789
47294
|
break;
|
|
46790
|
-
case "save":
|
|
46791
|
-
gobj_send_event(gobj, "EV_SAVE_GRAPH", {}, gobj);
|
|
46792
|
-
break;
|
|
47295
|
+
case "save": gobj_send_event(gobj, "EV_SAVE_GRAPH", {}, gobj);
|
|
46793
47296
|
}
|
|
46794
47297
|
}
|
|
46795
47298
|
});
|
|
@@ -46830,9 +47333,7 @@ function configure_behaviour(gobj) {
|
|
|
46830
47333
|
case "operation":
|
|
46831
47334
|
priv.edit_mode = false;
|
|
46832
47335
|
break;
|
|
46833
|
-
default:
|
|
46834
|
-
log_error(`operation mode unknown: ${operation_mode}`);
|
|
46835
|
-
break;
|
|
47336
|
+
default: log_error(`operation mode unknown: ${operation_mode}`);
|
|
46836
47337
|
}
|
|
46837
47338
|
if (!priv.edit_mode) deselect_node(gobj);
|
|
46838
47339
|
graph_write_behaviors(gobj, behaviors);
|
|
@@ -46867,9 +47368,7 @@ function calculate_hooks_fkeys_counter(desc) {
|
|
|
46867
47368
|
case "hook":
|
|
46868
47369
|
desc.hooks_counter++;
|
|
46869
47370
|
break;
|
|
46870
|
-
case "fkey":
|
|
46871
|
-
desc.fkeys_counter++;
|
|
46872
|
-
break;
|
|
47371
|
+
case "fkey": desc.fkeys_counter++;
|
|
46873
47372
|
}
|
|
46874
47373
|
}
|
|
46875
47374
|
if (desc.hooks_counter === 0) desc.node_treedb_type = "child";
|
|
@@ -46909,7 +47408,6 @@ function build_ports(gobj, desc) {
|
|
|
46909
47408
|
stroke: getStrokeColor(desc.color)
|
|
46910
47409
|
};
|
|
46911
47410
|
top_ports.push(port);
|
|
46912
|
-
break;
|
|
46913
47411
|
}
|
|
46914
47412
|
}
|
|
46915
47413
|
for (let i = 0; i < top_ports.length; i++) top_ports[i].placement = [.5, 0];
|
|
@@ -47104,13 +47602,15 @@ function collect_fkey_refs(desc, record) {
|
|
|
47104
47602
|
let col = cols[i];
|
|
47105
47603
|
if (!col.fkey) continue;
|
|
47106
47604
|
let fkeys = record[col.id];
|
|
47107
|
-
if (fkeys)
|
|
47108
|
-
let
|
|
47109
|
-
|
|
47110
|
-
|
|
47111
|
-
|
|
47112
|
-
|
|
47113
|
-
|
|
47605
|
+
if (fkeys) {
|
|
47606
|
+
if (is_array(fkeys)) for (let j = 0; j < fkeys.length; j++) {
|
|
47607
|
+
let key = treedb_encoder_fkey(col, fkeys[j]);
|
|
47608
|
+
if (key) refs.add(i + " " + key);
|
|
47609
|
+
}
|
|
47610
|
+
else {
|
|
47611
|
+
let key = treedb_encoder_fkey(col, fkeys);
|
|
47612
|
+
if (key) refs.add(i + " " + key);
|
|
47613
|
+
}
|
|
47114
47614
|
}
|
|
47115
47615
|
}
|
|
47116
47616
|
return refs;
|
|
@@ -47126,8 +47626,10 @@ function draw_links(gobj, desc, record, initial_load) {
|
|
|
47126
47626
|
let col = cols[i];
|
|
47127
47627
|
if (!col.fkey) continue;
|
|
47128
47628
|
let fkeys = record[col.id];
|
|
47129
|
-
if (fkeys)
|
|
47130
|
-
|
|
47629
|
+
if (fkeys) {
|
|
47630
|
+
if (is_array(fkeys)) for (let j = 0; j < fkeys.length; j++) draw_link(gobj, topic_name, record_id, col, fkeys[j], initial_load);
|
|
47631
|
+
else draw_link(gobj, topic_name, record_id, col, fkeys, initial_load);
|
|
47632
|
+
}
|
|
47131
47633
|
}
|
|
47132
47634
|
}
|
|
47133
47635
|
/************************************************************
|
|
@@ -47237,8 +47739,10 @@ function clear_links(gobj, desc, record, verbose) {
|
|
|
47237
47739
|
let col = cols[i];
|
|
47238
47740
|
if (!col.fkey) continue;
|
|
47239
47741
|
let fkeys = record[col.id];
|
|
47240
|
-
if (fkeys)
|
|
47241
|
-
|
|
47742
|
+
if (fkeys) {
|
|
47743
|
+
if (is_array(fkeys)) for (let j = 0; j < fkeys.length; j++) clear_link(gobj, topic_name, record_id, col, fkeys[j], verbose);
|
|
47744
|
+
else clear_link(gobj, topic_name, record_id, col, fkeys, verbose);
|
|
47745
|
+
}
|
|
47242
47746
|
}
|
|
47243
47747
|
}
|
|
47244
47748
|
/************************************************************
|
|
@@ -47335,7 +47839,7 @@ function save_geometry(gobj) {
|
|
|
47335
47839
|
let origin = gobj_read_str_attr(gobj_yuno(), "node_uuid");
|
|
47336
47840
|
for (const [topic_name, properties] of Object.entries(priv._graph_properties)) {
|
|
47337
47841
|
properties.__origin__ = origin;
|
|
47338
|
-
|
|
47842
|
+
let kw_update = {
|
|
47339
47843
|
treedb_name: priv.treedb_name,
|
|
47340
47844
|
topic_name: "__graphs__",
|
|
47341
47845
|
record: {
|
|
@@ -47349,7 +47853,8 @@ function save_geometry(gobj) {
|
|
|
47349
47853
|
autolink: false,
|
|
47350
47854
|
create: true
|
|
47351
47855
|
}
|
|
47352
|
-
}
|
|
47856
|
+
};
|
|
47857
|
+
gobj_publish_event(gobj, "EV_UPDATE_NODE", kw_update);
|
|
47353
47858
|
}
|
|
47354
47859
|
}
|
|
47355
47860
|
/************************************************************
|
|
@@ -47360,7 +47865,7 @@ function save_topic_graph_properties(gobj, topic_name) {
|
|
|
47360
47865
|
let properties = priv._graph_properties[topic_name];
|
|
47361
47866
|
if (!properties) return;
|
|
47362
47867
|
properties.__origin__ = gobj_read_str_attr(gobj_yuno(), "node_uuid");
|
|
47363
|
-
|
|
47868
|
+
let kw_update = {
|
|
47364
47869
|
treedb_name: priv.treedb_name,
|
|
47365
47870
|
topic_name: "__graphs__",
|
|
47366
47871
|
record: {
|
|
@@ -47374,7 +47879,8 @@ function save_topic_graph_properties(gobj, topic_name) {
|
|
|
47374
47879
|
autolink: false,
|
|
47375
47880
|
create: true
|
|
47376
47881
|
}
|
|
47377
|
-
}
|
|
47882
|
+
};
|
|
47883
|
+
gobj_publish_event(gobj, "EV_UPDATE_NODE", kw_update);
|
|
47378
47884
|
}
|
|
47379
47885
|
/************************************************************
|
|
47380
47886
|
* Pause/resume history recording.
|
|
@@ -47563,19 +48069,17 @@ function graph_add_plugin(gobj, plugin_key, options) {
|
|
|
47563
48069
|
}
|
|
47564
48070
|
plugin = graph_get_plugin(gobj, plugin_key);
|
|
47565
48071
|
switch (plugin_key) {
|
|
47566
|
-
case "history":
|
|
47567
|
-
|
|
47568
|
-
|
|
47569
|
-
|
|
47570
|
-
|
|
47571
|
-
|
|
47572
|
-
|
|
47573
|
-
|
|
47574
|
-
|
|
47575
|
-
|
|
47576
|
-
|
|
47577
|
-
}
|
|
47578
|
-
break;
|
|
48072
|
+
case "history": if (plugin) {
|
|
48073
|
+
plugin.on(HistoryEvent.CHANGE, () => {
|
|
48074
|
+
update_history_buttons(gobj);
|
|
48075
|
+
});
|
|
48076
|
+
graph.updatePlugin({
|
|
48077
|
+
key: plugin_key,
|
|
48078
|
+
beforeAddCommand: () => {
|
|
48079
|
+
return !priv._history_paused;
|
|
48080
|
+
}
|
|
48081
|
+
});
|
|
48082
|
+
}
|
|
47579
48083
|
}
|
|
47580
48084
|
}
|
|
47581
48085
|
function graph_remove_plugin(gobj, plugin_key) {
|
|
@@ -49614,9 +50118,7 @@ function handle_context_menu_click(gobj, value) {
|
|
|
49614
50118
|
case "resize_all_ports":
|
|
49615
50119
|
copy_size_to_ports(gobj, false);
|
|
49616
50120
|
break;
|
|
49617
|
-
case "resize_topic_ports":
|
|
49618
|
-
copy_size_to_ports(gobj, true);
|
|
49619
|
-
break;
|
|
50121
|
+
case "resize_topic_ports": copy_size_to_ports(gobj, true);
|
|
49620
50122
|
}
|
|
49621
50123
|
}
|
|
49622
50124
|
/************************************************************
|
|
@@ -50404,7 +50906,7 @@ function create_gclass$1(gclass_name) {
|
|
|
50404
50906
|
null
|
|
50405
50907
|
]
|
|
50406
50908
|
]]];
|
|
50407
|
-
|
|
50909
|
+
const event_types = [
|
|
50408
50910
|
["EV_DESCS", 0],
|
|
50409
50911
|
["EV_CLEAR_DATA", 0],
|
|
50410
50912
|
["EV_LOAD_DATA", 0],
|
|
@@ -50441,7 +50943,8 @@ function create_gclass$1(gclass_name) {
|
|
|
50441
50943
|
["EV_HIDE", 0],
|
|
50442
50944
|
["EV_RESIZE", 0],
|
|
50443
50945
|
["EV_THEME", 0]
|
|
50444
|
-
]
|
|
50946
|
+
];
|
|
50947
|
+
__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
50948
|
if (!__gclass__$1) return -1;
|
|
50446
50949
|
return 0;
|
|
50447
50950
|
}
|
|
@@ -50592,22 +51095,22 @@ var YUI_ROLLING = {
|
|
|
50592
51095
|
},
|
|
50593
51096
|
"6h": {
|
|
50594
51097
|
id: "6h",
|
|
50595
|
-
secs:
|
|
51098
|
+
secs: 21600,
|
|
50596
51099
|
label: "last 6h"
|
|
50597
51100
|
},
|
|
50598
51101
|
"24h": {
|
|
50599
51102
|
id: "24h",
|
|
50600
|
-
secs:
|
|
51103
|
+
secs: 86400,
|
|
50601
51104
|
label: "last 24h"
|
|
50602
51105
|
},
|
|
50603
51106
|
"7d": {
|
|
50604
51107
|
id: "7d",
|
|
50605
|
-
secs:
|
|
51108
|
+
secs: 604800,
|
|
50606
51109
|
label: "last 7 days"
|
|
50607
51110
|
},
|
|
50608
51111
|
"30d": {
|
|
50609
51112
|
id: "30d",
|
|
50610
|
-
secs:
|
|
51113
|
+
secs: 2592e3,
|
|
50611
51114
|
label: "last 30 days"
|
|
50612
51115
|
}
|
|
50613
51116
|
};
|
|
@@ -51970,7 +52473,8 @@ function ac_set_mode(gobj, event, kw, src) {
|
|
|
51970
52473
|
*
|
|
51971
52474
|
***************************************************************/
|
|
51972
52475
|
function ac_prev(gobj, event, kw, src) {
|
|
51973
|
-
|
|
52476
|
+
let mode = cur_mode(gobj);
|
|
52477
|
+
gobj_write_attr(gobj, "anchor", period_shift(mode.spec, gobj_read_integer_attr(gobj, "anchor"), -1));
|
|
51974
52478
|
close_calendar(gobj);
|
|
51975
52479
|
repaint(gobj);
|
|
51976
52480
|
publish_period(gobj);
|
|
@@ -51980,7 +52484,8 @@ function ac_prev(gobj, event, kw, src) {
|
|
|
51980
52484
|
*
|
|
51981
52485
|
***************************************************************/
|
|
51982
52486
|
function ac_next(gobj, event, kw, src) {
|
|
51983
|
-
|
|
52487
|
+
let mode = cur_mode(gobj);
|
|
52488
|
+
gobj_write_attr(gobj, "anchor", period_shift(mode.spec, gobj_read_integer_attr(gobj, "anchor"), 1));
|
|
51984
52489
|
close_calendar(gobj);
|
|
51985
52490
|
repaint(gobj);
|
|
51986
52491
|
publish_period(gobj);
|
|
@@ -52158,7 +52663,7 @@ function create_gclass(gclass_name) {
|
|
|
52158
52663
|
null
|
|
52159
52664
|
]
|
|
52160
52665
|
]]];
|
|
52161
|
-
|
|
52666
|
+
const event_types = [
|
|
52162
52667
|
["EV_SET_MODE", 0],
|
|
52163
52668
|
["EV_PREV", 0],
|
|
52164
52669
|
["EV_NEXT", 0],
|
|
@@ -52169,7 +52674,8 @@ function create_gclass(gclass_name) {
|
|
|
52169
52674
|
["EV_REFRESH", 0],
|
|
52170
52675
|
["EV_LANGUAGE_CHANGED", 0],
|
|
52171
52676
|
["EV_PERIOD_CHANGED", event_flag_t.EVF_OUTPUT_EVENT]
|
|
52172
|
-
]
|
|
52677
|
+
];
|
|
52678
|
+
__gclass__ = gclass_create(gclass_name, event_types, states, gmt, 0, attrs_table, PRIVATE_DATA, 0, 0, 0, 0);
|
|
52173
52679
|
if (!__gclass__) return -1;
|
|
52174
52680
|
return 0;
|
|
52175
52681
|
}
|
|
@@ -52269,8 +52775,8 @@ function traffic_now() {
|
|
|
52269
52775
|
function traffic_size(n) {
|
|
52270
52776
|
n = Number(n) || 0;
|
|
52271
52777
|
if (n < 1024) return n + " B";
|
|
52272
|
-
if (n <
|
|
52273
|
-
return (n /
|
|
52778
|
+
if (n < 1048576) return (n / 1024).toFixed(1) + " KB";
|
|
52779
|
+
return (n / 1048576).toFixed(1) + " MB";
|
|
52274
52780
|
}
|
|
52275
52781
|
/************************************************************
|
|
52276
52782
|
* Seconds-since-epoch → ISO string, or null if not a plausible
|
|
@@ -52353,7 +52859,8 @@ function set_output_route(v) {
|
|
|
52353
52859
|
refresh_dev_chrome();
|
|
52354
52860
|
}
|
|
52355
52861
|
function toggle_pref(key, def) {
|
|
52356
|
-
|
|
52862
|
+
let v = dev_num(key, def) ? 0 : 1;
|
|
52863
|
+
kw_set_local_storage_value(key, v);
|
|
52357
52864
|
rerender_all();
|
|
52358
52865
|
refresh_dev_chrome();
|
|
52359
52866
|
}
|
|
@@ -53613,7 +54120,7 @@ function apply_dev_traces() {
|
|
|
53613
54120
|
function setup_dev(self, show) {
|
|
53614
54121
|
if (show) {
|
|
53615
54122
|
ensure_dev_style();
|
|
53616
|
-
|
|
54123
|
+
let win = gobj_create_service("Developer-Window", "C_YUI_WINDOW", {
|
|
53617
54124
|
$parent: document.getElementById("top-layer") || null,
|
|
53618
54125
|
subscriber: null,
|
|
53619
54126
|
showMax: true,
|
|
@@ -53630,7 +54137,8 @@ function setup_dev(self, show) {
|
|
|
53630
54137
|
on_close: function() {
|
|
53631
54138
|
kw_set_local_storage_value("open_developer_window", 0);
|
|
53632
54139
|
}
|
|
53633
|
-
}, self)
|
|
54140
|
+
}, self);
|
|
54141
|
+
gobj_start(win);
|
|
53634
54142
|
kw_set_local_storage_value("open_developer_window", 1);
|
|
53635
54143
|
setTimeout(() => {
|
|
53636
54144
|
refresh_dev_chrome();
|
|
@@ -53734,7 +54242,8 @@ function setup_frontend_view(self) {
|
|
|
53734
54242
|
log_error("yui_frontend_view: cannot create the frontend-view window");
|
|
53735
54243
|
return null;
|
|
53736
54244
|
}
|
|
53737
|
-
let
|
|
54245
|
+
let tree = gobj_create_pure_child("frontend_view_tree", "C_YUI_GOBJ_TREE_JS", {}, win);
|
|
54246
|
+
let $tree = gobj_read_attr(tree, "$container");
|
|
53738
54247
|
if (!$tree) {
|
|
53739
54248
|
log_error("yui_frontend_view: C_YUI_GOBJ_TREE_JS without $container");
|
|
53740
54249
|
return win;
|