@yuneta/gobj-ui 5.11.0 → 5.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/gobj-ui.cjs.js +905 -524
- package/dist/gobj-ui.es.js +907 -526
- package/index.js +1 -0
- package/package.json +2 -2
- package/src/c_yui_json.js +8 -0
- package/src/c_yui_treedb_topic_with_form.js +150 -0
package/dist/gobj-ui.es.js
CHANGED
|
@@ -33,7 +33,7 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
33
33
|
}
|
|
34
34
|
return to;
|
|
35
35
|
};
|
|
36
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
36
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule || !__hasOwnProp.call(mod, "default") ? __defProp(target, "default", {
|
|
37
37
|
value: mod,
|
|
38
38
|
enumerable: true
|
|
39
39
|
}) : target, mod));
|
|
@@ -1345,10 +1345,11 @@ function instantiate_menus(gobj, config) {
|
|
|
1345
1345
|
let renders = secondary_nav_renders(item, render_to_obj(layout));
|
|
1346
1346
|
let sub_menu_id = `secondary.${menu_id}.${item.id}`;
|
|
1347
1347
|
for (let render_cfg of renders) {
|
|
1348
|
-
let
|
|
1348
|
+
let nav = instantiate_nav_in_zone(gobj, {
|
|
1349
1349
|
items: sub.items,
|
|
1350
1350
|
render: { [zone_id]: render_cfg }
|
|
1351
|
-
}, sub_menu_id, zone_id, "secondary", item.name || "")
|
|
1351
|
+
}, sub_menu_id, zone_id, "secondary", item.name || "");
|
|
1352
|
+
let $c = gobj_read_attr(nav, "$container");
|
|
1352
1353
|
if ($c) $c.classList.add("is-hidden");
|
|
1353
1354
|
}
|
|
1354
1355
|
}
|
|
@@ -1365,7 +1366,8 @@ function instantiate_nav_in_zone(gobj, menu, menu_id, zone_id, level, nav_label)
|
|
|
1365
1366
|
let render_cfg = menu.render && (menu.render[zone_id] || menu.render["*"]) || { layout: "vertical" };
|
|
1366
1367
|
if (is_string(render_cfg)) render_cfg = { layout: render_cfg };
|
|
1367
1368
|
let layout = render_cfg.layout || "vertical";
|
|
1368
|
-
let
|
|
1369
|
+
let nav_name = `nav_${menu_id.replace(/\./g, "_")}_${zone_id}` + (layout === "backbar" ? "_backbar" : "");
|
|
1370
|
+
let nav = gobj_create(nav_name, "C_YUI_NAV", {
|
|
1369
1371
|
menu_id,
|
|
1370
1372
|
nav_label: nav_label || "",
|
|
1371
1373
|
menu_items: menu.items || [],
|
|
@@ -1891,14 +1893,15 @@ function build_toolbar_connection_item(gobj, it) {
|
|
|
1891
1893
|
attrs.title = tip;
|
|
1892
1894
|
attrs["data-i18n-title"] = tip;
|
|
1893
1895
|
}
|
|
1896
|
+
let $dot = createElement2([
|
|
1897
|
+
"span",
|
|
1898
|
+
{ class: "yui-conn-dot" },
|
|
1899
|
+
""
|
|
1900
|
+
]);
|
|
1894
1901
|
let $item = createElement2([
|
|
1895
1902
|
"button",
|
|
1896
1903
|
attrs,
|
|
1897
|
-
[
|
|
1898
|
-
"span",
|
|
1899
|
-
{ class: "yui-conn-dot" },
|
|
1900
|
-
""
|
|
1901
|
-
])]
|
|
1904
|
+
[$dot]
|
|
1902
1905
|
]);
|
|
1903
1906
|
if ((it.action && it.action.type || "") !== "") $item.addEventListener("click", (ev) => {
|
|
1904
1907
|
ev.preventDefault();
|
|
@@ -1935,11 +1938,13 @@ function handle_toolbar_action(gobj, item, $trigger) {
|
|
|
1935
1938
|
let action = item && item.action || {};
|
|
1936
1939
|
switch (action.type) {
|
|
1937
1940
|
case "navigate":
|
|
1938
|
-
if (!empty_string(action.route))
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1941
|
+
if (!empty_string(action.route)) {
|
|
1942
|
+
if (gobj_read_attr(gobj, "use_hash") && !route_restores_url(gobj, action.route)) {
|
|
1943
|
+
let h = route_to_hash(action.route);
|
|
1944
|
+
if (window.location.hash !== h) window.location.hash = h;
|
|
1945
|
+
else navigate_to(gobj, action.route);
|
|
1946
|
+
} else navigate_to(gobj, action.route);
|
|
1947
|
+
}
|
|
1943
1948
|
break;
|
|
1944
1949
|
case "drawer": {
|
|
1945
1950
|
let op = action.op || "toggle";
|
|
@@ -1975,11 +1980,13 @@ function toggle_toolbar_dropdown(gobj, item, action, $trigger) {
|
|
|
1975
1980
|
function open_toolbar_dropdown(gobj, item, action, $trigger) {
|
|
1976
1981
|
let priv = gobj.priv;
|
|
1977
1982
|
if (!priv || !priv.layers || !priv.layers.popup) return;
|
|
1983
|
+
let aria_key = item && (item.aria_label || item.name || item.id) || "Menu";
|
|
1984
|
+
let i18n_aria = item && (item.aria_label || item.name) || "Menu";
|
|
1978
1985
|
let $panel = createElement2(["div", {
|
|
1979
1986
|
class: "yui-toolbar-dropdown-panel",
|
|
1980
1987
|
role: "menu",
|
|
1981
|
-
"aria-label":
|
|
1982
|
-
"data-i18n-aria-label":
|
|
1988
|
+
"aria-label": aria_key,
|
|
1989
|
+
"data-i18n-aria-label": i18n_aria,
|
|
1983
1990
|
"data-toolbar-dropdown-for": item && item.id || ""
|
|
1984
1991
|
}]);
|
|
1985
1992
|
let raw_items = is_array(action.items) ? action.items : [];
|
|
@@ -2449,14 +2456,15 @@ function create_gclass$18(gclass_name) {
|
|
|
2449
2456
|
null
|
|
2450
2457
|
]
|
|
2451
2458
|
]]];
|
|
2452
|
-
|
|
2459
|
+
const event_types = [
|
|
2453
2460
|
["EV_NAV_CLICKED", 0],
|
|
2454
2461
|
["EV_DRAWER_CLOSE_REQUESTED", 0],
|
|
2455
2462
|
["EV_NAV_ITEM_CLOSE", event_flag_t.EVF_OUTPUT_EVENT | event_flag_t.EVF_PUBLIC_EVENT | event_flag_t.EVF_NO_WARN_SUBS],
|
|
2456
2463
|
["EV_ROUTE_REQUESTED", event_flag_t.EVF_OUTPUT_EVENT | event_flag_t.EVF_PUBLIC_EVENT | event_flag_t.EVF_NO_WARN_SUBS],
|
|
2457
2464
|
["EV_ROUTE_CHANGED", event_flag_t.EVF_OUTPUT_EVENT | event_flag_t.EVF_PUBLIC_EVENT | event_flag_t.EVF_NO_WARN_SUBS],
|
|
2458
2465
|
["EV_LANGUAGE_CHANGED", event_flag_t.EVF_OUTPUT_EVENT | event_flag_t.EVF_PUBLIC_EVENT | event_flag_t.EVF_NO_WARN_SUBS]
|
|
2459
|
-
]
|
|
2466
|
+
];
|
|
2467
|
+
__gclass__$18 = gclass_create(gclass_name, event_types, states, gmt$18, 0, attrs_table$18, PRIVATE_DATA$18, 0, 0, 0, gclass_flag_t.gcflag_no_check_output_events);
|
|
2460
2468
|
if (!__gclass__$18) return -1;
|
|
2461
2469
|
return 0;
|
|
2462
2470
|
}
|
|
@@ -3136,10 +3144,11 @@ function build_dialog(shell, message, buttons, opts) {
|
|
|
3136
3144
|
{ class: "CONFIRM_FOOT modal-card-foot" },
|
|
3137
3145
|
$footer_children
|
|
3138
3146
|
]);
|
|
3147
|
+
let logical = opts && opts.logical_class ? " " + opts.logical_class : "";
|
|
3139
3148
|
let $modal = createElement2([
|
|
3140
3149
|
"div",
|
|
3141
3150
|
{
|
|
3142
|
-
class: `CONFIRM${
|
|
3151
|
+
class: `CONFIRM${logical} modal yui-modal yui-confirm is-active is-${type}`,
|
|
3143
3152
|
role: "dialog",
|
|
3144
3153
|
"aria-modal": "true"
|
|
3145
3154
|
},
|
|
@@ -3207,6 +3216,33 @@ function yui_shell_confirm_yesno(shell, message, opts) {
|
|
|
3207
3216
|
value: "no"
|
|
3208
3217
|
}], opts).then((v) => v === "yes");
|
|
3209
3218
|
}
|
|
3219
|
+
/***************************************************************
|
|
3220
|
+
* A DESTRUCTIVE confirmation: the button that does the damage is
|
|
3221
|
+
* red, not blue.
|
|
3222
|
+
*
|
|
3223
|
+
* yui_shell_confirm_yesno() puts its yes in `is-link`, which is
|
|
3224
|
+
* the right colour for "do you want to continue" and the wrong
|
|
3225
|
+
* one for "this deletes an account": the two read the same at a
|
|
3226
|
+
* glance, and the destructive one is the one that must not be
|
|
3227
|
+
* clicked by reflex. The safe answer is also the LAST button,
|
|
3228
|
+
* so Escape, the backdrop and the X all resolve to it.
|
|
3229
|
+
*
|
|
3230
|
+
* Returns a Promise<boolean>: true only if the red button was
|
|
3231
|
+
* pressed.
|
|
3232
|
+
***************************************************************/
|
|
3233
|
+
function yui_shell_confirm_danger(shell, message, opts) {
|
|
3234
|
+
let confirm_label = opts && opts.confirm_label || "Delete";
|
|
3235
|
+
let cancel_label = opts && opts.cancel_label || "Cancel";
|
|
3236
|
+
if (!opts || !opts.type) opts = Object.assign({}, opts, { type: "danger" });
|
|
3237
|
+
return build_dialog(shell, message, [{
|
|
3238
|
+
label: confirm_label,
|
|
3239
|
+
value: "confirm",
|
|
3240
|
+
kind: "danger"
|
|
3241
|
+
}, {
|
|
3242
|
+
label: cancel_label,
|
|
3243
|
+
value: "cancel"
|
|
3244
|
+
}], opts).then((v) => v === "confirm");
|
|
3245
|
+
}
|
|
3210
3246
|
function yui_shell_confirm_yesnocancel(shell, message, opts) {
|
|
3211
3247
|
let yes_label = opts && opts.yes_label || "Yes";
|
|
3212
3248
|
let no_label = opts && opts.no_label || "No";
|
|
@@ -3298,7 +3334,8 @@ var __gclass__$17 = null;
|
|
|
3298
3334
|
function mt_create$17(gobj) {
|
|
3299
3335
|
const subscriber = gobj_read_pointer_attr(gobj, "subscriber");
|
|
3300
3336
|
if (subscriber) gobj_subscribe_event(gobj, null, {}, subscriber);
|
|
3301
|
-
|
|
3337
|
+
let window_id = "window-" + clean_name(gobj_short_name(gobj));
|
|
3338
|
+
gobj_write_attr(gobj, "window_id", window_id);
|
|
3302
3339
|
let manager = resolve_manager(gobj);
|
|
3303
3340
|
build_ui$14(gobj);
|
|
3304
3341
|
if (manager) {
|
|
@@ -3318,9 +3355,12 @@ function mt_create$17(gobj) {
|
|
|
3318
3355
|
}, gobj);
|
|
3319
3356
|
} else if (gobj_read_bool_attr(gobj, "back_dismissable")) {
|
|
3320
3357
|
let shell = yui_shell_of(gobj);
|
|
3321
|
-
if (shell)
|
|
3322
|
-
|
|
3323
|
-
|
|
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
|
+
}
|
|
3324
3364
|
}
|
|
3325
3365
|
let on_win_resize = function() {
|
|
3326
3366
|
handleResize(gobj);
|
|
@@ -3426,16 +3466,18 @@ function build_default_header(gobj) {
|
|
|
3426
3466
|
if (empty_string(title) && empty_string(prefix)) return null;
|
|
3427
3467
|
let icon = gobj_read_str_attr(gobj, "icon");
|
|
3428
3468
|
let items = [];
|
|
3429
|
-
if (!empty_string(icon))
|
|
3430
|
-
"
|
|
3431
|
-
|
|
3432
|
-
|
|
3433
|
-
|
|
3434
|
-
|
|
3435
|
-
|
|
3436
|
-
|
|
3437
|
-
|
|
3438
|
-
|
|
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
|
+
}
|
|
3439
3481
|
if (!empty_string(prefix)) items.push([
|
|
3440
3482
|
"span",
|
|
3441
3483
|
{ class: "WINDOW_TITLE_PREFIX has-text-weight-semibold" },
|
|
@@ -4094,7 +4136,7 @@ function create_gclass$17(gclass_name) {
|
|
|
4094
4136
|
null
|
|
4095
4137
|
]
|
|
4096
4138
|
]]];
|
|
4097
|
-
|
|
4139
|
+
const event_types = [
|
|
4098
4140
|
["EV_WINDOW_TO_CLOSE", event_flag_t.EVF_OUTPUT_EVENT | event_flag_t.EVF_NO_WARN_SUBS],
|
|
4099
4141
|
["EV_WINDOW_MOVED", event_flag_t.EVF_OUTPUT_EVENT | event_flag_t.EVF_NO_WARN_SUBS],
|
|
4100
4142
|
["EV_WINDOW_RESIZED", event_flag_t.EVF_OUTPUT_EVENT | event_flag_t.EVF_NO_WARN_SUBS],
|
|
@@ -4102,7 +4144,8 @@ function create_gclass$17(gclass_name) {
|
|
|
4102
4144
|
["EV_SHOW", 0],
|
|
4103
4145
|
["EV_HIDE", 0],
|
|
4104
4146
|
["EV_CLOSE_WINDOW", 0]
|
|
4105
|
-
]
|
|
4147
|
+
];
|
|
4148
|
+
__gclass__$17 = gclass_create(gclass_name, event_types, states, gmt$17, 0, attrs_table$17, PRIVATE_DATA$17, 0, 0, 0, 0);
|
|
4106
4149
|
if (!__gclass__$17) return -1;
|
|
4107
4150
|
return 0;
|
|
4108
4151
|
}
|
|
@@ -4283,11 +4326,12 @@ function ensure_dock_style() {
|
|
|
4283
4326
|
************************************************************/
|
|
4284
4327
|
function build_dock(gobj) {
|
|
4285
4328
|
ensure_dock_style();
|
|
4286
|
-
|
|
4329
|
+
let $dock = createElement2([
|
|
4287
4330
|
"div",
|
|
4288
4331
|
{ class: "C_YUI_WINDOW_MANAGER yui-dock is-empty" },
|
|
4289
4332
|
[]
|
|
4290
|
-
])
|
|
4333
|
+
]);
|
|
4334
|
+
gobj_write_attr(gobj, "$container", $dock);
|
|
4291
4335
|
apply_placement(gobj);
|
|
4292
4336
|
}
|
|
4293
4337
|
/************************************************************
|
|
@@ -4738,7 +4782,7 @@ function mt_destroy$15(gobj) {
|
|
|
4738
4782
|
* Build UI
|
|
4739
4783
|
************************************************************/
|
|
4740
4784
|
function build_ui$13(gobj) {
|
|
4741
|
-
|
|
4785
|
+
let $container = createElement2([
|
|
4742
4786
|
"div",
|
|
4743
4787
|
{
|
|
4744
4788
|
class: "C_YUI_PAGER",
|
|
@@ -4807,7 +4851,8 @@ function build_ui$13(gobj) {
|
|
|
4807
4851
|
},
|
|
4808
4852
|
[]
|
|
4809
4853
|
]]
|
|
4810
|
-
])
|
|
4854
|
+
]);
|
|
4855
|
+
gobj_write_attr(gobj, "$container", $container);
|
|
4811
4856
|
}
|
|
4812
4857
|
/************************************************************
|
|
4813
4858
|
* Destroy UI
|
|
@@ -5067,7 +5112,7 @@ function create_gclass$15(gclass_name) {
|
|
|
5067
5112
|
null
|
|
5068
5113
|
]
|
|
5069
5114
|
]]];
|
|
5070
|
-
|
|
5115
|
+
const event_types = [
|
|
5071
5116
|
["EV_PUSH_PAGE", 0],
|
|
5072
5117
|
["EV_POP_PAGE", 0],
|
|
5073
5118
|
["EV_BACK", 0],
|
|
@@ -5080,7 +5125,8 @@ function create_gclass$15(gclass_name) {
|
|
|
5080
5125
|
["EV_PAGE_SHOWN", event_flag_t.EVF_OUTPUT_EVENT | event_flag_t.EVF_NO_WARN_SUBS],
|
|
5081
5126
|
["EV_PAGE_DISCARD", event_flag_t.EVF_OUTPUT_EVENT],
|
|
5082
5127
|
["EV_PAGER_EXIT", event_flag_t.EVF_OUTPUT_EVENT]
|
|
5083
|
-
]
|
|
5128
|
+
];
|
|
5129
|
+
__gclass__$15 = gclass_create(gclass_name, event_types, states, gmt$15, 0, attrs_table$15, PRIVATE_DATA$15, 0, 0, 0, 0);
|
|
5084
5130
|
if (!__gclass__$15) return -1;
|
|
5085
5131
|
return 0;
|
|
5086
5132
|
}
|
|
@@ -5270,7 +5316,7 @@ function mt_destroy$14(gobj) {
|
|
|
5270
5316
|
* Build UI
|
|
5271
5317
|
************************************************************/
|
|
5272
5318
|
function build_ui$12(gobj) {
|
|
5273
|
-
|
|
5319
|
+
let $container = createElement2([
|
|
5274
5320
|
"div",
|
|
5275
5321
|
{
|
|
5276
5322
|
class: "C_YUI_WIZARD",
|
|
@@ -5356,7 +5402,8 @@ function build_ui$12(gobj) {
|
|
|
5356
5402
|
]]
|
|
5357
5403
|
]
|
|
5358
5404
|
]
|
|
5359
|
-
])
|
|
5405
|
+
]);
|
|
5406
|
+
gobj_write_attr(gobj, "$container", $container);
|
|
5360
5407
|
}
|
|
5361
5408
|
/************************************************************
|
|
5362
5409
|
* Destroy UI
|
|
@@ -5682,7 +5729,7 @@ function create_gclass$14(gclass_name) {
|
|
|
5682
5729
|
null
|
|
5683
5730
|
]
|
|
5684
5731
|
]]];
|
|
5685
|
-
|
|
5732
|
+
const event_types = [
|
|
5686
5733
|
["EV_SET_STEPS", 0],
|
|
5687
5734
|
["EV_NEXT", 0],
|
|
5688
5735
|
["EV_PREV", 0],
|
|
@@ -5698,7 +5745,8 @@ function create_gclass$14(gclass_name) {
|
|
|
5698
5745
|
["EV_WIZARD_DONE", event_flag_t.EVF_OUTPUT_EVENT],
|
|
5699
5746
|
["EV_WIZARD_CANCEL", event_flag_t.EVF_OUTPUT_EVENT],
|
|
5700
5747
|
["EV_STEP_VALIDATE", event_flag_t.EVF_OUTPUT_EVENT | event_flag_t.EVF_NO_WARN_SUBS]
|
|
5701
|
-
]
|
|
5748
|
+
];
|
|
5749
|
+
__gclass__$14 = gclass_create(gclass_name, event_types, states, gmt$14, 0, attrs_table$14, PRIVATE_DATA$14, 0, 0, 0, 0);
|
|
5702
5750
|
if (!__gclass__$14) return -1;
|
|
5703
5751
|
return 0;
|
|
5704
5752
|
}
|
|
@@ -5981,7 +6029,8 @@ function mt_create$13(gobj) {
|
|
|
5981
6029
|
let subscriber = gobj_read_pointer_attr(gobj, "subscriber");
|
|
5982
6030
|
if (!subscriber) subscriber = gobj_parent(gobj);
|
|
5983
6031
|
gobj_subscribe_event(gobj, null, {}, subscriber);
|
|
5984
|
-
|
|
6032
|
+
let name = clean_name(gobj_name(gobj));
|
|
6033
|
+
gobj_write_attr(gobj, "form_id", "form" + name);
|
|
5985
6034
|
build_ui$11(gobj);
|
|
5986
6035
|
}
|
|
5987
6036
|
/************************************************************
|
|
@@ -6065,7 +6114,8 @@ function set_changed_stated(gobj, changed) {
|
|
|
6065
6114
|
async function readClipboard$1(gobj) {
|
|
6066
6115
|
try {
|
|
6067
6116
|
const text = await navigator.clipboard.readText();
|
|
6068
|
-
|
|
6117
|
+
let kw = JSON.parse(text);
|
|
6118
|
+
gobj_send_event(gobj, "EV_PASTE_RECORD", kw, gobj);
|
|
6069
6119
|
} catch (error) {
|
|
6070
6120
|
log_error(`Failed to read clipboard contents: ${error}`);
|
|
6071
6121
|
}
|
|
@@ -6282,8 +6332,9 @@ function destroy_ui$7(gobj) {
|
|
|
6282
6332
|
* Build form with bulma and createElement2
|
|
6283
6333
|
******************************************************************/
|
|
6284
6334
|
function build_form(gobj) {
|
|
6335
|
+
let form_id = gobj_read_str_attr(gobj, "form_id");
|
|
6285
6336
|
let $form = createElement2(["form", {
|
|
6286
|
-
id:
|
|
6337
|
+
id: form_id,
|
|
6287
6338
|
class: "yui-form"
|
|
6288
6339
|
}]);
|
|
6289
6340
|
let template = gobj_read_attr(gobj, "template");
|
|
@@ -6390,7 +6441,6 @@ function build_form_field_conf(gobj, field_desc) {
|
|
|
6390
6441
|
case "list":
|
|
6391
6442
|
field_conf.tag = "select2";
|
|
6392
6443
|
field_conf.options = field_desc.enum_list;
|
|
6393
|
-
break;
|
|
6394
6444
|
}
|
|
6395
6445
|
break;
|
|
6396
6446
|
case "hook": break;
|
|
@@ -6427,18 +6477,12 @@ function build_form_field_conf(gobj, field_desc) {
|
|
|
6427
6477
|
case "time":
|
|
6428
6478
|
field_conf.tag = "input";
|
|
6429
6479
|
field_conf.inputType = "datetime-local";
|
|
6430
|
-
|
|
6431
|
-
case "string": break;
|
|
6432
|
-
case "integer": break;
|
|
6433
|
-
}
|
|
6480
|
+
field_desc.real_type;
|
|
6434
6481
|
break;
|
|
6435
6482
|
case "color":
|
|
6436
6483
|
field_conf.tag = "input";
|
|
6437
6484
|
field_conf.inputType = "color";
|
|
6438
|
-
|
|
6439
|
-
case "string": break;
|
|
6440
|
-
case "integer": break;
|
|
6441
|
-
}
|
|
6485
|
+
field_desc.real_type;
|
|
6442
6486
|
break;
|
|
6443
6487
|
case "email":
|
|
6444
6488
|
field_conf.tag = "input";
|
|
@@ -6556,9 +6600,7 @@ function build_fkey_ref$1(gobj, field_desc, value) {
|
|
|
6556
6600
|
refs[ref] = true;
|
|
6557
6601
|
break;
|
|
6558
6602
|
case "array":
|
|
6559
|
-
case "list":
|
|
6560
|
-
refs.push(ref);
|
|
6561
|
-
break;
|
|
6603
|
+
case "list": refs.push(ref);
|
|
6562
6604
|
}
|
|
6563
6605
|
}
|
|
6564
6606
|
return refs;
|
|
@@ -6664,40 +6706,38 @@ function create_form_field(gobj, $form, prefix, field_desc, { tag, inputType, na
|
|
|
6664
6706
|
]]
|
|
6665
6707
|
]);
|
|
6666
6708
|
break;
|
|
6667
|
-
default:
|
|
6668
|
-
|
|
6709
|
+
default: $element = createElement2([
|
|
6710
|
+
"div",
|
|
6711
|
+
{ class: "xfield field is-horizontal" },
|
|
6712
|
+
[[
|
|
6669
6713
|
"div",
|
|
6670
|
-
{ 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" },
|
|
6671
6727
|
[[
|
|
6672
6728
|
"div",
|
|
6673
|
-
{ class: "field
|
|
6729
|
+
{ class: "field" },
|
|
6674
6730
|
[[
|
|
6675
|
-
"
|
|
6731
|
+
"div",
|
|
6676
6732
|
{
|
|
6677
|
-
class: "
|
|
6678
|
-
|
|
6679
|
-
for: name
|
|
6733
|
+
class: "xcontrol control",
|
|
6734
|
+
style: ""
|
|
6680
6735
|
},
|
|
6681
|
-
|
|
6682
|
-
]]
|
|
6683
|
-
], [
|
|
6684
|
-
"div",
|
|
6685
|
-
{ class: "field-body" },
|
|
6686
|
-
[[
|
|
6687
|
-
"div",
|
|
6688
|
-
{ class: "field" },
|
|
6689
|
-
[[
|
|
6690
|
-
"div",
|
|
6691
|
-
{
|
|
6692
|
-
class: "xcontrol control",
|
|
6693
|
-
style: ""
|
|
6694
|
-
},
|
|
6695
|
-
[]
|
|
6696
|
-
]]
|
|
6736
|
+
[]
|
|
6697
6737
|
]]
|
|
6698
6738
|
]]
|
|
6699
|
-
]
|
|
6700
|
-
|
|
6739
|
+
]]
|
|
6740
|
+
]);
|
|
6701
6741
|
}
|
|
6702
6742
|
break;
|
|
6703
6743
|
case "textarea":
|
|
@@ -6950,7 +6990,7 @@ function create_form_field(gobj, $form, prefix, field_desc, { tag, inputType, na
|
|
|
6950
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));
|
|
6951
6991
|
opts = [];
|
|
6952
6992
|
}
|
|
6953
|
-
let
|
|
6993
|
+
let extend = [
|
|
6954
6994
|
"div",
|
|
6955
6995
|
{ class: "select" },
|
|
6956
6996
|
[
|
|
@@ -6968,7 +7008,8 @@ function create_form_field(gobj, $form, prefix, field_desc, { tag, inputType, na
|
|
|
6968
7008
|
gobj_send_event(gobj, "EV_RECORD_CHANGED", {}, gobj);
|
|
6969
7009
|
} }
|
|
6970
7010
|
]
|
|
6971
|
-
]
|
|
7011
|
+
];
|
|
7012
|
+
let $wrapper = createElement2(extend);
|
|
6972
7013
|
$control.appendChild($wrapper);
|
|
6973
7014
|
$extend = $wrapper.querySelector("select");
|
|
6974
7015
|
break;
|
|
@@ -6979,7 +7020,7 @@ function create_form_field(gobj, $form, prefix, field_desc, { tag, inputType, na
|
|
|
6979
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));
|
|
6980
7021
|
opts = [];
|
|
6981
7022
|
}
|
|
6982
|
-
|
|
7023
|
+
let extend = [
|
|
6983
7024
|
"select",
|
|
6984
7025
|
{
|
|
6985
7026
|
name,
|
|
@@ -6994,7 +7035,8 @@ function create_form_field(gobj, $form, prefix, field_desc, { tag, inputType, na
|
|
|
6994
7035
|
},
|
|
6995
7036
|
option
|
|
6996
7037
|
])
|
|
6997
|
-
]
|
|
7038
|
+
];
|
|
7039
|
+
$extend = createElement2(extend);
|
|
6998
7040
|
$control.appendChild($extend);
|
|
6999
7041
|
$extend.tom_select = new TomSelect($extend, {
|
|
7000
7042
|
allowEmptyOption: true,
|
|
@@ -7032,15 +7074,17 @@ function create_form_field(gobj, $form, prefix, field_desc, { tag, inputType, na
|
|
|
7032
7074
|
$extend = $wrapper.querySelector("input");
|
|
7033
7075
|
break;
|
|
7034
7076
|
}
|
|
7035
|
-
case "radio":
|
|
7036
|
-
|
|
7077
|
+
case "radio": {
|
|
7078
|
+
let elm = `
|
|
7037
7079
|
<label class="radio">
|
|
7038
7080
|
<input type="radio" name="${name}">
|
|
7039
7081
|
${t(options)}
|
|
7040
7082
|
</label>
|
|
7041
|
-
|
|
7083
|
+
`;
|
|
7084
|
+
$extend = createOneHtml(elm);
|
|
7042
7085
|
$control.appendChild($extend);
|
|
7043
7086
|
break;
|
|
7087
|
+
}
|
|
7044
7088
|
case "jsoneditor": {
|
|
7045
7089
|
let attrs = {
|
|
7046
7090
|
class: "jsoneditor" + (yui_is_dark() ? " jse-theme-dark" : ""),
|
|
@@ -7147,9 +7191,7 @@ function create_coordinates(gobj, attrs) {
|
|
|
7147
7191
|
case error.TIMEOUT:
|
|
7148
7192
|
errorMsg = t("timed out");
|
|
7149
7193
|
break;
|
|
7150
|
-
default:
|
|
7151
|
-
errorMsg = t("unknown error");
|
|
7152
|
-
break;
|
|
7194
|
+
default: errorMsg = t("unknown error");
|
|
7153
7195
|
}
|
|
7154
7196
|
$input.classList.add("is-danger");
|
|
7155
7197
|
let $h = $input.closest(".xcontrol").parentNode.querySelector(".help");
|
|
@@ -7164,7 +7206,7 @@ function create_coordinates(gobj, attrs) {
|
|
|
7164
7206
|
$h.style.display = "block";
|
|
7165
7207
|
}
|
|
7166
7208
|
}
|
|
7167
|
-
let
|
|
7209
|
+
let extend = [
|
|
7168
7210
|
"div",
|
|
7169
7211
|
{ class: "field is-flex is-align-items-center" },
|
|
7170
7212
|
[[
|
|
@@ -7191,7 +7233,8 @@ function create_coordinates(gobj, attrs) {
|
|
|
7191
7233
|
} }
|
|
7192
7234
|
]]
|
|
7193
7235
|
]]
|
|
7194
|
-
]
|
|
7236
|
+
];
|
|
7237
|
+
let $extend = createElement2(extend);
|
|
7195
7238
|
let $control = $extend.querySelector(".control");
|
|
7196
7239
|
attach_clear($control, $control.querySelector("input"));
|
|
7197
7240
|
return $extend;
|
|
@@ -7218,10 +7261,11 @@ function create_tabulator$1(gobj, $extend, name, template) {
|
|
|
7218
7261
|
tabulator_settings.columns = template2columns(gobj, columns, template, sub_elements);
|
|
7219
7262
|
if (sub_elements.length > 0) tabulator_settings.rowFormatter = function(row) {
|
|
7220
7263
|
for (let sub_element of sub_elements) {
|
|
7221
|
-
let
|
|
7264
|
+
let extend = ["div", {
|
|
7222
7265
|
class: "yui-tabulator-table-nested pl-6 is-bordered is-striped",
|
|
7223
7266
|
"name": sub_element.name
|
|
7224
|
-
}]
|
|
7267
|
+
}];
|
|
7268
|
+
let $extend = createElement2(extend);
|
|
7225
7269
|
$extend.tabulator = create_tabulator$1(gobj, $extend, sub_element.name, sub_element.template);
|
|
7226
7270
|
row.getElement().appendChild($extend);
|
|
7227
7271
|
}
|
|
@@ -7309,9 +7353,10 @@ function template2columns(gobj, columns, template, sub_elements) {
|
|
|
7309
7353
|
cellClick: function(evt, cell) {
|
|
7310
7354
|
evt.stopPropagation();
|
|
7311
7355
|
let $row = cell.getRow().getElement();
|
|
7356
|
+
let $extend = $row.querySelector(`[name="${field_desc.name}"]`);
|
|
7312
7357
|
gobj_send_event(gobj, "EV_ADD_TABLE_ROW", {
|
|
7313
7358
|
$row,
|
|
7314
|
-
$table: $
|
|
7359
|
+
$table: $extend,
|
|
7315
7360
|
record: {},
|
|
7316
7361
|
loading: false
|
|
7317
7362
|
}, gobj);
|
|
@@ -7326,9 +7371,7 @@ function template2columns(gobj, columns, template, sub_elements) {
|
|
|
7326
7371
|
case "object":
|
|
7327
7372
|
case "dict":
|
|
7328
7373
|
case "array":
|
|
7329
|
-
case "list":
|
|
7330
|
-
column.editorParams.values = field_desc.enum_list;
|
|
7331
|
-
break;
|
|
7374
|
+
case "list": column.editorParams.values = field_desc.enum_list;
|
|
7332
7375
|
}
|
|
7333
7376
|
break;
|
|
7334
7377
|
case "hook": break;
|
|
@@ -7373,18 +7416,12 @@ function template2columns(gobj, columns, template, sub_elements) {
|
|
|
7373
7416
|
verticalNavigation: "table",
|
|
7374
7417
|
elementAttributes: { title: "slide bar to choose option" }
|
|
7375
7418
|
};
|
|
7376
|
-
|
|
7377
|
-
case "string": break;
|
|
7378
|
-
case "integer": break;
|
|
7379
|
-
}
|
|
7419
|
+
field_desc.real_type;
|
|
7380
7420
|
break;
|
|
7381
7421
|
case "color":
|
|
7382
7422
|
column.editor = "input";
|
|
7383
7423
|
column.editorParams = {};
|
|
7384
|
-
|
|
7385
|
-
case "string": break;
|
|
7386
|
-
case "integer": break;
|
|
7387
|
-
}
|
|
7424
|
+
field_desc.real_type;
|
|
7388
7425
|
break;
|
|
7389
7426
|
case "email":
|
|
7390
7427
|
column.editor = "input";
|
|
@@ -7480,9 +7517,7 @@ function get_form_values(gobj, $form) {
|
|
|
7480
7517
|
const date = new Date($input.value);
|
|
7481
7518
|
value = Math.floor(date.getTime() / 1e3);
|
|
7482
7519
|
break;
|
|
7483
|
-
default:
|
|
7484
|
-
value = getInputValue($input);
|
|
7485
|
-
break;
|
|
7520
|
+
default: value = getInputValue($input);
|
|
7486
7521
|
}
|
|
7487
7522
|
break;
|
|
7488
7523
|
case "textarea":
|
|
@@ -7529,9 +7564,7 @@ function get_form_values(gobj, $form) {
|
|
|
7529
7564
|
if ($input.tagName !== "INPUT") $input = $input.querySelector("input");
|
|
7530
7565
|
value = getInputValue($input);
|
|
7531
7566
|
break;
|
|
7532
|
-
default:
|
|
7533
|
-
log_error(sprintf("%s: $form type unknown: '%s'", gobj_short_name(gobj), tag));
|
|
7534
|
-
break;
|
|
7567
|
+
default: log_error(sprintf("%s: $form type unknown: '%s'", gobj_short_name(gobj), tag));
|
|
7535
7568
|
}
|
|
7536
7569
|
value = form_value_2_treedb_value(gobj, field_desc, value);
|
|
7537
7570
|
let path;
|
|
@@ -7547,14 +7580,16 @@ function get_form_values(gobj, $form) {
|
|
|
7547
7580
|
function clear_data(gobj, $form) {
|
|
7548
7581
|
let pkey = gobj_read_str_attr(gobj, "pkey");
|
|
7549
7582
|
$form.querySelectorAll("input, select, textarea, .jsoneditor").forEach(($input) => {
|
|
7550
|
-
if ($input.name !== pkey)
|
|
7551
|
-
|
|
7552
|
-
|
|
7553
|
-
|
|
7554
|
-
|
|
7555
|
-
|
|
7556
|
-
|
|
7557
|
-
|
|
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
|
+
}
|
|
7558
7593
|
});
|
|
7559
7594
|
$form.querySelectorAll(".yui-tabulator-table").forEach(($table) => {
|
|
7560
7595
|
if ($table.tabulator.initialized) $table.tabulator.clearData();
|
|
@@ -7636,9 +7671,7 @@ function set_form_values(gobj, template, $form, record) {
|
|
|
7636
7671
|
case "color":
|
|
7637
7672
|
$input.value = convertColor(value);
|
|
7638
7673
|
break;
|
|
7639
|
-
default:
|
|
7640
|
-
$input.value = value;
|
|
7641
|
-
break;
|
|
7674
|
+
default: $input.value = value;
|
|
7642
7675
|
}
|
|
7643
7676
|
break;
|
|
7644
7677
|
case "textarea":
|
|
@@ -7669,9 +7702,7 @@ function set_form_values(gobj, template, $form, record) {
|
|
|
7669
7702
|
if ($input.tagName !== "INPUT") $input = $input.querySelector("input");
|
|
7670
7703
|
$input.value = value;
|
|
7671
7704
|
break;
|
|
7672
|
-
default:
|
|
7673
|
-
log_error(sprintf("%s: $form type unknown: '%s'", gobj_short_name(gobj), tag));
|
|
7674
|
-
break;
|
|
7705
|
+
default: log_error(sprintf("%s: $form type unknown: '%s'", gobj_short_name(gobj), tag));
|
|
7675
7706
|
}
|
|
7676
7707
|
refresh_clear($input);
|
|
7677
7708
|
});
|
|
@@ -7785,9 +7816,7 @@ function treedb_value_2_form_value(gobj, field_desc, value) {
|
|
|
7785
7816
|
}
|
|
7786
7817
|
value = `${longitude}, ${latitude}`;
|
|
7787
7818
|
break;
|
|
7788
|
-
default:
|
|
7789
|
-
log_error("treedb_value_2_form_value() type unknown: " + type);
|
|
7790
|
-
break;
|
|
7819
|
+
default: log_error("treedb_value_2_form_value() type unknown: " + type);
|
|
7791
7820
|
}
|
|
7792
7821
|
return value;
|
|
7793
7822
|
}
|
|
@@ -7831,9 +7860,7 @@ function form_value_2_treedb_value(gobj, field_desc, value) {
|
|
|
7831
7860
|
case "integer":
|
|
7832
7861
|
if (value && is_date(value)) value = value.getTime() / 1e3;
|
|
7833
7862
|
break;
|
|
7834
|
-
default:
|
|
7835
|
-
log_error("incompatible type for time: " + real_type);
|
|
7836
|
-
break;
|
|
7863
|
+
default: log_error("incompatible type for time: " + real_type);
|
|
7837
7864
|
}
|
|
7838
7865
|
break;
|
|
7839
7866
|
case "date":
|
|
@@ -7894,9 +7921,7 @@ function form_value_2_treedb_value(gobj, field_desc, value) {
|
|
|
7894
7921
|
"coordinates": [lnglat[0], lnglat[1]]
|
|
7895
7922
|
} };
|
|
7896
7923
|
break;
|
|
7897
|
-
default:
|
|
7898
|
-
log_error("form_value_2_treedb_value() type unknown: " + type);
|
|
7899
|
-
break;
|
|
7924
|
+
default: log_error("form_value_2_treedb_value() type unknown: " + type);
|
|
7900
7925
|
}
|
|
7901
7926
|
return value;
|
|
7902
7927
|
}
|
|
@@ -7933,7 +7958,8 @@ function ac_load_record(gobj, event, kw, src) {
|
|
|
7933
7958
|
function ac_save_record(gobj, event, kw, src) {
|
|
7934
7959
|
let $form = gobj_read_attr(gobj, "$container").querySelector("form");
|
|
7935
7960
|
if (validate_form(gobj, $form)) {
|
|
7936
|
-
|
|
7961
|
+
let values = get_form_values(gobj, $form);
|
|
7962
|
+
gobj_publish_event(gobj, "EV_SAVE_RECORD", values);
|
|
7937
7963
|
set_changed_stated(gobj, false);
|
|
7938
7964
|
} else {
|
|
7939
7965
|
kw.abort_close = true;
|
|
@@ -8139,7 +8165,7 @@ function create_gclass$13(gclass_name) {
|
|
|
8139
8165
|
null
|
|
8140
8166
|
]
|
|
8141
8167
|
]]];
|
|
8142
|
-
|
|
8168
|
+
const event_types = [
|
|
8143
8169
|
["EV_LOAD_RECORD", 0],
|
|
8144
8170
|
["EV_SAVE_RECORD", event_flag_t.EVF_OUTPUT_EVENT],
|
|
8145
8171
|
["EV_UNDO_RECORD", 0],
|
|
@@ -8155,7 +8181,8 @@ function create_gclass$13(gclass_name) {
|
|
|
8155
8181
|
["EV_SHOW", 0],
|
|
8156
8182
|
["EV_HIDE", 0],
|
|
8157
8183
|
["EV_TIMEOUT", 0]
|
|
8158
|
-
]
|
|
8184
|
+
];
|
|
8185
|
+
__gclass__$13 = gclass_create(gclass_name, event_types, states, gmt$13, 0, attrs_table$13, PRIVATE_DATA$13, 0, 0, 0, 0);
|
|
8159
8186
|
if (!__gclass__$13) return -1;
|
|
8160
8187
|
return 0;
|
|
8161
8188
|
}
|
|
@@ -8754,14 +8781,16 @@ function xtouchStart(gobj, e) {
|
|
|
8754
8781
|
function ac_edit_map(gobj, event, kw, src) {
|
|
8755
8782
|
let priv = gobj.priv;
|
|
8756
8783
|
const map = priv.xmap;
|
|
8757
|
-
if (kw_has_key(kw, "enable_moving_markers"))
|
|
8758
|
-
|
|
8759
|
-
|
|
8760
|
-
|
|
8761
|
-
|
|
8762
|
-
|
|
8763
|
-
|
|
8764
|
-
|
|
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
|
+
}
|
|
8765
8794
|
}
|
|
8766
8795
|
return 0;
|
|
8767
8796
|
}
|
|
@@ -9004,14 +9033,15 @@ function build_ui$10(gobj) {
|
|
|
9004
9033
|
gobj_write_bool_attr(gobj, "$container", $container);
|
|
9005
9034
|
gobj_write_bool_attr(gobj, "own_container", true);
|
|
9006
9035
|
}
|
|
9007
|
-
let
|
|
9036
|
+
let uPlot_options = {
|
|
9008
9037
|
title: gobj_read_attr(gobj, "title"),
|
|
9009
9038
|
width: gobj_read_attr(gobj, "width"),
|
|
9010
9039
|
height: gobj_read_attr(gobj, "height"),
|
|
9011
9040
|
series: gobj_read_attr(gobj, "series"),
|
|
9012
9041
|
axes: gobj_read_attr(gobj, "axes"),
|
|
9013
9042
|
scales: gobj_read_attr(gobj, "scales")
|
|
9014
|
-
}
|
|
9043
|
+
};
|
|
9044
|
+
let uplot = new uPlot(uPlot_options, gobj_read_attr(gobj, "data"), $container);
|
|
9015
9045
|
gobj_write_attr(gobj, "uplot", uplot);
|
|
9016
9046
|
let fixed_height = gobj_read_attr(gobj, "height");
|
|
9017
9047
|
function fit_to_container() {
|
|
@@ -9066,11 +9096,13 @@ function ac_load_data$2(gobj, event, kw, src) {
|
|
|
9066
9096
|
for (let idx = 1; idx < uplot.series.length; idx++) {
|
|
9067
9097
|
let serie = uplot.series[idx];
|
|
9068
9098
|
let value = kw[i][serie.id];
|
|
9069
|
-
if (is_string(value))
|
|
9070
|
-
|
|
9071
|
-
|
|
9072
|
-
|
|
9073
|
-
|
|
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
|
+
}
|
|
9074
9106
|
}
|
|
9075
9107
|
data[idx].push(value);
|
|
9076
9108
|
}
|
|
@@ -9546,6 +9578,7 @@ function mt_destroy$10(gobj) {
|
|
|
9546
9578
|
************************************************************/
|
|
9547
9579
|
function build_ui$9(gobj) {
|
|
9548
9580
|
let priv = gobj.priv;
|
|
9581
|
+
let $toolbar = make_toolbar$3(gobj);
|
|
9549
9582
|
let $container = createElement2([
|
|
9550
9583
|
"div",
|
|
9551
9584
|
{
|
|
@@ -9555,7 +9588,7 @@ function build_ui$9(gobj) {
|
|
|
9555
9588
|
[[
|
|
9556
9589
|
"div",
|
|
9557
9590
|
{ class: "is-flex-grow-0 is-flex toolbar_yui_json_graph" },
|
|
9558
|
-
|
|
9591
|
+
$toolbar
|
|
9559
9592
|
], [
|
|
9560
9593
|
"div",
|
|
9561
9594
|
{
|
|
@@ -9738,9 +9771,7 @@ function build_cell_html(key, value, type, dark) {
|
|
|
9738
9771
|
case "dict":
|
|
9739
9772
|
display_value = `{${json_object_size(value)}}`;
|
|
9740
9773
|
break;
|
|
9741
|
-
default:
|
|
9742
|
-
display_value = String(value);
|
|
9743
|
-
break;
|
|
9774
|
+
default: display_value = String(value);
|
|
9744
9775
|
}
|
|
9745
9776
|
return `<span style="color:${key_color}">• ${escapeHtml(String(key))}: </span><span style="color:${color}">${display_value}</span>`;
|
|
9746
9777
|
}
|
|
@@ -10185,7 +10216,7 @@ function create_gclass$10(gclass_name) {
|
|
|
10185
10216
|
null
|
|
10186
10217
|
]
|
|
10187
10218
|
]]];
|
|
10188
|
-
|
|
10219
|
+
const event_types = [
|
|
10189
10220
|
["EV_LOAD_DATA", 0],
|
|
10190
10221
|
["EV_REFRESH", 0],
|
|
10191
10222
|
["EV_THEME", 0],
|
|
@@ -10198,7 +10229,8 @@ function create_gclass$10(gclass_name) {
|
|
|
10198
10229
|
["EV_SHOW", 0],
|
|
10199
10230
|
["EV_HIDE", 0],
|
|
10200
10231
|
["EV_JSON_ITEM_CLICKED", event_flag_t.EVF_OUTPUT_EVENT]
|
|
10201
|
-
]
|
|
10232
|
+
];
|
|
10233
|
+
__gclass__$10 = gclass_create(gclass_name, event_types, states, gmt$10, 0, attrs_table$10, PRIVATE_DATA$10, 0, 0, 0, 0);
|
|
10202
10234
|
if (!__gclass__$10) return -1;
|
|
10203
10235
|
return 0;
|
|
10204
10236
|
}
|
|
@@ -10448,6 +10480,7 @@ function mt_destroy$9(gobj) {
|
|
|
10448
10480
|
************************************************************/
|
|
10449
10481
|
function build_ui$8(gobj) {
|
|
10450
10482
|
let priv = gobj.priv;
|
|
10483
|
+
let $toolbar = make_toolbar$2(gobj);
|
|
10451
10484
|
let $container = createElement2([
|
|
10452
10485
|
"div",
|
|
10453
10486
|
{
|
|
@@ -10457,7 +10490,7 @@ function build_ui$8(gobj) {
|
|
|
10457
10490
|
[[
|
|
10458
10491
|
"div",
|
|
10459
10492
|
{ class: "JSON_TOOLBAR is-flex-grow-0" },
|
|
10460
|
-
[
|
|
10493
|
+
[$toolbar]
|
|
10461
10494
|
], [
|
|
10462
10495
|
"div",
|
|
10463
10496
|
{
|
|
@@ -10814,9 +10847,7 @@ function leaf_row(key, value, depth) {
|
|
|
10814
10847
|
case "boolean":
|
|
10815
10848
|
text = value ? "true" : "false";
|
|
10816
10849
|
break;
|
|
10817
|
-
default:
|
|
10818
|
-
text = String(value);
|
|
10819
|
-
break;
|
|
10850
|
+
default: text = String(value);
|
|
10820
10851
|
}
|
|
10821
10852
|
let body = [];
|
|
10822
10853
|
if (key !== null && key !== "") {
|
|
@@ -11164,7 +11195,7 @@ function create_gclass$9(gclass_name) {
|
|
|
11164
11195
|
null
|
|
11165
11196
|
]
|
|
11166
11197
|
]]];
|
|
11167
|
-
|
|
11198
|
+
const event_types = [
|
|
11168
11199
|
["EV_SET_JSON", 0],
|
|
11169
11200
|
["EV_SUBTREE_LOADED", 0],
|
|
11170
11201
|
["EV_SUBTREE_ERROR", 0],
|
|
@@ -11179,7 +11210,8 @@ function create_gclass$9(gclass_name) {
|
|
|
11179
11210
|
["EV_SHOW", 0],
|
|
11180
11211
|
["EV_HIDE", 0],
|
|
11181
11212
|
["EV_EXPAND_PATH", event_flag_t.EVF_OUTPUT_EVENT | event_flag_t.EVF_NO_WARN_SUBS]
|
|
11182
|
-
]
|
|
11213
|
+
];
|
|
11214
|
+
__gclass__$9 = gclass_create(gclass_name, event_types, states, gmt$9, 0, attrs_table$9, PRIVATE_DATA$9, 0, 0, 0, 0);
|
|
11183
11215
|
if (!__gclass__$9) return -1;
|
|
11184
11216
|
return 0;
|
|
11185
11217
|
}
|
|
@@ -11187,6 +11219,7 @@ function create_gclass$9(gclass_name) {
|
|
|
11187
11219
|
* Register GClass
|
|
11188
11220
|
***************************************************************/
|
|
11189
11221
|
function register_c_yui_json() {
|
|
11222
|
+
if (gclass_find_by_name(GCLASS_NAME$9, false)) return 0;
|
|
11190
11223
|
return create_gclass$9(GCLASS_NAME$9);
|
|
11191
11224
|
}
|
|
11192
11225
|
//#endregion
|
|
@@ -11477,6 +11510,7 @@ function mt_destroy$8(gobj) {
|
|
|
11477
11510
|
************************************************************/
|
|
11478
11511
|
function build_ui$7(gobj) {
|
|
11479
11512
|
let priv = gobj.priv;
|
|
11513
|
+
let $toolbar = make_toolbar$1(gobj);
|
|
11480
11514
|
let $container = createElement2([
|
|
11481
11515
|
"div",
|
|
11482
11516
|
{
|
|
@@ -11486,7 +11520,7 @@ function build_ui$7(gobj) {
|
|
|
11486
11520
|
[[
|
|
11487
11521
|
"div",
|
|
11488
11522
|
{ class: "is-flex-grow-0 is-flex toolbar_yui_gobj_tree" },
|
|
11489
|
-
|
|
11523
|
+
$toolbar
|
|
11490
11524
|
], [
|
|
11491
11525
|
"div",
|
|
11492
11526
|
{
|
|
@@ -13455,7 +13489,8 @@ function render_tabs(gobj, items) {
|
|
|
13455
13489
|
]);
|
|
13456
13490
|
}
|
|
13457
13491
|
function render_cards(gobj, items) {
|
|
13458
|
-
|
|
13492
|
+
let show_label = gobj_read_attr(gobj, "show_label");
|
|
13493
|
+
return createElement2(cards_grid_descriptor(items, show_label));
|
|
13459
13494
|
}
|
|
13460
13495
|
/************************************************************
|
|
13461
13496
|
* "backbar": a single "← <section>" link back to the section
|
|
@@ -13922,13 +13957,14 @@ function create_gclass$6(gclass_name) {
|
|
|
13922
13957
|
ac_set_items,
|
|
13923
13958
|
null
|
|
13924
13959
|
]]]];
|
|
13925
|
-
|
|
13960
|
+
const event_types = [
|
|
13926
13961
|
["EV_ROUTE_CHANGED", 0],
|
|
13927
13962
|
["EV_SET_ITEMS", 0],
|
|
13928
13963
|
["EV_NAV_CLICKED", event_flag_t.EVF_OUTPUT_EVENT | event_flag_t.EVF_PUBLIC_EVENT],
|
|
13929
13964
|
["EV_NAV_ITEM_CLOSE", event_flag_t.EVF_OUTPUT_EVENT | event_flag_t.EVF_PUBLIC_EVENT],
|
|
13930
13965
|
["EV_DRAWER_CLOSE_REQUESTED", event_flag_t.EVF_OUTPUT_EVENT | event_flag_t.EVF_PUBLIC_EVENT]
|
|
13931
|
-
]
|
|
13966
|
+
];
|
|
13967
|
+
__gclass__$6 = gclass_create(gclass_name, event_types, states, gmt$6, 0, attrs_table$6, PRIVATE_DATA$6, 0, 0, 0, 0);
|
|
13932
13968
|
if (!__gclass__$6) return -1;
|
|
13933
13969
|
return 0;
|
|
13934
13970
|
}
|
|
@@ -14094,20 +14130,21 @@ function build_body(shell, t) {
|
|
|
14094
14130
|
kind: "group",
|
|
14095
14131
|
children: map.other
|
|
14096
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
|
+
};
|
|
14097
14141
|
let $tree = createElement2([
|
|
14098
14142
|
"div",
|
|
14099
14143
|
{ class: "ROUTEMAP_TREE" },
|
|
14100
14144
|
[createElement2([
|
|
14101
14145
|
"ul",
|
|
14102
14146
|
{ class: "ROUTEMAP_UL ROUTEMAP_ROOT" },
|
|
14103
|
-
[render_node(
|
|
14104
|
-
label: map.brand.label || "app",
|
|
14105
|
-
icon: "",
|
|
14106
|
-
route: map.brand.route || "",
|
|
14107
|
-
event: "",
|
|
14108
|
-
current: !!map.brand.current,
|
|
14109
|
-
children
|
|
14110
|
-
})]
|
|
14147
|
+
[render_node(root)]
|
|
14111
14148
|
])]
|
|
14112
14149
|
]);
|
|
14113
14150
|
let $search = createElement2(["input", {
|
|
@@ -14294,8 +14331,9 @@ function yui_shell_show_route_map(shell, opts) {
|
|
|
14294
14331
|
if (gclass_find_by_name("C_YUI_WINDOW") !== null) {
|
|
14295
14332
|
let win_ref = { gobj: null };
|
|
14296
14333
|
let $body = build_body(shell, t);
|
|
14334
|
+
let $parent = yui_shell_popup_layer(shell) || typeof document !== "undefined" && document.getElementById("top-layer") || null;
|
|
14297
14335
|
let win = gobj_create_service(WIN_NAME$1, "C_YUI_WINDOW", {
|
|
14298
|
-
$parent
|
|
14336
|
+
$parent,
|
|
14299
14337
|
subscriber: null,
|
|
14300
14338
|
modal: false,
|
|
14301
14339
|
showMax: true,
|
|
@@ -14709,7 +14747,8 @@ function add_tab(gobj, gobj2, id, text, icon) {
|
|
|
14709
14747
|
************************************************************/
|
|
14710
14748
|
function select_topic_by_id(gobj, id) {
|
|
14711
14749
|
gobj_send_event(gobj, "EV_SHOW", { href: id }, gobj);
|
|
14712
|
-
|
|
14750
|
+
let topic = id.indexOf("?") >= 0 ? id.split("?")[1] : id;
|
|
14751
|
+
gobj_publish_event(gobj, "EV_TOPIC_SELECTED", { topic });
|
|
14713
14752
|
}
|
|
14714
14753
|
/************************************************************
|
|
14715
14754
|
* One icon-action anchor of a topic card: a REAL hash link
|
|
@@ -15157,13 +15196,14 @@ function process_treedb_descs$1(gobj) {
|
|
|
15157
15196
|
gobj_start(gobj_topic_form);
|
|
15158
15197
|
}
|
|
15159
15198
|
let href = gobj_read_str_attr(gobj, "last_selection");
|
|
15160
|
-
if (gobj_read_bool_attr(gobj, "with_cards_landing"))
|
|
15161
|
-
|
|
15162
|
-
|
|
15163
|
-
|
|
15164
|
-
|
|
15165
|
-
|
|
15166
|
-
|
|
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 {
|
|
15167
15207
|
if (!href) try {
|
|
15168
15208
|
let topic = window.localStorage.getItem(`yui_treedb_topics:${gobj_name(gobj)}`);
|
|
15169
15209
|
if (topic) href = `${gobj_name(gobj)}?${topic}`;
|
|
@@ -15505,7 +15545,10 @@ function ac_mt_command_answer$1(gobj, event, kw, src) {
|
|
|
15505
15545
|
break;
|
|
15506
15546
|
case "nodes":
|
|
15507
15547
|
let topic_name = kw_get_str(gobj, kw_command, "topic_name", "", kw_flag_t.KW_REQUIRED);
|
|
15508
|
-
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
|
+
}
|
|
15509
15552
|
break;
|
|
15510
15553
|
case "create-node":
|
|
15511
15554
|
case "update-node":
|
|
@@ -15671,7 +15714,10 @@ function ac_treedb_node_created$1(gobj, event, kw, src) {
|
|
|
15671
15714
|
let treedb_name = kw_get_str(gobj, kw, "treedb_name", "", 0);
|
|
15672
15715
|
let topic_name = kw_get_str(gobj, kw, "topic_name", "", 0);
|
|
15673
15716
|
let node = kw_get_dict_value(gobj, kw, "node", null, 0);
|
|
15674
|
-
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
|
+
}
|
|
15675
15721
|
return 0;
|
|
15676
15722
|
}
|
|
15677
15723
|
/********************************************
|
|
@@ -15681,7 +15727,10 @@ function ac_treedb_node_updated$1(gobj, event, kw, src) {
|
|
|
15681
15727
|
let treedb_name = kw_get_str(gobj, kw, "treedb_name", "", 0);
|
|
15682
15728
|
let topic_name = kw_get_str(gobj, kw, "topic_name", "", 0);
|
|
15683
15729
|
let node = kw_get_dict_value(gobj, kw, "node", null, 0);
|
|
15684
|
-
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
|
+
}
|
|
15685
15734
|
return 0;
|
|
15686
15735
|
}
|
|
15687
15736
|
/********************************************
|
|
@@ -15691,7 +15740,10 @@ function ac_treedb_node_deleted$1(gobj, event, kw, src) {
|
|
|
15691
15740
|
let treedb_name = kw_get_str(gobj, kw, "treedb_name", "", 0);
|
|
15692
15741
|
let topic_name = kw_get_str(gobj, kw, "topic_name", "", 0);
|
|
15693
15742
|
let node = kw_get_dict_value(gobj, kw, "node", null, 0);
|
|
15694
|
-
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
|
+
}
|
|
15695
15747
|
return 0;
|
|
15696
15748
|
}
|
|
15697
15749
|
/********************************************
|
|
@@ -15897,7 +15949,7 @@ function create_gclass$5(gclass_name) {
|
|
|
15897
15949
|
null
|
|
15898
15950
|
]
|
|
15899
15951
|
]]];
|
|
15900
|
-
|
|
15952
|
+
const event_types = [
|
|
15901
15953
|
["EV_MT_COMMAND_ANSWER", event_flag_t.EVF_PUBLIC_EVENT],
|
|
15902
15954
|
["EV_TREEDB_NODE_CREATED", event_flag_t.EVF_PUBLIC_EVENT],
|
|
15903
15955
|
["EV_TREEDB_NODE_UPDATED", event_flag_t.EVF_PUBLIC_EVENT],
|
|
@@ -15918,7 +15970,8 @@ function create_gclass$5(gclass_name) {
|
|
|
15918
15970
|
["EV_BACK_TO_TOPICS", 0],
|
|
15919
15971
|
["EV_TRANSPORT_STATE", 0],
|
|
15920
15972
|
["EV_TOPIC_SELECTED", event_flag_t.EVF_OUTPUT_EVENT | event_flag_t.EVF_NO_WARN_SUBS]
|
|
15921
|
-
]
|
|
15973
|
+
];
|
|
15974
|
+
__gclass__$5 = gclass_create(gclass_name, event_types, states, gmt$5, 0, attrs_table$5, PRIVATE_DATA$5, 0, 0, 0, 0);
|
|
15922
15975
|
if (!__gclass__$5) return -1;
|
|
15923
15976
|
return 0;
|
|
15924
15977
|
}
|
|
@@ -16048,6 +16101,7 @@ var attrs_table$4 = [
|
|
|
16048
16101
|
SDATA(data_type_t.DTP_BOOLEAN, "with_paste_button", 0, true, "Button toolbar PASTE"),
|
|
16049
16102
|
SDATA(data_type_t.DTP_BOOLEAN, "with_refresh_button", 0, true, "Button toolbar REFRESH"),
|
|
16050
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)"),
|
|
16051
16105
|
SDATA(data_type_t.DTP_BOOLEAN, "with_in_row_edit_icons", 0, true, "Add a last column with internal EDIT/DELETE icon"),
|
|
16052
16106
|
SDATA(data_type_t.DTP_BOOLEAN, "editable", 0, false, "Edit state"),
|
|
16053
16107
|
SDATA(data_type_t.DTP_BOOLEAN, "with_checkbox", 0, true, "Auxiliary first column to select rows"),
|
|
@@ -16081,7 +16135,9 @@ var PRIVATE_DATA$4 = {
|
|
|
16081
16135
|
topic_name: "",
|
|
16082
16136
|
tabulator: null,
|
|
16083
16137
|
form: null,
|
|
16084
|
-
form_modal: null
|
|
16138
|
+
form_modal: null,
|
|
16139
|
+
schema_gobj: null,
|
|
16140
|
+
schema_modal: null
|
|
16085
16141
|
};
|
|
16086
16142
|
var __gclass__$4 = null;
|
|
16087
16143
|
function popup_mount_layer(gobj) {
|
|
@@ -16120,6 +16176,7 @@ function mt_stop$4(gobj) {
|
|
|
16120
16176
|
let shell = yui_shell_of(gobj);
|
|
16121
16177
|
if (shell) gobj_unsubscribe_event(shell, "EV_LANGUAGE_CHANGED", {}, gobj);
|
|
16122
16178
|
close_form_dialog(gobj);
|
|
16179
|
+
close_schema_dialog(gobj);
|
|
16123
16180
|
table__destroy(gobj);
|
|
16124
16181
|
}
|
|
16125
16182
|
/***************************************************************
|
|
@@ -16127,6 +16184,7 @@ function mt_stop$4(gobj) {
|
|
|
16127
16184
|
***************************************************************/
|
|
16128
16185
|
function mt_destroy$4(gobj) {
|
|
16129
16186
|
close_form_dialog(gobj);
|
|
16187
|
+
close_schema_dialog(gobj);
|
|
16130
16188
|
destroy_ui$1(gobj);
|
|
16131
16189
|
}
|
|
16132
16190
|
/************************************************************
|
|
@@ -16182,7 +16240,8 @@ function cmd_get_topic_data(gobj, cmd, kw, src) {
|
|
|
16182
16240
|
async function readClipboard(gobj) {
|
|
16183
16241
|
try {
|
|
16184
16242
|
const text = await navigator.clipboard.readText();
|
|
16185
|
-
|
|
16243
|
+
let kw = JSON.parse(text);
|
|
16244
|
+
gobj_send_event(gobj, "EV_PASTE_ROWS", kw, gobj);
|
|
16186
16245
|
} catch (error) {
|
|
16187
16246
|
log_error(`Failed to read clipboard contents: ${error}`);
|
|
16188
16247
|
}
|
|
@@ -16328,7 +16387,9 @@ function build_ui$4(gobj) {
|
|
|
16328
16387
|
let toolbar_id = gobj_read_str_attr(gobj, "toolbar_id");
|
|
16329
16388
|
let $view_toolbar = createElement2(["div", { class: "TREEDB_TABLE_TOOLS is-flex is-align-items-center" }]);
|
|
16330
16389
|
let with_refresh_button = gobj_read_bool_attr(gobj, "with_refresh_button");
|
|
16331
|
-
|
|
16390
|
+
let with_search_button = gobj_read_bool_attr(gobj, "with_search_button");
|
|
16391
|
+
let with_schema_button = gobj_read_bool_attr(gobj, "with_schema_button");
|
|
16392
|
+
if (with_search_button) {
|
|
16332
16393
|
let search_id = `${toolbar_id}_search`;
|
|
16333
16394
|
let $search_box = createElement2([
|
|
16334
16395
|
"div",
|
|
@@ -16386,6 +16447,33 @@ function build_ui$4(gobj) {
|
|
|
16386
16447
|
]);
|
|
16387
16448
|
$view_toolbar.appendChild($refresh);
|
|
16388
16449
|
}
|
|
16450
|
+
if (with_schema_button) {
|
|
16451
|
+
let $schema = createElement2([
|
|
16452
|
+
"button",
|
|
16453
|
+
{
|
|
16454
|
+
class: "TREEDB_TABLE_SCHEMA button mr-1",
|
|
16455
|
+
title: t("schema"),
|
|
16456
|
+
"data-i18n-title": "schema",
|
|
16457
|
+
"aria-label": t("schema"),
|
|
16458
|
+
"data-i18n-aria-label": "schema"
|
|
16459
|
+
},
|
|
16460
|
+
[["i", { class: "yi-hexagon-nodes" }], [
|
|
16461
|
+
"span",
|
|
16462
|
+
{
|
|
16463
|
+
class: "is-hidden-mobile",
|
|
16464
|
+
i18n: "schema",
|
|
16465
|
+
style: "padding-left:5px;"
|
|
16466
|
+
},
|
|
16467
|
+
"schema"
|
|
16468
|
+
]],
|
|
16469
|
+
{ "click": (event) => {
|
|
16470
|
+
event.stopPropagation();
|
|
16471
|
+
gobj_send_event(gobj, "EV_SHOW_SCHEMA", {}, gobj);
|
|
16472
|
+
} }
|
|
16473
|
+
]);
|
|
16474
|
+
$view_toolbar.appendChild($schema);
|
|
16475
|
+
}
|
|
16476
|
+
let table_id = gobj_read_str_attr(gobj, "table_id");
|
|
16389
16477
|
let $container = createElement2([
|
|
16390
16478
|
"div",
|
|
16391
16479
|
{
|
|
@@ -16396,7 +16484,7 @@ function build_ui$4(gobj) {
|
|
|
16396
16484
|
class: "TREEDB_TABLE_TOOLBAR toolbar_tabulator_table m-1",
|
|
16397
16485
|
style: "display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap;"
|
|
16398
16486
|
}], ["div", {
|
|
16399
|
-
id: `${
|
|
16487
|
+
id: `${table_id}`,
|
|
16400
16488
|
style: "margin-top:0px !important;"
|
|
16401
16489
|
}]]
|
|
16402
16490
|
]);
|
|
@@ -16439,7 +16527,8 @@ function destroy_ui$1(gobj) {
|
|
|
16439
16527
|
* columns); leave the rest on the flat shared key.
|
|
16440
16528
|
******************************************************************/
|
|
16441
16529
|
function col_label(col, topic_name) {
|
|
16442
|
-
|
|
16530
|
+
let keys = topic_name ? [topic_name + "." + col.id, col.id] : [col.id];
|
|
16531
|
+
return t(keys, { defaultValue: col.header || col.id });
|
|
16443
16532
|
}
|
|
16444
16533
|
/******************************************************************
|
|
16445
16534
|
* Column-title formatter: render the header as a span carrying
|
|
@@ -16565,7 +16654,6 @@ function create_tabulator(gobj) {
|
|
|
16565
16654
|
case "real":
|
|
16566
16655
|
hozAlign = "right";
|
|
16567
16656
|
sorter = "number";
|
|
16568
|
-
break;
|
|
16569
16657
|
}
|
|
16570
16658
|
let colDef = {
|
|
16571
16659
|
title: col_label(col, gobj_read_str_attr(gobj, "topic_name")),
|
|
@@ -16710,9 +16798,7 @@ function transform__treedb_value_2_table_value(gobj, col, value, row, field) {
|
|
|
16710
16798
|
case "object":
|
|
16711
16799
|
case "dict":
|
|
16712
16800
|
case "array":
|
|
16713
|
-
case "list":
|
|
16714
|
-
value = JSON.stringify(value);
|
|
16715
|
-
break;
|
|
16801
|
+
case "list": value = JSON.stringify(value);
|
|
16716
16802
|
}
|
|
16717
16803
|
break;
|
|
16718
16804
|
case "hook":
|
|
@@ -16729,14 +16815,16 @@ function transform__treedb_value_2_table_value(gobj, col, value, row, field) {
|
|
|
16729
16815
|
break;
|
|
16730
16816
|
case "fkey":
|
|
16731
16817
|
let new_value = [];
|
|
16732
|
-
if (value)
|
|
16733
|
-
|
|
16734
|
-
|
|
16735
|
-
|
|
16736
|
-
let
|
|
16737
|
-
|
|
16818
|
+
if (value) {
|
|
16819
|
+
if (is_string(value)) {
|
|
16820
|
+
let fkey = treedb_decoder_fkey(col, value);
|
|
16821
|
+
if (fkey) new_value.push(fkey.id);
|
|
16822
|
+
} else if (is_array(value)) for (let i = 0; i < value.length; i++) {
|
|
16823
|
+
let fkey = treedb_decoder_fkey(col, value[i]);
|
|
16824
|
+
if (fkey) new_value.push(fkey.id);
|
|
16825
|
+
}
|
|
16826
|
+
else log_error("fkey type unsupported: " + JSON.stringify(value));
|
|
16738
16827
|
}
|
|
16739
|
-
else log_error("fkey type unsupported: " + JSON.stringify(value));
|
|
16740
16828
|
value = new_value.join(", ");
|
|
16741
16829
|
break;
|
|
16742
16830
|
case "now":
|
|
@@ -16757,14 +16845,11 @@ function transform__treedb_value_2_table_value(gobj, col, value, row, field) {
|
|
|
16757
16845
|
second: "2-digit",
|
|
16758
16846
|
hour12: true
|
|
16759
16847
|
}).format(value) + "</span>";
|
|
16760
|
-
break;
|
|
16761
16848
|
}
|
|
16762
16849
|
break;
|
|
16763
16850
|
case "color": break;
|
|
16764
16851
|
case "image": break;
|
|
16765
|
-
default:
|
|
16766
|
-
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}`);
|
|
16767
|
-
break;
|
|
16852
|
+
default: log_error(`transform__treedb_value_2_table_value() unhandled type '${field_desc.type}' (real_type='${field_desc.real_type}') for field '${field}', topic ${priv.topic_name}`);
|
|
16768
16853
|
}
|
|
16769
16854
|
if (value !== null && value !== void 0 && typeof value === "object" && !(value instanceof Node)) {
|
|
16770
16855
|
log_error(`transform__treedb_value_2_table_value() unexpected object value for field '${field}' (type='${field_desc.type}', real_type='${field_desc.real_type}'): ${JSON.stringify(value)}, topic ${priv.topic_name}`);
|
|
@@ -16932,6 +17017,83 @@ function close_form_dialog(gobj) {
|
|
|
16932
17017
|
teardown_form_child(gobj);
|
|
16933
17018
|
}
|
|
16934
17019
|
/************************************************************
|
|
17020
|
+
* Show the topic's SCHEMA: its `desc` — pkey, cols, types,
|
|
17021
|
+
* flags and fkey targets — in the standardized adaptive
|
|
17022
|
+
* dialog, rendered by a C_YUI_JSON child. A viewer and not a
|
|
17023
|
+
* <pre> dump because a forty-column topic is only readable
|
|
17024
|
+
* collapsed and searchable.
|
|
17025
|
+
*
|
|
17026
|
+
* Read-only and offline: the desc is already in this gobj,
|
|
17027
|
+
* so no command is issued and nothing can be edited here.
|
|
17028
|
+
************************************************************/
|
|
17029
|
+
function open_schema_dialog(gobj) {
|
|
17030
|
+
close_schema_dialog(gobj);
|
|
17031
|
+
let priv = gobj.priv;
|
|
17032
|
+
let desc = gobj_read_attr(gobj, "desc");
|
|
17033
|
+
if (!desc) {
|
|
17034
|
+
log_error(`${gobj_short_name(gobj)}: no desc, no schema to show`);
|
|
17035
|
+
return;
|
|
17036
|
+
}
|
|
17037
|
+
let shell = yui_shell_of(gobj);
|
|
17038
|
+
if (!shell) {
|
|
17039
|
+
log_error(`${gobj_short_name(gobj)}: no shell, cannot open the schema view`);
|
|
17040
|
+
return;
|
|
17041
|
+
}
|
|
17042
|
+
let json_view = gobj_create_pure_child("schema_" + clean_name(gobj_name(gobj)), "C_YUI_JSON", {}, gobj);
|
|
17043
|
+
if (!json_view) {
|
|
17044
|
+
log_error(`${gobj_short_name(gobj)}: cannot create the schema viewer`);
|
|
17045
|
+
return;
|
|
17046
|
+
}
|
|
17047
|
+
priv.schema_gobj = json_view;
|
|
17048
|
+
gobj_start(json_view);
|
|
17049
|
+
let $box = gobj_read_attr(json_view, "$container");
|
|
17050
|
+
if (!$box) {
|
|
17051
|
+
log_error(`${gobj_short_name(gobj)}: the schema viewer built no $container`);
|
|
17052
|
+
teardown_schema_child(gobj);
|
|
17053
|
+
return;
|
|
17054
|
+
}
|
|
17055
|
+
priv.schema_modal = yui_shell_show_modal(shell, $box, {
|
|
17056
|
+
dialog: true,
|
|
17057
|
+
logical_class: "TREEDB_SCHEMA_SHEET",
|
|
17058
|
+
title_prefix: gobj_read_str_attr(gobj, "topic_name"),
|
|
17059
|
+
title: "schema",
|
|
17060
|
+
t,
|
|
17061
|
+
on_close: function() {
|
|
17062
|
+
teardown_schema_child(gobj);
|
|
17063
|
+
}
|
|
17064
|
+
});
|
|
17065
|
+
gobj_send_event(json_view, "EV_SET_JSON", { json: desc }, gobj);
|
|
17066
|
+
}
|
|
17067
|
+
/************************************************************
|
|
17068
|
+
* Destroy the hosted C_YUI_JSON child. Called from the
|
|
17069
|
+
* schema modal's on_close — the shell has already removed
|
|
17070
|
+
* the dialog DOM and retired its Escape / history entries.
|
|
17071
|
+
************************************************************/
|
|
17072
|
+
function teardown_schema_child(gobj) {
|
|
17073
|
+
let priv = gobj.priv;
|
|
17074
|
+
if (priv.schema_gobj) {
|
|
17075
|
+
if (gobj_is_running(priv.schema_gobj)) gobj_stop(priv.schema_gobj);
|
|
17076
|
+
gobj_destroy(priv.schema_gobj);
|
|
17077
|
+
priv.schema_gobj = null;
|
|
17078
|
+
}
|
|
17079
|
+
priv.schema_modal = null;
|
|
17080
|
+
}
|
|
17081
|
+
/************************************************************
|
|
17082
|
+
* Close the schema dialog (teardown, or a second open).
|
|
17083
|
+
* Closing the modal runs its on_close, which tears the
|
|
17084
|
+
* viewer child down.
|
|
17085
|
+
************************************************************/
|
|
17086
|
+
function close_schema_dialog(gobj) {
|
|
17087
|
+
let priv = gobj.priv;
|
|
17088
|
+
if (priv.schema_modal) {
|
|
17089
|
+
let modal = priv.schema_modal;
|
|
17090
|
+
priv.schema_modal = null;
|
|
17091
|
+
modal.close();
|
|
17092
|
+
return;
|
|
17093
|
+
}
|
|
17094
|
+
teardown_schema_child(gobj);
|
|
17095
|
+
}
|
|
17096
|
+
/************************************************************
|
|
16935
17097
|
* True if the topic's pkey col carries the "rowid" flag.
|
|
16936
17098
|
************************************************************/
|
|
16937
17099
|
function pkey_is_rowid(gobj) {
|
|
@@ -17045,16 +17207,16 @@ function transform__form_value_2_treedb_value(gobj, col, value, operation) {
|
|
|
17045
17207
|
case "enum":
|
|
17046
17208
|
switch (field_desc.real_type) {
|
|
17047
17209
|
case "string":
|
|
17048
|
-
if (is_array(value))
|
|
17049
|
-
|
|
17210
|
+
if (is_array(value)) {
|
|
17211
|
+
if (value.length > 0) value = value[0];
|
|
17212
|
+
else value = "";
|
|
17213
|
+
}
|
|
17050
17214
|
break;
|
|
17051
17215
|
case "object":
|
|
17052
17216
|
case "dict":
|
|
17053
17217
|
case "array":
|
|
17054
17218
|
case "list": break;
|
|
17055
|
-
default:
|
|
17056
|
-
log_error("col type unknown 6: " + field_desc.real_type);
|
|
17057
|
-
break;
|
|
17219
|
+
default: log_error("col type unknown 6: " + field_desc.real_type);
|
|
17058
17220
|
}
|
|
17059
17221
|
break;
|
|
17060
17222
|
case "now":
|
|
@@ -17066,23 +17228,17 @@ function transform__form_value_2_treedb_value(gobj, col, value, operation) {
|
|
|
17066
17228
|
case "integer":
|
|
17067
17229
|
if (value && is_date(value)) value = value.getTime() / 1e3;
|
|
17068
17230
|
break;
|
|
17069
|
-
default:
|
|
17070
|
-
log_error("col type unknown 7: " + field_desc.real_type);
|
|
17071
|
-
break;
|
|
17231
|
+
default: log_error("col type unknown 7: " + field_desc.real_type);
|
|
17072
17232
|
}
|
|
17073
17233
|
break;
|
|
17074
17234
|
case "color":
|
|
17075
17235
|
switch (field_desc.real_type) {
|
|
17076
17236
|
case "string": break;
|
|
17077
17237
|
case "integer": break;
|
|
17078
|
-
default:
|
|
17079
|
-
log_error("col type unknown 7: " + field_desc.real_type);
|
|
17080
|
-
break;
|
|
17238
|
+
default: log_error("col type unknown 7: " + field_desc.real_type);
|
|
17081
17239
|
}
|
|
17082
17240
|
break;
|
|
17083
|
-
default:
|
|
17084
|
-
log_error("col type unknown 8: " + field_desc.type);
|
|
17085
|
-
break;
|
|
17241
|
+
default: log_error("col type unknown 8: " + field_desc.type);
|
|
17086
17242
|
}
|
|
17087
17243
|
return value;
|
|
17088
17244
|
}
|
|
@@ -17124,9 +17280,7 @@ function build_fkey_ref(gobj, col, value) {
|
|
|
17124
17280
|
refs[topic_name + "^" + v + "^" + hook] = true;
|
|
17125
17281
|
break;
|
|
17126
17282
|
case "array":
|
|
17127
|
-
case "list":
|
|
17128
|
-
refs.push(topic_name + "^" + v + "^" + hook);
|
|
17129
|
-
break;
|
|
17283
|
+
case "list": refs.push(topic_name + "^" + v + "^" + hook);
|
|
17130
17284
|
}
|
|
17131
17285
|
} else if (is_object(v)) {
|
|
17132
17286
|
let topic_name = v.topic_name;
|
|
@@ -17139,9 +17293,7 @@ function build_fkey_ref(gobj, col, value) {
|
|
|
17139
17293
|
refs[topic_name + "^" + v.id + "^" + hook] = true;
|
|
17140
17294
|
break;
|
|
17141
17295
|
case "array":
|
|
17142
|
-
case "list":
|
|
17143
|
-
refs.push(topic_name + "^" + v.id + "^" + hook);
|
|
17144
|
-
break;
|
|
17296
|
+
case "list": refs.push(topic_name + "^" + v.id + "^" + hook);
|
|
17145
17297
|
}
|
|
17146
17298
|
} else {
|
|
17147
17299
|
log_error("Merde value1: " + v);
|
|
@@ -17258,8 +17410,10 @@ function ac_load_nodes(gobj, event, kw, src) {
|
|
|
17258
17410
|
return -1;
|
|
17259
17411
|
}
|
|
17260
17412
|
let tabulator = gobj_read_attr(gobj, "tabulator");
|
|
17261
|
-
if (tabulator)
|
|
17262
|
-
|
|
17413
|
+
if (tabulator) {
|
|
17414
|
+
if (tabulator._ready) tabulator.setData(data);
|
|
17415
|
+
else tabulator._pendingData = data;
|
|
17416
|
+
}
|
|
17263
17417
|
return 0;
|
|
17264
17418
|
}
|
|
17265
17419
|
/************************************************************
|
|
@@ -17368,9 +17522,7 @@ function ac_new_row(gobj, event, kw, src) {
|
|
|
17368
17522
|
case "template":
|
|
17369
17523
|
if (col.template) row[col.id] = col.template;
|
|
17370
17524
|
break;
|
|
17371
|
-
default:
|
|
17372
|
-
if (field_desc.default_value !== void 0) row[col.id] = field_desc.default_value;
|
|
17373
|
-
break;
|
|
17525
|
+
default: if (field_desc.default_value !== void 0) row[col.id] = field_desc.default_value;
|
|
17374
17526
|
}
|
|
17375
17527
|
}
|
|
17376
17528
|
show_create_form(gobj, row);
|
|
@@ -17461,7 +17613,8 @@ function ac_paste_rows(gobj, event, kw, src) {
|
|
|
17461
17613
|
* fkeys, times and numbers). Route by the form's mode.
|
|
17462
17614
|
************************************************************/
|
|
17463
17615
|
function ac_form_save_record(gobj, event, kw, src) {
|
|
17464
|
-
|
|
17616
|
+
let mode = gobj_read_str_attr(src, "form_mode");
|
|
17617
|
+
gobj_publish_event(gobj, mode === "create" ? "EV_CREATE_RECORD" : "EV_UPDATE_RECORD", {
|
|
17465
17618
|
topic_name: gobj_read_str_attr(gobj, "topic_name"),
|
|
17466
17619
|
record: kw
|
|
17467
17620
|
});
|
|
@@ -17478,12 +17631,14 @@ function ac_select_rows(gobj, event, kw, src) {
|
|
|
17478
17631
|
let $container = gobj_read_attr(gobj, "$container");
|
|
17479
17632
|
let $button_delete_record = $container.querySelector(`.button-delete-record`);
|
|
17480
17633
|
let $button_copy_record = $container.querySelector(`.button-copy-record`);
|
|
17481
|
-
if ($button_delete_record)
|
|
17482
|
-
|
|
17483
|
-
|
|
17484
|
-
|
|
17485
|
-
|
|
17486
|
-
|
|
17634
|
+
if ($button_delete_record) {
|
|
17635
|
+
if (tabulator.getSelectedData().length && gobj_read_bool_attr(gobj, "editable")) {
|
|
17636
|
+
$button_delete_record.removeAttribute("disabled");
|
|
17637
|
+
$button_copy_record.removeAttribute("disabled");
|
|
17638
|
+
} else {
|
|
17639
|
+
$button_delete_record.setAttribute("disabled", true);
|
|
17640
|
+
$button_copy_record.setAttribute("disabled", true);
|
|
17641
|
+
}
|
|
17487
17642
|
}
|
|
17488
17643
|
if (gobj_read_bool_attr(gobj, "broadcast_select_rows_event")) gobj_publish_event(gobj, event, kw);
|
|
17489
17644
|
return 0;
|
|
@@ -17496,12 +17651,14 @@ function ac_unselect_rows(gobj, event, kw, src) {
|
|
|
17496
17651
|
let $container = gobj_read_attr(gobj, "$container");
|
|
17497
17652
|
let $button_delete_record = $container.querySelector(`.button-delete-record`);
|
|
17498
17653
|
let $button_copy_record = $container.querySelector(`.button-copy-record`);
|
|
17499
|
-
if ($button_delete_record)
|
|
17500
|
-
|
|
17501
|
-
|
|
17502
|
-
|
|
17503
|
-
|
|
17504
|
-
|
|
17654
|
+
if ($button_delete_record) {
|
|
17655
|
+
if (tabulator.getSelectedData().length && gobj_read_bool_attr(gobj, "editable")) {
|
|
17656
|
+
$button_delete_record.removeAttribute("disabled");
|
|
17657
|
+
$button_copy_record.removeAttribute("disabled");
|
|
17658
|
+
} else {
|
|
17659
|
+
$button_delete_record.setAttribute("disabled", true);
|
|
17660
|
+
$button_copy_record.setAttribute("disabled", true);
|
|
17661
|
+
}
|
|
17505
17662
|
}
|
|
17506
17663
|
if (gobj_read_bool_attr(gobj, "broadcast_select_rows_event")) gobj_publish_event(gobj, event, kw);
|
|
17507
17664
|
return 0;
|
|
@@ -17523,7 +17680,8 @@ function ac_change_locale(gobj, event, kw, src) {
|
|
|
17523
17680
|
* };
|
|
17524
17681
|
************************************************************/
|
|
17525
17682
|
function ac_show_hook_data$1(gobj, event, kw, src) {
|
|
17526
|
-
let
|
|
17683
|
+
let webix = gobj_command(gobj_parent(gobj), "get_topic_data", kw, gobj);
|
|
17684
|
+
let row = kwid_find_one_record(gobj, webix.data, kw.row_id, null);
|
|
17527
17685
|
if (row) {
|
|
17528
17686
|
let cell = row[kw.col_id];
|
|
17529
17687
|
show_dropdown_popup_menu(gobj, kw.click_x, kw.click_y, cell);
|
|
@@ -17538,6 +17696,13 @@ function ac_refresh$1(gobj, event, kw, src) {
|
|
|
17538
17696
|
return 0;
|
|
17539
17697
|
}
|
|
17540
17698
|
/************************************************************
|
|
17699
|
+
* Show the schema (desc) of this topic
|
|
17700
|
+
************************************************************/
|
|
17701
|
+
function ac_show_schema(gobj, event, kw, src) {
|
|
17702
|
+
open_schema_dialog(gobj);
|
|
17703
|
+
return 0;
|
|
17704
|
+
}
|
|
17705
|
+
/************************************************************
|
|
17541
17706
|
* {
|
|
17542
17707
|
* href: href
|
|
17543
17708
|
* }
|
|
@@ -17651,6 +17816,11 @@ function create_gclass$4(gclass_name) {
|
|
|
17651
17816
|
ac_refresh$1,
|
|
17652
17817
|
null
|
|
17653
17818
|
],
|
|
17819
|
+
[
|
|
17820
|
+
"EV_SHOW_SCHEMA",
|
|
17821
|
+
ac_show_schema,
|
|
17822
|
+
null
|
|
17823
|
+
],
|
|
17654
17824
|
[
|
|
17655
17825
|
"EV_SHOW",
|
|
17656
17826
|
ac_show$3,
|
|
@@ -17662,7 +17832,7 @@ function create_gclass$4(gclass_name) {
|
|
|
17662
17832
|
null
|
|
17663
17833
|
]
|
|
17664
17834
|
]]];
|
|
17665
|
-
|
|
17835
|
+
const event_types = [
|
|
17666
17836
|
["EV_LANGUAGE_CHANGED", 0],
|
|
17667
17837
|
["EV_LOAD_NODES", 0],
|
|
17668
17838
|
["EV_LOAD_NODE_CREATED", 0],
|
|
@@ -17679,13 +17849,15 @@ function create_gclass$4(gclass_name) {
|
|
|
17679
17849
|
["EV_SHOW_HOOK_DATA", event_flag_t.EVF_OUTPUT_EVENT],
|
|
17680
17850
|
["EV_CHANGE_LOCALE", 0],
|
|
17681
17851
|
["EV_REFRESH", 0],
|
|
17852
|
+
["EV_SHOW_SCHEMA", 0],
|
|
17682
17853
|
["EV_CREATE_RECORD", event_flag_t.EVF_OUTPUT_EVENT],
|
|
17683
17854
|
["EV_UPDATE_RECORD", event_flag_t.EVF_OUTPUT_EVENT],
|
|
17684
17855
|
["EV_DELETE_RECORD", event_flag_t.EVF_OUTPUT_EVENT],
|
|
17685
17856
|
["EV_REFRESH_TOPIC", event_flag_t.EVF_OUTPUT_EVENT],
|
|
17686
17857
|
["EV_SHOW", 0],
|
|
17687
17858
|
["EV_HIDE", 0]
|
|
17688
|
-
]
|
|
17859
|
+
];
|
|
17860
|
+
__gclass__$4 = gclass_create(gclass_name, event_types, states, gmt$4, 0, attrs_table$4, PRIVATE_DATA$4, 0, 0, 0, 0);
|
|
17689
17861
|
if (!__gclass__$4) return -1;
|
|
17690
17862
|
return 0;
|
|
17691
17863
|
}
|
|
@@ -17694,6 +17866,7 @@ function create_gclass$4(gclass_name) {
|
|
|
17694
17866
|
***************************************************************/
|
|
17695
17867
|
function register_c_yui_treedb_topic_with_form() {
|
|
17696
17868
|
if (!gclass_find_by_name("C_YUI_FORM", false)) register_c_yui_form();
|
|
17869
|
+
if (!gclass_find_by_name("C_YUI_JSON", false)) register_c_yui_json();
|
|
17697
17870
|
return create_gclass$4(GCLASS_NAME$4);
|
|
17698
17871
|
}
|
|
17699
17872
|
//#endregion
|
|
@@ -17880,7 +18053,8 @@ function mt_create$3(gobj) {
|
|
|
17880
18053
|
if (!subscriber) subscriber = gobj_parent(gobj);
|
|
17881
18054
|
gobj_subscribe_event(gobj, null, {}, subscriber);
|
|
17882
18055
|
if (!priv.treedb_name) log_error(`${gobj_name(gobj)} -> treedb_name not configured`);
|
|
17883
|
-
|
|
18056
|
+
let canvas_id = clean_name(gobj_name(gobj)) + "-canvas";
|
|
18057
|
+
gobj_write_attr(gobj, "canvas_id", canvas_id);
|
|
17884
18058
|
let $container_canvas = build_ui$3(gobj).querySelector(`#${priv.canvas_id}`);
|
|
17885
18059
|
priv.gobj_nodes_tree = gobj_create_service(`${gobj_name(gobj)}-g6`, "C_G6_NODES_TREE", {
|
|
17886
18060
|
$container: $container_canvas,
|
|
@@ -18666,8 +18840,10 @@ function ac_mt_command_answer(gobj, event, kw, src) {
|
|
|
18666
18840
|
else gobj_send_event(jv, "EV_SET_JSON", { json: data }, gobj);
|
|
18667
18841
|
return 0;
|
|
18668
18842
|
}
|
|
18669
|
-
if (result < 0)
|
|
18670
|
-
|
|
18843
|
+
if (result < 0) {
|
|
18844
|
+
if (command === "descs") show_load_error(gobj, t(comment));
|
|
18845
|
+
else yui_shell_show_error(yui_shell_of(gobj), comment, { t });
|
|
18846
|
+
}
|
|
18671
18847
|
switch (command) {
|
|
18672
18848
|
case "descs":
|
|
18673
18849
|
if (result >= 0) process_treedb_descs(gobj, data);
|
|
@@ -19203,7 +19379,7 @@ function create_gclass$3(gclass_name) {
|
|
|
19203
19379
|
null
|
|
19204
19380
|
]
|
|
19205
19381
|
]]];
|
|
19206
|
-
|
|
19382
|
+
const event_types = [
|
|
19207
19383
|
["EV_MT_COMMAND_ANSWER", event_flag_t.EVF_PUBLIC_EVENT],
|
|
19208
19384
|
["EV_TREEDB_NODE_CREATED", event_flag_t.EVF_PUBLIC_EVENT],
|
|
19209
19385
|
["EV_TREEDB_NODE_UPDATED", event_flag_t.EVF_PUBLIC_EVENT],
|
|
@@ -19232,7 +19408,8 @@ function create_gclass$3(gclass_name) {
|
|
|
19232
19408
|
["EV_SHOW", 0],
|
|
19233
19409
|
["EV_HIDE", 0],
|
|
19234
19410
|
["EV_TRANSPORT_STATE", 0]
|
|
19235
|
-
]
|
|
19411
|
+
];
|
|
19412
|
+
__gclass__$3 = gclass_create(gclass_name, event_types, states, gmt$3, 0, attrs_table$3, PRIVATE_DATA$3, 0, 0, 0, 0);
|
|
19236
19413
|
if (!__gclass__$3) return -1;
|
|
19237
19414
|
return 0;
|
|
19238
19415
|
}
|
|
@@ -19311,14 +19488,15 @@ function mt_destroy$2(gobj) {
|
|
|
19311
19488
|
* Build UI
|
|
19312
19489
|
************************************************************/
|
|
19313
19490
|
function build_ui$2(gobj) {
|
|
19314
|
-
|
|
19491
|
+
let $container = createElement2([
|
|
19315
19492
|
"div",
|
|
19316
19493
|
{
|
|
19317
19494
|
class: "C_YUI_TREEDB_SCHEMA TREEDB_SCHEMA_VIEW",
|
|
19318
19495
|
style: "position:relative; height:100%; min-height:0;"
|
|
19319
19496
|
},
|
|
19320
19497
|
[]
|
|
19321
|
-
])
|
|
19498
|
+
]);
|
|
19499
|
+
gobj_write_attr(gobj, "$container", $container);
|
|
19322
19500
|
}
|
|
19323
19501
|
/************************************************************
|
|
19324
19502
|
* Derive {nodes, edges} from the schema.
|
|
@@ -19443,7 +19621,8 @@ function build_graph$1(gobj) {
|
|
|
19443
19621
|
priv.graph = graph;
|
|
19444
19622
|
graph.setTheme(dark ? "dark" : "light");
|
|
19445
19623
|
graph.on(NodeEvent.CLICK, (evt) => {
|
|
19446
|
-
|
|
19624
|
+
let node_id = evt && evt.target && evt.target.id;
|
|
19625
|
+
gobj_send_event(gobj, "EV_NODE_CLICK", { node_id }, gobj);
|
|
19447
19626
|
});
|
|
19448
19627
|
graph.render().then(() => {
|
|
19449
19628
|
try {
|
|
@@ -23572,7 +23751,6 @@ function segmentToCubic(segment, params) {
|
|
|
23572
23751
|
py
|
|
23573
23752
|
];
|
|
23574
23753
|
return ["C"].concat(lineToCubic(px1, py1, px, py));
|
|
23575
|
-
default:
|
|
23576
23754
|
}
|
|
23577
23755
|
return segment;
|
|
23578
23756
|
}
|
|
@@ -23596,7 +23774,8 @@ function path2Curve(pathInput, needZCommandIndexes) {
|
|
|
23596
23774
|
for (var i = 0; i < ii; i += 1) {
|
|
23597
23775
|
if (path[i]) pathCommand = path[i][0];
|
|
23598
23776
|
allPathCommands[i] = pathCommand;
|
|
23599
|
-
|
|
23777
|
+
var curveSegment = segmentToCubic(path[i], params);
|
|
23778
|
+
path[i] = curveSegment;
|
|
23600
23779
|
fixArc(path, allPathCommands, i);
|
|
23601
23780
|
ii = path.length;
|
|
23602
23781
|
if (pathCommand === "Z") zCommandIndexes.push(i);
|
|
@@ -23648,20 +23827,22 @@ function segmentLineFactory(x1, y1, x2, y2, distance) {
|
|
|
23648
23827
|
x: 0,
|
|
23649
23828
|
y: 0
|
|
23650
23829
|
};
|
|
23651
|
-
if (typeof distance === "number")
|
|
23652
|
-
|
|
23653
|
-
|
|
23654
|
-
|
|
23655
|
-
else if (distance >= length) point = {
|
|
23656
|
-
x: x2,
|
|
23657
|
-
y: y2
|
|
23658
|
-
};
|
|
23659
|
-
else {
|
|
23660
|
-
var _a = midPoint([x1, y1], [x2, y2], distance / length);
|
|
23661
|
-
point = {
|
|
23662
|
-
x: _a[0],
|
|
23663
|
-
y: _a[1]
|
|
23830
|
+
if (typeof distance === "number") {
|
|
23831
|
+
if (distance <= 0) point = {
|
|
23832
|
+
x: x1,
|
|
23833
|
+
y: y1
|
|
23664
23834
|
};
|
|
23835
|
+
else if (distance >= length) point = {
|
|
23836
|
+
x: x2,
|
|
23837
|
+
y: y2
|
|
23838
|
+
};
|
|
23839
|
+
else {
|
|
23840
|
+
var _a = midPoint([x1, y1], [x2, y2], distance / length);
|
|
23841
|
+
point = {
|
|
23842
|
+
x: _a[0],
|
|
23843
|
+
y: _a[1]
|
|
23844
|
+
};
|
|
23845
|
+
}
|
|
23665
23846
|
}
|
|
23666
23847
|
return {
|
|
23667
23848
|
length,
|
|
@@ -25217,7 +25398,11 @@ var Rectangle = /*#__PURE__*/ function() {
|
|
|
25217
25398
|
value: function toJSON() {}
|
|
25218
25399
|
}], [{
|
|
25219
25400
|
key: "fromRect",
|
|
25220
|
-
value:
|
|
25401
|
+
value:
|
|
25402
|
+
/**
|
|
25403
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/DOMRect/fromRect_static
|
|
25404
|
+
*/
|
|
25405
|
+
function fromRect(rect) {
|
|
25221
25406
|
return new Rectangle(rect.x, rect.y, rect.width, rect.height);
|
|
25222
25407
|
}
|
|
25223
25408
|
}, {
|
|
@@ -25307,14 +25492,15 @@ function getEulerFromMat4(out, m) {
|
|
|
25307
25492
|
var z;
|
|
25308
25493
|
var _mat4$getScaling2 = _slicedToArray(getScaling(create$3(), m), 3), sx = _mat4$getScaling2[0], sy = _mat4$getScaling2[1], sz = _mat4$getScaling2[2];
|
|
25309
25494
|
var y = Math.asin(-m[2] / sx);
|
|
25310
|
-
if (y < HALF_PI)
|
|
25311
|
-
|
|
25312
|
-
|
|
25495
|
+
if (y < HALF_PI) {
|
|
25496
|
+
if (y > -HALF_PI) {
|
|
25497
|
+
x = Math.atan2(m[6] / sy, m[10] / sz);
|
|
25498
|
+
z = Math.atan2(m[1] / sx, m[0] / sx);
|
|
25499
|
+
} else {
|
|
25500
|
+
z = 0;
|
|
25501
|
+
x = -Math.atan2(m[4] / sy, m[5] / sy);
|
|
25502
|
+
}
|
|
25313
25503
|
} else {
|
|
25314
|
-
z = 0;
|
|
25315
|
-
x = -Math.atan2(m[4] / sy, m[5] / sy);
|
|
25316
|
-
}
|
|
25317
|
-
else {
|
|
25318
25504
|
z = 0;
|
|
25319
25505
|
x = Math.atan2(m[4] / sy, m[5] / sy);
|
|
25320
25506
|
}
|
|
@@ -25381,8 +25567,10 @@ function decompose(mat) {
|
|
|
25381
25567
|
var row1y = mat[4];
|
|
25382
25568
|
var scalingX = Math.sqrt(row0x * row0x + row0y * row0y);
|
|
25383
25569
|
var scalingY = Math.sqrt(row1x * row1x + row1y * row1y);
|
|
25384
|
-
if (row0x * row1y - row0y * row1x < 0)
|
|
25385
|
-
|
|
25570
|
+
if (row0x * row1y - row0y * row1x < 0) {
|
|
25571
|
+
if (row0x < row1y) scalingX = -scalingX;
|
|
25572
|
+
else scalingY = -scalingY;
|
|
25573
|
+
}
|
|
25386
25574
|
if (scalingX) {
|
|
25387
25575
|
var invScalingX = 1 / scalingX;
|
|
25388
25576
|
row0x *= invScalingX;
|
|
@@ -26356,9 +26544,10 @@ function updateLocalTransform(transform) {
|
|
|
26356
26544
|
var hasRotation = localRotation[3] !== 1 || localRotation[0] !== 0 || localRotation[1] !== 0 || localRotation[2] !== 0;
|
|
26357
26545
|
var hasScale = localScale[0] !== 1 || localScale[1] !== 1 || localScale[2] !== 1;
|
|
26358
26546
|
var hasOrigin = origin[0] !== 0 || origin[1] !== 0 || origin[2] !== 0;
|
|
26359
|
-
if (!hasRotation && !hasScale && !hasOrigin)
|
|
26360
|
-
|
|
26361
|
-
|
|
26547
|
+
if (!hasRotation && !hasScale && !hasOrigin) {
|
|
26548
|
+
if (hasPosition) fromTranslation(localTransform, localPosition);
|
|
26549
|
+
else identity(localTransform);
|
|
26550
|
+
} else fromRotationTranslationScaleOrigin(localTransform, localRotation, localPosition, localScale, origin);
|
|
26362
26551
|
}
|
|
26363
26552
|
transform.localDirtyFlag = false;
|
|
26364
26553
|
}
|
|
@@ -26946,9 +27135,7 @@ var conversionToCanonicalUnitsScaleFactor = function conversionToCanonicalUnitsS
|
|
|
26946
27135
|
case UnitType.kGradians:
|
|
26947
27136
|
factor = .9;
|
|
26948
27137
|
break;
|
|
26949
|
-
case UnitType.kTurns:
|
|
26950
|
-
factor = 360;
|
|
26951
|
-
break;
|
|
27138
|
+
case UnitType.kTurns: factor = 360;
|
|
26952
27139
|
}
|
|
26953
27140
|
return factor;
|
|
26954
27141
|
};
|
|
@@ -27122,9 +27309,10 @@ var CSSKeywordValue = /*#__PURE__*/ function(_CSSStyleValue) {
|
|
|
27122
27309
|
var formatInfinityOrNaN = function formatInfinityOrNaN(number) {
|
|
27123
27310
|
var suffix = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "";
|
|
27124
27311
|
var result = "";
|
|
27125
|
-
if (!Number.isFinite(number))
|
|
27126
|
-
|
|
27127
|
-
|
|
27312
|
+
if (!Number.isFinite(number)) {
|
|
27313
|
+
if (number > 0) result = "infinity";
|
|
27314
|
+
else result = "-infinity";
|
|
27315
|
+
} else result = "NaN";
|
|
27128
27316
|
return result += suffix;
|
|
27129
27317
|
};
|
|
27130
27318
|
var toCanonicalUnit = function toCanonicalUnit(unit) {
|
|
@@ -27693,8 +27881,10 @@ var parseGradient = memoize(function(colorStr) {
|
|
|
27693
27881
|
}
|
|
27694
27882
|
} else if (type === "r") {
|
|
27695
27883
|
var parsedRadialGradient = parseRadialGradient(colorStr);
|
|
27696
|
-
if (parsedRadialGradient)
|
|
27697
|
-
|
|
27884
|
+
if (parsedRadialGradient) {
|
|
27885
|
+
if (isString(parsedRadialGradient)) colorStr = parsedRadialGradient;
|
|
27886
|
+
else return [new CSSGradientValue(GradientType.RadialGradient, parsedRadialGradient)];
|
|
27887
|
+
}
|
|
27698
27888
|
} else if (type === "p") return parsePattern(colorStr);
|
|
27699
27889
|
}
|
|
27700
27890
|
});
|
|
@@ -28111,7 +28301,6 @@ function getPathBBox(segments, lineWidth) {
|
|
|
28111
28301
|
default:
|
|
28112
28302
|
xArr.push(currentPoint[0]);
|
|
28113
28303
|
yArr.push(currentPoint[1]);
|
|
28114
|
-
break;
|
|
28115
28304
|
}
|
|
28116
28305
|
if (box$1) {
|
|
28117
28306
|
segment.box = box$1;
|
|
@@ -28286,9 +28475,7 @@ function path2Segments(path) {
|
|
|
28286
28475
|
startMovePoint = [params[1], params[2]];
|
|
28287
28476
|
lastStartMovePointIndex = i;
|
|
28288
28477
|
break;
|
|
28289
|
-
case "A":
|
|
28290
|
-
segment.arcParams = getArcParams(currentPoint, params);
|
|
28291
|
-
break;
|
|
28478
|
+
case "A": segment.arcParams = getArcParams(currentPoint, params);
|
|
28292
28479
|
}
|
|
28293
28480
|
if (command === "Z") {
|
|
28294
28481
|
currentPoint = startMovePoint;
|
|
@@ -29575,10 +29762,12 @@ var parseTransformOrigin = memoize(function(value) {
|
|
|
29575
29762
|
if (isString(value)) {
|
|
29576
29763
|
if (value === "text-anchor") return [getOrCreateUnitValue(0, "px"), getOrCreateUnitValue(0, "px")];
|
|
29577
29764
|
var values = value.split(" ");
|
|
29578
|
-
if (values.length === 1)
|
|
29579
|
-
values[
|
|
29580
|
-
|
|
29581
|
-
|
|
29765
|
+
if (values.length === 1) {
|
|
29766
|
+
if (values[0] === "top" || values[0] === "bottom") {
|
|
29767
|
+
values[1] = values[0];
|
|
29768
|
+
values[0] = "center";
|
|
29769
|
+
} else values[1] = "center";
|
|
29770
|
+
}
|
|
29582
29771
|
if (values.length !== 2) return null;
|
|
29583
29772
|
return [parseLengthOrPercentage(convertKeyword2Percent(values[0])), parseLengthOrPercentage(convertKeyword2Percent(values[1]))];
|
|
29584
29773
|
}
|
|
@@ -30456,7 +30645,14 @@ var CSSPropertyLengthOrPercentage = /*#__PURE__*/ function() {
|
|
|
30456
30645
|
}
|
|
30457
30646
|
return _createClass(CSSPropertyLengthOrPercentage, [{
|
|
30458
30647
|
key: "calculator",
|
|
30459
|
-
value:
|
|
30648
|
+
value:
|
|
30649
|
+
/**
|
|
30650
|
+
* according to parent's bounds
|
|
30651
|
+
*
|
|
30652
|
+
* @example
|
|
30653
|
+
* CSS.percent(50) -> CSS.px(0.5 * parent.width)
|
|
30654
|
+
*/
|
|
30655
|
+
function calculator(name, oldParsed, computed, object, runtime) {
|
|
30460
30656
|
if (isNumber(computed)) return computed;
|
|
30461
30657
|
if (CSSUnitValue.isRelativeUnit(computed.unit)) {
|
|
30462
30658
|
if (computed.unit === UnitType.kPercentage) return 0;
|
|
@@ -31373,7 +31569,19 @@ var FederatedEvent = /*#__PURE__*/ function() {
|
|
|
31373
31569
|
return _createClass(FederatedEvent, [
|
|
31374
31570
|
{
|
|
31375
31571
|
key: "name",
|
|
31376
|
-
get:
|
|
31572
|
+
get:
|
|
31573
|
+
/**
|
|
31574
|
+
* The type of event, supports the following:
|
|
31575
|
+
* * pointerdown
|
|
31576
|
+
* * touchstart
|
|
31577
|
+
* * mousedown
|
|
31578
|
+
* * rightdown
|
|
31579
|
+
* * ...
|
|
31580
|
+
*/
|
|
31581
|
+
/**
|
|
31582
|
+
* @deprecated
|
|
31583
|
+
*/
|
|
31584
|
+
function get() {
|
|
31377
31585
|
return this.type;
|
|
31378
31586
|
}
|
|
31379
31587
|
},
|
|
@@ -31439,7 +31647,15 @@ var FederatedEvent = /*#__PURE__*/ function() {
|
|
|
31439
31647
|
},
|
|
31440
31648
|
{
|
|
31441
31649
|
key: "composedPath",
|
|
31442
|
-
value:
|
|
31650
|
+
value:
|
|
31651
|
+
/**
|
|
31652
|
+
* The propagation path for this event
|
|
31653
|
+
* @see https://developer.mozilla.org/zh-CN/docs/Web/API/Event/composedPath
|
|
31654
|
+
*
|
|
31655
|
+
* So composedPath()[0] represents the original target.
|
|
31656
|
+
* @see https://polymer-library.polymer-project.org/3.0/docs/devguide/events#retargeting
|
|
31657
|
+
*/
|
|
31658
|
+
function composedPath() {
|
|
31443
31659
|
if (this.manager && (!this.path || this.path[0] !== this.target)) this.path = this.target ? this.manager.propagationPath(this.target) : [];
|
|
31444
31660
|
return this.path;
|
|
31445
31661
|
}
|
|
@@ -31471,7 +31687,12 @@ var FederatedEvent = /*#__PURE__*/ function() {
|
|
|
31471
31687
|
},
|
|
31472
31688
|
{
|
|
31473
31689
|
key: "initEvent",
|
|
31474
|
-
value:
|
|
31690
|
+
value:
|
|
31691
|
+
/**
|
|
31692
|
+
* added for compatibility with DOM Event,
|
|
31693
|
+
* deprecated props and methods
|
|
31694
|
+
*/
|
|
31695
|
+
function initEvent() {}
|
|
31475
31696
|
},
|
|
31476
31697
|
{
|
|
31477
31698
|
key: "initUIEvent",
|
|
@@ -31634,7 +31855,43 @@ var FederatedPointerEvent = /*#__PURE__*/ function(_FederatedMouseEvent) {
|
|
|
31634
31855
|
return _createClass(FederatedPointerEvent, [
|
|
31635
31856
|
{
|
|
31636
31857
|
key: "getCoalescedEvents",
|
|
31637
|
-
value:
|
|
31858
|
+
value:
|
|
31859
|
+
/**
|
|
31860
|
+
* The type of pointer that triggered the event.
|
|
31861
|
+
*
|
|
31862
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/pointerType
|
|
31863
|
+
*/
|
|
31864
|
+
/**
|
|
31865
|
+
* Pressure applied by the pointing device during the event.
|
|
31866
|
+
*s
|
|
31867
|
+
* A Touch's force property will be represented by this value.
|
|
31868
|
+
*
|
|
31869
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/pressure
|
|
31870
|
+
*/
|
|
31871
|
+
/**
|
|
31872
|
+
* Barrel pressure on a stylus pointer.
|
|
31873
|
+
*
|
|
31874
|
+
* @see https://w3c.github.io/pointerevents/#pointerevent-interface
|
|
31875
|
+
*/
|
|
31876
|
+
/**
|
|
31877
|
+
* The angle, in degrees, between the pointer device and the screen.
|
|
31878
|
+
*
|
|
31879
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/tiltX
|
|
31880
|
+
*/
|
|
31881
|
+
/**
|
|
31882
|
+
* The angle, in degrees, between the pointer device and the screen.
|
|
31883
|
+
*
|
|
31884
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/tiltY
|
|
31885
|
+
*/
|
|
31886
|
+
/**
|
|
31887
|
+
* Twist of a stylus pointer.
|
|
31888
|
+
*
|
|
31889
|
+
* @see https://w3c.github.io/pointerevents/#pointerevent-interface
|
|
31890
|
+
*/
|
|
31891
|
+
/**
|
|
31892
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/getCoalescedEvents
|
|
31893
|
+
*/
|
|
31894
|
+
function getCoalescedEvents() {
|
|
31638
31895
|
if (this.type === "pointermove" || this.type === "mousemove" || this.type === "touchmove") return [this];
|
|
31639
31896
|
return [];
|
|
31640
31897
|
}
|
|
@@ -31661,7 +31918,15 @@ var FederatedWheelEvent = /*#__PURE__*/ function(_FederatedMouseEvent) {
|
|
|
31661
31918
|
_inherits(FederatedWheelEvent, _FederatedMouseEvent);
|
|
31662
31919
|
return _createClass(FederatedWheelEvent, [{
|
|
31663
31920
|
key: "clone",
|
|
31664
|
-
value:
|
|
31921
|
+
value:
|
|
31922
|
+
/**
|
|
31923
|
+
* The units of `deltaX`, `deltaY`, and `deltaZ`. This is one of `DOM_DELTA_LINE`,
|
|
31924
|
+
* `DOM_DELTA_PAGE`, `DOM_DELTA_PIXEL`.
|
|
31925
|
+
*/
|
|
31926
|
+
/** Horizontal scroll amount */
|
|
31927
|
+
/** Vertical scroll amount */
|
|
31928
|
+
/** z-axis scroll amount. */
|
|
31929
|
+
function clone() {
|
|
31665
31930
|
return this.manager.cloneWheelEvent(this);
|
|
31666
31931
|
}
|
|
31667
31932
|
}]);
|
|
@@ -31750,7 +32015,11 @@ var Node$1 = /*#__PURE__*/ function(_EventTarget) {
|
|
|
31750
32015
|
return _createClass(Node, [
|
|
31751
32016
|
{
|
|
31752
32017
|
key: "textContent",
|
|
31753
|
-
get:
|
|
32018
|
+
get:
|
|
32019
|
+
/**
|
|
32020
|
+
* @see https://developer.mozilla.org/zh-CN/docs/Web/API/Node/textContent
|
|
32021
|
+
*/
|
|
32022
|
+
function get() {
|
|
31754
32023
|
var out = "";
|
|
31755
32024
|
if (this.nodeName === Shape.TEXT) out += this.style.text;
|
|
31756
32025
|
var _iterator = _createForOfIteratorHelper(this.childNodes), _step;
|
|
@@ -31828,7 +32097,12 @@ var Node$1 = /*#__PURE__*/ function(_EventTarget) {
|
|
|
31828
32097
|
},
|
|
31829
32098
|
{
|
|
31830
32099
|
key: "parent",
|
|
31831
|
-
get:
|
|
32100
|
+
get:
|
|
32101
|
+
/**
|
|
32102
|
+
* @deprecated
|
|
32103
|
+
* @alias parentNode
|
|
32104
|
+
*/
|
|
32105
|
+
function get() {
|
|
31832
32106
|
return this.parentNode;
|
|
31833
32107
|
}
|
|
31834
32108
|
},
|
|
@@ -31898,7 +32172,12 @@ var Node$1 = /*#__PURE__*/ function(_EventTarget) {
|
|
|
31898
32172
|
},
|
|
31899
32173
|
{
|
|
31900
32174
|
key: "contain",
|
|
31901
|
-
value:
|
|
32175
|
+
value:
|
|
32176
|
+
/**
|
|
32177
|
+
* @deprecated
|
|
32178
|
+
* @alias contains
|
|
32179
|
+
*/
|
|
32180
|
+
function contain(other) {
|
|
31902
32181
|
return this.contains(other);
|
|
31903
32182
|
}
|
|
31904
32183
|
},
|
|
@@ -31949,7 +32228,12 @@ var Node$1 = /*#__PURE__*/ function(_EventTarget) {
|
|
|
31949
32228
|
return _createClass(EventTarget, [
|
|
31950
32229
|
{
|
|
31951
32230
|
key: "on",
|
|
31952
|
-
value:
|
|
32231
|
+
value:
|
|
32232
|
+
/**
|
|
32233
|
+
* @deprecated
|
|
32234
|
+
* @alias addEventListener
|
|
32235
|
+
*/
|
|
32236
|
+
function on(type, listener, options) {
|
|
31953
32237
|
this.addEventListener(type, listener, options);
|
|
31954
32238
|
return this;
|
|
31955
32239
|
}
|
|
@@ -32112,7 +32396,11 @@ var OffscreenCanvasCreator = /*#__PURE__*/ function() {
|
|
|
32112
32396
|
}
|
|
32113
32397
|
}], [{
|
|
32114
32398
|
key: "createCanvas",
|
|
32115
|
-
value:
|
|
32399
|
+
value:
|
|
32400
|
+
/**
|
|
32401
|
+
* @returns new canvas instance
|
|
32402
|
+
*/
|
|
32403
|
+
function createCanvas() {
|
|
32116
32404
|
try {
|
|
32117
32405
|
return new window.OffscreenCanvas(0, 0);
|
|
32118
32406
|
} catch (_unused2) {}
|
|
@@ -32735,10 +33023,12 @@ var DefaultSceneGraphService = /*#__PURE__*/ function() {
|
|
|
32735
33023
|
var aabb = this.getTransformedGeometryBounds(element, render, existedAABB);
|
|
32736
33024
|
element.childNodes.forEach(function(child) {
|
|
32737
33025
|
var childBounds = _this.getBounds(child, render);
|
|
32738
|
-
if (childBounds)
|
|
32739
|
-
|
|
32740
|
-
|
|
32741
|
-
|
|
33026
|
+
if (childBounds) {
|
|
33027
|
+
if (!aabb) {
|
|
33028
|
+
aabb = existedAABB || new AABB();
|
|
33029
|
+
aabb.update(childBounds.center, childBounds.halfExtents);
|
|
33030
|
+
} else aabb.add(childBounds);
|
|
33031
|
+
}
|
|
32742
33032
|
});
|
|
32743
33033
|
if (!aabb) aabb = new AABB();
|
|
32744
33034
|
if (render) {
|
|
@@ -32945,12 +33235,14 @@ var DefaultSceneGraphService = /*#__PURE__*/ function() {
|
|
|
32945
33235
|
var mutations = /* @__PURE__ */ new Set();
|
|
32946
33236
|
canvas.getRoot().forEach(function(item) {
|
|
32947
33237
|
(item.mutations || []).forEach(function(mutation) {
|
|
32948
|
-
if (mutation.type === "attributes" && mutation._boundsChangeData)
|
|
32949
|
-
|
|
32950
|
-
|
|
32951
|
-
|
|
32952
|
-
|
|
32953
|
-
|
|
33238
|
+
if (mutation.type === "attributes" && mutation._boundsChangeData) {
|
|
33239
|
+
if (mutation._boundsChangeData.affectChildren) item.forEach(function(node) {
|
|
33240
|
+
var newMutation = _objectSpread2({}, mutation);
|
|
33241
|
+
newMutation.target = node;
|
|
33242
|
+
mutations.add(newMutation);
|
|
33243
|
+
});
|
|
33244
|
+
else mutations.add(mutation);
|
|
33245
|
+
}
|
|
32954
33246
|
});
|
|
32955
33247
|
item.mutations = void 0;
|
|
32956
33248
|
});
|
|
@@ -33125,7 +33417,15 @@ var TextService = /*#__PURE__*/ function() {
|
|
|
33125
33417
|
return _createClass(TextService, [
|
|
33126
33418
|
{
|
|
33127
33419
|
key: "measureFont",
|
|
33128
|
-
value:
|
|
33420
|
+
value:
|
|
33421
|
+
/**
|
|
33422
|
+
* A global cache for character widths, keyed by font string.
|
|
33423
|
+
* e.g. { '16px Arial': { 'a': 8, 'b': 9 } }
|
|
33424
|
+
*/
|
|
33425
|
+
/**
|
|
33426
|
+
* Calculates the ascent, descent and fontSize of a given font-style.
|
|
33427
|
+
*/
|
|
33428
|
+
function measureFont(font, offscreenCanvas) {
|
|
33129
33429
|
if (this.fontMetricsCache[font]) return this.fontMetricsCache[font];
|
|
33130
33430
|
var properties = {
|
|
33131
33431
|
ascent: 0,
|
|
@@ -33623,7 +33923,18 @@ var Element$1 = /*#__PURE__*/ function(_Node) {
|
|
|
33623
33923
|
return _createClass(Element, [
|
|
33624
33924
|
{
|
|
33625
33925
|
key: "dirty",
|
|
33626
|
-
value:
|
|
33926
|
+
value:
|
|
33927
|
+
/**
|
|
33928
|
+
* Marks the element as dirty, indicating it needs re-rendering or relayout.
|
|
33929
|
+
*
|
|
33930
|
+
* @param styleFlag - Whether to update style state (default: true).
|
|
33931
|
+
* When true, sets `renderable.dirty` to true.
|
|
33932
|
+
* @param layoutFlag - Optional. When provided, updates layout-related dirty flags:
|
|
33933
|
+
* - `renderable.boundsDirty`
|
|
33934
|
+
* - `renderable.renderBoundsDirty`
|
|
33935
|
+
* - `geometry.dirty`
|
|
33936
|
+
*/
|
|
33937
|
+
function dirty() {
|
|
33627
33938
|
var styleFlag = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : true;
|
|
33628
33939
|
var layoutFlag = arguments.length > 1 ? arguments[1] : void 0;
|
|
33629
33940
|
this.renderable.dirty = styleFlag;
|
|
@@ -33636,7 +33947,16 @@ var Element$1 = /*#__PURE__*/ function(_Node) {
|
|
|
33636
33947
|
},
|
|
33637
33948
|
{
|
|
33638
33949
|
key: "className",
|
|
33639
|
-
get:
|
|
33950
|
+
get:
|
|
33951
|
+
/**
|
|
33952
|
+
* used with `getElementById()`
|
|
33953
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/Element/id
|
|
33954
|
+
*/
|
|
33955
|
+
/**
|
|
33956
|
+
* used in `getElementsByClassName`
|
|
33957
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/Document/getElementsByClassName
|
|
33958
|
+
*/
|
|
33959
|
+
function get() {
|
|
33640
33960
|
return this.getAttribute("class") || "";
|
|
33641
33961
|
},
|
|
33642
33962
|
set: function set(className) {
|
|
@@ -33645,7 +33965,11 @@ var Element$1 = /*#__PURE__*/ function(_Node) {
|
|
|
33645
33965
|
},
|
|
33646
33966
|
{
|
|
33647
33967
|
key: "classList",
|
|
33648
|
-
get:
|
|
33968
|
+
get:
|
|
33969
|
+
/**
|
|
33970
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/Element/classList
|
|
33971
|
+
*/
|
|
33972
|
+
function get() {
|
|
33649
33973
|
return this.className.split(" ").filter(function(c) {
|
|
33650
33974
|
return c !== "";
|
|
33651
33975
|
});
|
|
@@ -33719,8 +34043,10 @@ var Element$1 = /*#__PURE__*/ function(_Node) {
|
|
|
33719
34043
|
var _this$ownerDocument;
|
|
33720
34044
|
if (child.destroyed) throw new Error(ERROR_MSG_APPEND_DESTROYED_ELEMENT);
|
|
33721
34045
|
runtime.sceneGraphService.attach(child, this, index);
|
|
33722
|
-
if ((_this$ownerDocument = this.ownerDocument) !== null && _this$ownerDocument !== void 0 && _this$ownerDocument.defaultView)
|
|
33723
|
-
|
|
34046
|
+
if ((_this$ownerDocument = this.ownerDocument) !== null && _this$ownerDocument !== void 0 && _this$ownerDocument.defaultView) {
|
|
34047
|
+
if (!isInFragment(this) && child.nodeName === Shape.FRAGMENT) this.ownerDocument.defaultView.mountFragment(child);
|
|
34048
|
+
else this.ownerDocument.defaultView.mountChildren(child);
|
|
34049
|
+
}
|
|
33724
34050
|
if (this.isMutationObserved) {
|
|
33725
34051
|
insertedEvent.relatedNode = this;
|
|
33726
34052
|
child.dispatchEvent(insertedEvent);
|
|
@@ -33986,13 +34312,22 @@ var Element$1 = /*#__PURE__*/ function(_Node) {
|
|
|
33986
34312
|
},
|
|
33987
34313
|
{
|
|
33988
34314
|
key: "computedStyleMap",
|
|
33989
|
-
value:
|
|
34315
|
+
value:
|
|
34316
|
+
/**
|
|
34317
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/Element/computedStyleMap
|
|
34318
|
+
* eg. circle.computedStyleMap().get('fill');
|
|
34319
|
+
*/
|
|
34320
|
+
function computedStyleMap() {
|
|
33990
34321
|
return new Map(Object.entries(this.computedStyle));
|
|
33991
34322
|
}
|
|
33992
34323
|
},
|
|
33993
34324
|
{
|
|
33994
34325
|
key: "getAttributeNames",
|
|
33995
|
-
value:
|
|
34326
|
+
value:
|
|
34327
|
+
/**
|
|
34328
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/Element/getAttributeNames
|
|
34329
|
+
*/
|
|
34330
|
+
function getAttributeNames() {
|
|
33996
34331
|
return Object.keys(this.attributes);
|
|
33997
34332
|
}
|
|
33998
34333
|
},
|
|
@@ -36636,7 +36971,11 @@ var HTMLRenderingPlugin = /*#__PURE__*/ function() {
|
|
|
36636
36971
|
return _createClass(HTMLRenderingPlugin, [
|
|
36637
36972
|
{
|
|
36638
36973
|
key: "joinTransformMatrix",
|
|
36639
|
-
value:
|
|
36974
|
+
value:
|
|
36975
|
+
/**
|
|
36976
|
+
* ! The reason for adding `offset` is that the `transform-origin` coordinate system of DOM is the local coordinate system of the element, while the `transform-origin` coordinate system of canvas drawing is the local coordinate system of the element's parent element. At the same time, the `transform` attribute value of the DOM element does not include `transform-origin`.
|
|
36977
|
+
*/
|
|
36978
|
+
function joinTransformMatrix(matrix) {
|
|
36640
36979
|
var offset = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [
|
|
36641
36980
|
0,
|
|
36642
36981
|
0,
|
|
@@ -36835,18 +37174,20 @@ var HTMLRenderingPlugin = /*#__PURE__*/ function() {
|
|
|
36835
37174
|
case "fill":
|
|
36836
37175
|
var fill = object.parsedStyle.fill;
|
|
36837
37176
|
var color = "";
|
|
36838
|
-
if (isCSSRGB(fill))
|
|
36839
|
-
|
|
36840
|
-
|
|
37177
|
+
if (isCSSRGB(fill)) {
|
|
37178
|
+
if (fill.isNone) color = "transparent";
|
|
37179
|
+
else color = object.getAttribute("fill");
|
|
37180
|
+
} else if (Array.isArray(fill)) color = object.getAttribute("fill");
|
|
36841
37181
|
else if (isPattern(fill));
|
|
36842
37182
|
$el.style.background = color;
|
|
36843
37183
|
break;
|
|
36844
37184
|
case "stroke":
|
|
36845
37185
|
var stroke = object.parsedStyle.stroke;
|
|
36846
37186
|
var borderColor = "";
|
|
36847
|
-
if (isCSSRGB(stroke))
|
|
36848
|
-
|
|
36849
|
-
|
|
37187
|
+
if (isCSSRGB(stroke)) {
|
|
37188
|
+
if (stroke.isNone) borderColor = "transparent";
|
|
37189
|
+
else borderColor = object.getAttribute("stroke");
|
|
37190
|
+
} else if (Array.isArray(stroke)) borderColor = object.getAttribute("stroke");
|
|
36850
37191
|
else if (isPattern(stroke));
|
|
36851
37192
|
$el.style["border-color"] = borderColor;
|
|
36852
37193
|
$el.style["border-style"] = "solid";
|
|
@@ -37538,8 +37879,10 @@ PERFORMANCE OF THIS SOFTWARE.
|
|
|
37538
37879
|
if (classType === CJ) return types.push(lineBreak === "strict" ? NS : ID);
|
|
37539
37880
|
if (classType === SA) return types.push(AL);
|
|
37540
37881
|
if (classType === AI) return types.push(AL);
|
|
37541
|
-
if (classType === XX)
|
|
37542
|
-
|
|
37882
|
+
if (classType === XX) {
|
|
37883
|
+
if (codePoint >= 131072 && codePoint <= 196605 || codePoint >= 196608 && codePoint <= 262141) return types.push(ID);
|
|
37884
|
+
else return types.push(AL);
|
|
37885
|
+
}
|
|
37543
37886
|
types.push(classType);
|
|
37544
37887
|
});
|
|
37545
37888
|
return [
|
|
@@ -38201,12 +38544,13 @@ PERFORMANCE OF THIS SOFTWARE.
|
|
|
38201
38544
|
} else if (codePoint === QUOTATION_MARK || codePoint === APOSTROPHE || codePoint === LEFT_PARENTHESIS || isNonPrintableCodePoint(codePoint)) {
|
|
38202
38545
|
this.consumeBadUrlRemnants();
|
|
38203
38546
|
return BAD_URL_TOKEN;
|
|
38204
|
-
} else if (codePoint === REVERSE_SOLIDUS)
|
|
38205
|
-
|
|
38206
|
-
|
|
38207
|
-
|
|
38208
|
-
|
|
38209
|
-
|
|
38547
|
+
} else if (codePoint === REVERSE_SOLIDUS) {
|
|
38548
|
+
if (isValidEscape(codePoint, this.peekCodePoint(0))) value.push(this.consumeEscapedCodePoint());
|
|
38549
|
+
else {
|
|
38550
|
+
this.consumeBadUrlRemnants();
|
|
38551
|
+
return BAD_URL_TOKEN;
|
|
38552
|
+
}
|
|
38553
|
+
} else value.push(codePoint);
|
|
38210
38554
|
}
|
|
38211
38555
|
};
|
|
38212
38556
|
Tokenizer.prototype.consumeWhiteSpace = function() {
|
|
@@ -38950,15 +39294,13 @@ PERFORMANCE OF THIS SOFTWARE.
|
|
|
38950
39294
|
ry = Math.max(Math.abs(y), Math.abs(y - height));
|
|
38951
39295
|
}
|
|
38952
39296
|
break;
|
|
38953
|
-
case 3:
|
|
38954
|
-
|
|
38955
|
-
|
|
38956
|
-
|
|
38957
|
-
|
|
38958
|
-
|
|
38959
|
-
|
|
38960
|
-
}
|
|
38961
|
-
break;
|
|
39297
|
+
case 3: if (gradient.shape === 0) rx = ry = Math.max(distance(x, y), distance(x, y - height), distance(x - width, y), distance(x - width, y - height));
|
|
39298
|
+
else if (gradient.shape === 1) {
|
|
39299
|
+
var c = Math.max(Math.abs(y), Math.abs(y - height)) / Math.max(Math.abs(x), Math.abs(x - width));
|
|
39300
|
+
var _b = findCorner(width, height, x, y, false), cx = _b[0], cy = _b[1];
|
|
39301
|
+
rx = distance(cx - x, (cy - y) / c);
|
|
39302
|
+
ry = c * rx;
|
|
39303
|
+
}
|
|
38962
39304
|
}
|
|
38963
39305
|
if (Array.isArray(gradient.size)) {
|
|
38964
39306
|
rx = getAbsoluteValue(gradient.size[0], width);
|
|
@@ -39938,7 +40280,6 @@ PERFORMANCE OF THIS SOFTWARE.
|
|
|
39938
40280
|
case 4:
|
|
39939
40281
|
results.push(accumulator.join(" "));
|
|
39940
40282
|
accumulator.length = 0;
|
|
39941
|
-
break;
|
|
39942
40283
|
}
|
|
39943
40284
|
});
|
|
39944
40285
|
if (accumulator.length) results.push(accumulator.join(" "));
|
|
@@ -40147,9 +40488,7 @@ PERFORMANCE OF THIS SOFTWARE.
|
|
|
40147
40488
|
case "fill":
|
|
40148
40489
|
layers.push(0);
|
|
40149
40490
|
break;
|
|
40150
|
-
case "markers":
|
|
40151
|
-
layers.push(2);
|
|
40152
|
-
break;
|
|
40491
|
+
case "markers": layers.push(2);
|
|
40153
40492
|
}
|
|
40154
40493
|
});
|
|
40155
40494
|
DEFAULT_VALUE.forEach(function(value) {
|
|
@@ -40295,20 +40634,18 @@ PERFORMANCE OF THIS SOFTWARE.
|
|
|
40295
40634
|
case 0: return descriptor.parse(context, parser.parseComponentValue());
|
|
40296
40635
|
case 1: return descriptor.parse(context, parser.parseComponentValues());
|
|
40297
40636
|
case 4: return parser.parseComponentValue();
|
|
40298
|
-
case 3:
|
|
40299
|
-
|
|
40300
|
-
|
|
40301
|
-
|
|
40302
|
-
|
|
40303
|
-
|
|
40304
|
-
|
|
40305
|
-
|
|
40306
|
-
|
|
40307
|
-
|
|
40308
|
-
|
|
40309
|
-
|
|
40310
|
-
}
|
|
40311
|
-
break;
|
|
40637
|
+
case 3: switch (descriptor.format) {
|
|
40638
|
+
case "angle": return angle.parse(context, parser.parseComponentValue());
|
|
40639
|
+
case "color": return color$1.parse(context, parser.parseComponentValue());
|
|
40640
|
+
case "image": return image.parse(context, parser.parseComponentValue());
|
|
40641
|
+
case "length":
|
|
40642
|
+
var length_1 = parser.parseComponentValue();
|
|
40643
|
+
return isLength(length_1) ? length_1 : ZERO_LENGTH;
|
|
40644
|
+
case "length-percentage":
|
|
40645
|
+
var value_1 = parser.parseComponentValue();
|
|
40646
|
+
return isLengthPercentage(value_1) ? value_1 : ZERO_LENGTH;
|
|
40647
|
+
case "time": return time.parse(context, parser.parseComponentValue());
|
|
40648
|
+
}
|
|
40312
40649
|
}
|
|
40313
40650
|
};
|
|
40314
40651
|
var elementDebuggerAttribute = "data-html2canvas-debug";
|
|
@@ -40793,22 +41130,23 @@ PERFORMANCE OF THIS SOFTWARE.
|
|
|
40793
41130
|
var textBounds = [];
|
|
40794
41131
|
var offset = 0;
|
|
40795
41132
|
textList.forEach(function(text) {
|
|
40796
|
-
if (styles.textDecorationLine.length || text.trim().length > 0)
|
|
40797
|
-
|
|
40798
|
-
|
|
40799
|
-
|
|
40800
|
-
|
|
40801
|
-
|
|
40802
|
-
|
|
40803
|
-
|
|
40804
|
-
|
|
40805
|
-
|
|
40806
|
-
|
|
40807
|
-
|
|
40808
|
-
|
|
40809
|
-
|
|
40810
|
-
|
|
40811
|
-
|
|
41133
|
+
if (styles.textDecorationLine.length || text.trim().length > 0) {
|
|
41134
|
+
if (FEATURES.SUPPORT_RANGE_BOUNDS) {
|
|
41135
|
+
var clientRects = createRange(node, offset, text.length).getClientRects();
|
|
41136
|
+
if (clientRects.length > 1) {
|
|
41137
|
+
var subSegments = segmentGraphemes(text);
|
|
41138
|
+
var subOffset_1 = 0;
|
|
41139
|
+
subSegments.forEach(function(subSegment) {
|
|
41140
|
+
textBounds.push(new TextBounds(subSegment, Bounds.fromDOMRectList(context, createRange(node, subOffset_1 + offset, subSegment.length).getClientRects())));
|
|
41141
|
+
subOffset_1 += subSegment.length;
|
|
41142
|
+
});
|
|
41143
|
+
} else textBounds.push(new TextBounds(text, Bounds.fromDOMRectList(context, clientRects)));
|
|
41144
|
+
} else {
|
|
41145
|
+
var replacementNode = node.splitText(text.length);
|
|
41146
|
+
textBounds.push(new TextBounds(text, getWrapperBounds(context, node)));
|
|
41147
|
+
node = replacementNode;
|
|
41148
|
+
}
|
|
41149
|
+
} else if (!FEATURES.SUPPORT_RANGE_BOUNDS) node = node.splitText(text.length);
|
|
40812
41150
|
offset += text.length;
|
|
40813
41151
|
});
|
|
40814
41152
|
return textBounds;
|
|
@@ -41013,9 +41351,7 @@ PERFORMANCE OF THIS SOFTWARE.
|
|
|
41013
41351
|
case CHECKBOX:
|
|
41014
41352
|
_this.styles.borderTopRightRadius = _this.styles.borderTopLeftRadius = _this.styles.borderBottomRightRadius = _this.styles.borderBottomLeftRadius = CHECKBOX_BORDER_RADIUS;
|
|
41015
41353
|
break;
|
|
41016
|
-
case RADIO:
|
|
41017
|
-
_this.styles.borderTopRightRadius = _this.styles.borderTopLeftRadius = _this.styles.borderBottomRightRadius = _this.styles.borderBottomLeftRadius = RADIO_BORDER_RADIUS;
|
|
41018
|
-
break;
|
|
41354
|
+
case RADIO: _this.styles.borderTopRightRadius = _this.styles.borderTopLeftRadius = _this.styles.borderBottomRightRadius = _this.styles.borderBottomLeftRadius = RADIO_BORDER_RADIUS;
|
|
41019
41355
|
}
|
|
41020
41356
|
return _this;
|
|
41021
41357
|
}
|
|
@@ -41069,19 +41405,21 @@ PERFORMANCE OF THIS SOFTWARE.
|
|
|
41069
41405
|
for (var childNode = node.firstChild, nextNode = void 0; childNode; childNode = nextNode) {
|
|
41070
41406
|
nextNode = childNode.nextSibling;
|
|
41071
41407
|
if (isTextNode(childNode) && childNode.data.trim().length > 0) parent.textNodes.push(new TextContainer(context, childNode, parent.styles));
|
|
41072
|
-
else if (isElementNode(childNode))
|
|
41073
|
-
|
|
41074
|
-
|
|
41075
|
-
|
|
41076
|
-
|
|
41077
|
-
|
|
41078
|
-
if (
|
|
41079
|
-
|
|
41080
|
-
|
|
41081
|
-
|
|
41082
|
-
|
|
41083
|
-
|
|
41084
|
-
|
|
41408
|
+
else if (isElementNode(childNode)) {
|
|
41409
|
+
if (isSlotElement(childNode) && childNode.assignedNodes) childNode.assignedNodes().forEach(function(childNode) {
|
|
41410
|
+
return parseNodeTree(context, childNode, parent, root);
|
|
41411
|
+
});
|
|
41412
|
+
else {
|
|
41413
|
+
var container = createContainer(context, childNode);
|
|
41414
|
+
if (container.styles.isVisible()) {
|
|
41415
|
+
if (createsRealStackingContext(childNode, container, root)) container.flags |= 4;
|
|
41416
|
+
else if (createsStackingContext(container.styles)) container.flags |= 2;
|
|
41417
|
+
if (LIST_OWNERS.indexOf(childNode.tagName) !== -1) container.flags |= 8;
|
|
41418
|
+
parent.elements.push(container);
|
|
41419
|
+
childNode.slot;
|
|
41420
|
+
if (childNode.shadowRoot) parseNodeTree(context, childNode.shadowRoot, container, root);
|
|
41421
|
+
else if (!isTextareaElement(childNode) && !isSVGElement(childNode) && !isSelectElement(childNode)) parseNodeTree(context, childNode, container, root);
|
|
41422
|
+
}
|
|
41085
41423
|
}
|
|
41086
41424
|
}
|
|
41087
41425
|
}
|
|
@@ -41718,14 +42056,16 @@ PERFORMANCE OF THIS SOFTWARE.
|
|
|
41718
42056
|
clonedCanvas.height = canvas.height;
|
|
41719
42057
|
var ctx = canvas.getContext("2d");
|
|
41720
42058
|
var clonedCtx = clonedCanvas.getContext("2d");
|
|
41721
|
-
if (clonedCtx)
|
|
41722
|
-
|
|
41723
|
-
|
|
41724
|
-
|
|
41725
|
-
|
|
41726
|
-
|
|
42059
|
+
if (clonedCtx) {
|
|
42060
|
+
if (!this.options.allowTaint && ctx) clonedCtx.putImageData(ctx.getImageData(0, 0, canvas.width, canvas.height), 0, 0);
|
|
42061
|
+
else {
|
|
42062
|
+
var gl = (_a = canvas.getContext("webgl2")) !== null && _a !== void 0 ? _a : canvas.getContext("webgl");
|
|
42063
|
+
if (gl) {
|
|
42064
|
+
var attribs = gl.getContextAttributes();
|
|
42065
|
+
if ((attribs === null || attribs === void 0 ? void 0 : attribs.preserveDrawingBuffer) === false) this.context.logger.warn("Unable to clone WebGL context as it has preserveDrawingBuffer=false", canvas);
|
|
42066
|
+
}
|
|
42067
|
+
clonedCtx.drawImage(canvas, 0, 0);
|
|
41727
42068
|
}
|
|
41728
|
-
clonedCtx.drawImage(canvas, 0, 0);
|
|
41729
42069
|
}
|
|
41730
42070
|
return clonedCanvas;
|
|
41731
42071
|
} catch (e) {
|
|
@@ -42054,18 +42394,19 @@ PERFORMANCE OF THIS SOFTWARE.
|
|
|
42054
42394
|
var responseType = FEATURES.SUPPORT_RESPONSE_TYPE ? "blob" : "text";
|
|
42055
42395
|
var xhr = new XMLHttpRequest();
|
|
42056
42396
|
xhr.onload = function() {
|
|
42057
|
-
if (xhr.status === 200)
|
|
42058
|
-
|
|
42059
|
-
|
|
42060
|
-
|
|
42061
|
-
|
|
42062
|
-
|
|
42063
|
-
|
|
42064
|
-
|
|
42065
|
-
|
|
42066
|
-
|
|
42067
|
-
|
|
42068
|
-
|
|
42397
|
+
if (xhr.status === 200) {
|
|
42398
|
+
if (responseType === "text") resolve(xhr.response);
|
|
42399
|
+
else {
|
|
42400
|
+
var reader_1 = new FileReader();
|
|
42401
|
+
reader_1.addEventListener("load", function() {
|
|
42402
|
+
return resolve(reader_1.result);
|
|
42403
|
+
}, false);
|
|
42404
|
+
reader_1.addEventListener("error", function(e) {
|
|
42405
|
+
return reject(e);
|
|
42406
|
+
}, false);
|
|
42407
|
+
reader_1.readAsDataURL(xhr.response);
|
|
42408
|
+
}
|
|
42409
|
+
} else reject("Failed to proxy resource " + key + " with status code " + xhr.status);
|
|
42069
42410
|
};
|
|
42070
42411
|
xhr.onerror = reject;
|
|
42071
42412
|
var queryString = proxy.indexOf("?") > -1 ? "&" : "?";
|
|
@@ -42803,9 +43144,7 @@ PERFORMANCE OF THIS SOFTWARE.
|
|
|
42803
43144
|
case 2:
|
|
42804
43145
|
_this.ctx.fillRect(text.bounds.left, Math.round(text.bounds.top), text.bounds.width, 1);
|
|
42805
43146
|
break;
|
|
42806
|
-
case 3:
|
|
42807
|
-
_this.ctx.fillRect(text.bounds.left, Math.ceil(text.bounds.top + middle), text.bounds.width, 1);
|
|
42808
|
-
break;
|
|
43147
|
+
case 3: _this.ctx.fillRect(text.bounds.left, Math.ceil(text.bounds.top + middle), text.bounds.width, 1);
|
|
42809
43148
|
}
|
|
42810
43149
|
});
|
|
42811
43150
|
}
|
|
@@ -42820,7 +43159,6 @@ PERFORMANCE OF THIS SOFTWARE.
|
|
|
42820
43159
|
_this.ctx.strokeStyle = "";
|
|
42821
43160
|
_this.ctx.lineWidth = 0;
|
|
42822
43161
|
_this.ctx.lineJoin = "miter";
|
|
42823
|
-
break;
|
|
42824
43162
|
}
|
|
42825
43163
|
});
|
|
42826
43164
|
});
|
|
@@ -42958,9 +43296,7 @@ PERFORMANCE OF THIS SOFTWARE.
|
|
|
42958
43296
|
case 1:
|
|
42959
43297
|
x += bounds.width / 2;
|
|
42960
43298
|
break;
|
|
42961
|
-
case 2:
|
|
42962
|
-
x += bounds.width;
|
|
42963
|
-
break;
|
|
43299
|
+
case 2: x += bounds.width;
|
|
42964
43300
|
}
|
|
42965
43301
|
textBounds = bounds.add(x, 0, 0, -bounds.height / 2 + 1);
|
|
42966
43302
|
this.ctx.save();
|
|
@@ -43475,8 +43811,10 @@ PERFORMANCE OF THIS SOFTWARE.
|
|
|
43475
43811
|
maxSpace = (length - (numberOfDashes + 1) * dashLength) / numberOfDashes;
|
|
43476
43812
|
spaceLength = maxSpace <= 0 || Math.abs(spaceLength - minSpace) < Math.abs(spaceLength - maxSpace) ? minSpace : maxSpace;
|
|
43477
43813
|
}
|
|
43478
|
-
if (useLineDash)
|
|
43479
|
-
|
|
43814
|
+
if (useLineDash) {
|
|
43815
|
+
if (style === 3) this.ctx.setLineDash([0, dashLength + spaceLength]);
|
|
43816
|
+
else this.ctx.setLineDash([dashLength, spaceLength]);
|
|
43817
|
+
}
|
|
43480
43818
|
if (style === 3) {
|
|
43481
43819
|
this.ctx.lineCap = "round";
|
|
43482
43820
|
this.ctx.lineWidth = width;
|
|
@@ -43611,8 +43949,10 @@ PERFORMANCE OF THIS SOFTWARE.
|
|
|
43611
43949
|
Logger.prototype.debug = function() {
|
|
43612
43950
|
var args = [];
|
|
43613
43951
|
for (var _i = 0; _i < arguments.length; _i++) args[_i] = arguments[_i];
|
|
43614
|
-
if (this.enabled)
|
|
43615
|
-
|
|
43952
|
+
if (this.enabled) {
|
|
43953
|
+
if (typeof window !== "undefined" && window.console && typeof console.debug === "function") console.debug.apply(console, __spreadArray([this.id, this.getTime() + "ms"], args));
|
|
43954
|
+
else this.info.apply(this, args);
|
|
43955
|
+
}
|
|
43616
43956
|
};
|
|
43617
43957
|
Logger.prototype.getTime = function() {
|
|
43618
43958
|
return Date.now() - this.start;
|
|
@@ -43627,14 +43967,18 @@ PERFORMANCE OF THIS SOFTWARE.
|
|
|
43627
43967
|
Logger.prototype.warn = function() {
|
|
43628
43968
|
var args = [];
|
|
43629
43969
|
for (var _i = 0; _i < arguments.length; _i++) args[_i] = arguments[_i];
|
|
43630
|
-
if (this.enabled)
|
|
43631
|
-
|
|
43970
|
+
if (this.enabled) {
|
|
43971
|
+
if (typeof window !== "undefined" && window.console && typeof console.warn === "function") console.warn.apply(console, __spreadArray([this.id, this.getTime() + "ms"], args));
|
|
43972
|
+
else this.info.apply(this, args);
|
|
43973
|
+
}
|
|
43632
43974
|
};
|
|
43633
43975
|
Logger.prototype.error = function() {
|
|
43634
43976
|
var args = [];
|
|
43635
43977
|
for (var _i = 0; _i < arguments.length; _i++) args[_i] = arguments[_i];
|
|
43636
|
-
if (this.enabled)
|
|
43637
|
-
|
|
43978
|
+
if (this.enabled) {
|
|
43979
|
+
if (typeof window !== "undefined" && window.console && typeof console.error === "function") console.error.apply(console, __spreadArray([this.id, this.getTime() + "ms"], args));
|
|
43980
|
+
else this.info.apply(this, args);
|
|
43981
|
+
}
|
|
43638
43982
|
};
|
|
43639
43983
|
Logger.instances = {};
|
|
43640
43984
|
return Logger;
|
|
@@ -43815,7 +44159,20 @@ var Animation = /*#__PURE__*/ function() {
|
|
|
43815
44159
|
return _createClass(Animation, [
|
|
43816
44160
|
{
|
|
43817
44161
|
key: "pending",
|
|
43818
|
-
get:
|
|
44162
|
+
get:
|
|
44163
|
+
/**
|
|
44164
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/Animation/effect
|
|
44165
|
+
*/
|
|
44166
|
+
/**
|
|
44167
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/Animation/timeline
|
|
44168
|
+
*/
|
|
44169
|
+
/**
|
|
44170
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/Animation/id
|
|
44171
|
+
*/
|
|
44172
|
+
/**
|
|
44173
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/Animation/pending
|
|
44174
|
+
*/
|
|
44175
|
+
function get() {
|
|
43819
44176
|
return this._startTime === null && !this._paused && this.playbackRate !== 0 || this.currentTimePending;
|
|
43820
44177
|
}
|
|
43821
44178
|
},
|
|
@@ -43830,7 +44187,18 @@ var Animation = /*#__PURE__*/ function() {
|
|
|
43830
44187
|
},
|
|
43831
44188
|
{
|
|
43832
44189
|
key: "ready",
|
|
43833
|
-
get:
|
|
44190
|
+
get:
|
|
44191
|
+
/**
|
|
44192
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/Animation/ready
|
|
44193
|
+
* @example
|
|
44194
|
+
animation.pause();
|
|
44195
|
+
animation.ready.then(function() {
|
|
44196
|
+
// Displays 'running'
|
|
44197
|
+
alert(animation.playState);
|
|
44198
|
+
});
|
|
44199
|
+
animation.play();
|
|
44200
|
+
*/
|
|
44201
|
+
function get() {
|
|
43834
44202
|
var _this = this;
|
|
43835
44203
|
if (!this.readyPromise) {
|
|
43836
44204
|
if (this.timeline.animationsWithPromises.indexOf(this) === -1) this.timeline.animationsWithPromises.push(this);
|
|
@@ -44864,8 +45232,10 @@ function normalizeTimingInput(timingInput, forGroup) {
|
|
|
44864
45232
|
return makeTiming(timingInput, forGroup);
|
|
44865
45233
|
}
|
|
44866
45234
|
function numericTimingToObject(timingInput) {
|
|
44867
|
-
if (typeof timingInput === "number")
|
|
44868
|
-
|
|
45235
|
+
if (typeof timingInput === "number") {
|
|
45236
|
+
if (isNaN(timingInput)) timingInput = { duration: "auto" };
|
|
45237
|
+
else timingInput = { duration: timingInput };
|
|
45238
|
+
}
|
|
44869
45239
|
return timingInput;
|
|
44870
45240
|
}
|
|
44871
45241
|
/**
|
|
@@ -45174,7 +45544,14 @@ runtime.CameraContribution = /* @__PURE__ */ function(_Camera) {
|
|
|
45174
45544
|
return _createClass(AdvancedCamera, [
|
|
45175
45545
|
{
|
|
45176
45546
|
key: "rotate",
|
|
45177
|
-
value:
|
|
45547
|
+
value:
|
|
45548
|
+
/**
|
|
45549
|
+
* Changes the azimuth and elevation with respect to the current camera axes
|
|
45550
|
+
* @param {Number} azimuth the relative azimuth
|
|
45551
|
+
* @param {Number} elevation the relative elevation
|
|
45552
|
+
* @param {Number} roll the relative roll
|
|
45553
|
+
*/
|
|
45554
|
+
function rotate(azimuth, elevation, roll) {
|
|
45178
45555
|
this.relElevation = getAngle(elevation);
|
|
45179
45556
|
this.relAzimuth = getAngle(azimuth);
|
|
45180
45557
|
this.relRoll = getAngle(roll);
|
|
@@ -46653,18 +47030,20 @@ function configure_toolbar(gobj) {
|
|
|
46653
47030
|
title: t("reset zoom")
|
|
46654
47031
|
}
|
|
46655
47032
|
];
|
|
46656
|
-
if (gobj_read_bool_attr(gobj, "with_fullscreen"))
|
|
46657
|
-
|
|
46658
|
-
|
|
46659
|
-
|
|
46660
|
-
|
|
46661
|
-
|
|
46662
|
-
|
|
46663
|
-
|
|
46664
|
-
|
|
46665
|
-
|
|
46666
|
-
|
|
46667
|
-
|
|
47033
|
+
if (gobj_read_bool_attr(gobj, "with_fullscreen")) {
|
|
47034
|
+
if (priv.is_fullscreen) items.push({
|
|
47035
|
+
id: "g6-icon-fullscreen-exit",
|
|
47036
|
+
value: "exit-fullscreen",
|
|
47037
|
+
className: "EV_EXIT_FULLSCREEN",
|
|
47038
|
+
title: t("exit full screen")
|
|
47039
|
+
});
|
|
47040
|
+
else items.push({
|
|
47041
|
+
id: "g6-icon-fullscreen",
|
|
47042
|
+
value: "request-fullscreen",
|
|
47043
|
+
className: "EV_REQUEST_FULLSCREEN",
|
|
47044
|
+
title: t("enter full screen")
|
|
47045
|
+
});
|
|
47046
|
+
}
|
|
46668
47047
|
return items;
|
|
46669
47048
|
},
|
|
46670
47049
|
onClick: (value) => {
|
|
@@ -46687,9 +47066,7 @@ function configure_toolbar(gobj) {
|
|
|
46687
47066
|
case "request-fullscreen":
|
|
46688
47067
|
gobj_send_event(gobj, "EV_REQUEST_FULLSCREEN", {}, gobj);
|
|
46689
47068
|
break;
|
|
46690
|
-
case "exit-fullscreen":
|
|
46691
|
-
gobj_send_event(gobj, "EV_EXIT_FULLSCREEN", {}, gobj);
|
|
46692
|
-
break;
|
|
47069
|
+
case "exit-fullscreen": gobj_send_event(gobj, "EV_EXIT_FULLSCREEN", {}, gobj);
|
|
46693
47070
|
}
|
|
46694
47071
|
}
|
|
46695
47072
|
});
|
|
@@ -46760,9 +47137,7 @@ function configure_toolbar_edit(gobj) {
|
|
|
46760
47137
|
case "redo":
|
|
46761
47138
|
gobj_send_event(gobj, "EV_HISTORY_REDO", {}, gobj);
|
|
46762
47139
|
break;
|
|
46763
|
-
case "save":
|
|
46764
|
-
gobj_send_event(gobj, "EV_SAVE_GRAPH", {}, gobj);
|
|
46765
|
-
break;
|
|
47140
|
+
case "save": gobj_send_event(gobj, "EV_SAVE_GRAPH", {}, gobj);
|
|
46766
47141
|
}
|
|
46767
47142
|
}
|
|
46768
47143
|
});
|
|
@@ -46803,9 +47178,7 @@ function configure_behaviour(gobj) {
|
|
|
46803
47178
|
case "operation":
|
|
46804
47179
|
priv.edit_mode = false;
|
|
46805
47180
|
break;
|
|
46806
|
-
default:
|
|
46807
|
-
log_error(`operation mode unknown: ${operation_mode}`);
|
|
46808
|
-
break;
|
|
47181
|
+
default: log_error(`operation mode unknown: ${operation_mode}`);
|
|
46809
47182
|
}
|
|
46810
47183
|
if (!priv.edit_mode) deselect_node(gobj);
|
|
46811
47184
|
graph_write_behaviors(gobj, behaviors);
|
|
@@ -46840,9 +47213,7 @@ function calculate_hooks_fkeys_counter(desc) {
|
|
|
46840
47213
|
case "hook":
|
|
46841
47214
|
desc.hooks_counter++;
|
|
46842
47215
|
break;
|
|
46843
|
-
case "fkey":
|
|
46844
|
-
desc.fkeys_counter++;
|
|
46845
|
-
break;
|
|
47216
|
+
case "fkey": desc.fkeys_counter++;
|
|
46846
47217
|
}
|
|
46847
47218
|
}
|
|
46848
47219
|
if (desc.hooks_counter === 0) desc.node_treedb_type = "child";
|
|
@@ -46882,7 +47253,6 @@ function build_ports(gobj, desc) {
|
|
|
46882
47253
|
stroke: getStrokeColor(desc.color)
|
|
46883
47254
|
};
|
|
46884
47255
|
top_ports.push(port);
|
|
46885
|
-
break;
|
|
46886
47256
|
}
|
|
46887
47257
|
}
|
|
46888
47258
|
for (let i = 0; i < top_ports.length; i++) top_ports[i].placement = [.5, 0];
|
|
@@ -47077,13 +47447,15 @@ function collect_fkey_refs(desc, record) {
|
|
|
47077
47447
|
let col = cols[i];
|
|
47078
47448
|
if (!col.fkey) continue;
|
|
47079
47449
|
let fkeys = record[col.id];
|
|
47080
|
-
if (fkeys)
|
|
47081
|
-
let
|
|
47082
|
-
|
|
47083
|
-
|
|
47084
|
-
|
|
47085
|
-
|
|
47086
|
-
|
|
47450
|
+
if (fkeys) {
|
|
47451
|
+
if (is_array(fkeys)) for (let j = 0; j < fkeys.length; j++) {
|
|
47452
|
+
let key = treedb_encoder_fkey(col, fkeys[j]);
|
|
47453
|
+
if (key) refs.add(i + " " + key);
|
|
47454
|
+
}
|
|
47455
|
+
else {
|
|
47456
|
+
let key = treedb_encoder_fkey(col, fkeys);
|
|
47457
|
+
if (key) refs.add(i + " " + key);
|
|
47458
|
+
}
|
|
47087
47459
|
}
|
|
47088
47460
|
}
|
|
47089
47461
|
return refs;
|
|
@@ -47099,8 +47471,10 @@ function draw_links(gobj, desc, record, initial_load) {
|
|
|
47099
47471
|
let col = cols[i];
|
|
47100
47472
|
if (!col.fkey) continue;
|
|
47101
47473
|
let fkeys = record[col.id];
|
|
47102
|
-
if (fkeys)
|
|
47103
|
-
|
|
47474
|
+
if (fkeys) {
|
|
47475
|
+
if (is_array(fkeys)) for (let j = 0; j < fkeys.length; j++) draw_link(gobj, topic_name, record_id, col, fkeys[j], initial_load);
|
|
47476
|
+
else draw_link(gobj, topic_name, record_id, col, fkeys, initial_load);
|
|
47477
|
+
}
|
|
47104
47478
|
}
|
|
47105
47479
|
}
|
|
47106
47480
|
/************************************************************
|
|
@@ -47210,8 +47584,10 @@ function clear_links(gobj, desc, record, verbose) {
|
|
|
47210
47584
|
let col = cols[i];
|
|
47211
47585
|
if (!col.fkey) continue;
|
|
47212
47586
|
let fkeys = record[col.id];
|
|
47213
|
-
if (fkeys)
|
|
47214
|
-
|
|
47587
|
+
if (fkeys) {
|
|
47588
|
+
if (is_array(fkeys)) for (let j = 0; j < fkeys.length; j++) clear_link(gobj, topic_name, record_id, col, fkeys[j], verbose);
|
|
47589
|
+
else clear_link(gobj, topic_name, record_id, col, fkeys, verbose);
|
|
47590
|
+
}
|
|
47215
47591
|
}
|
|
47216
47592
|
}
|
|
47217
47593
|
/************************************************************
|
|
@@ -47308,7 +47684,7 @@ function save_geometry(gobj) {
|
|
|
47308
47684
|
let origin = gobj_read_str_attr(gobj_yuno(), "node_uuid");
|
|
47309
47685
|
for (const [topic_name, properties] of Object.entries(priv._graph_properties)) {
|
|
47310
47686
|
properties.__origin__ = origin;
|
|
47311
|
-
|
|
47687
|
+
let kw_update = {
|
|
47312
47688
|
treedb_name: priv.treedb_name,
|
|
47313
47689
|
topic_name: "__graphs__",
|
|
47314
47690
|
record: {
|
|
@@ -47322,7 +47698,8 @@ function save_geometry(gobj) {
|
|
|
47322
47698
|
autolink: false,
|
|
47323
47699
|
create: true
|
|
47324
47700
|
}
|
|
47325
|
-
}
|
|
47701
|
+
};
|
|
47702
|
+
gobj_publish_event(gobj, "EV_UPDATE_NODE", kw_update);
|
|
47326
47703
|
}
|
|
47327
47704
|
}
|
|
47328
47705
|
/************************************************************
|
|
@@ -47333,7 +47710,7 @@ function save_topic_graph_properties(gobj, topic_name) {
|
|
|
47333
47710
|
let properties = priv._graph_properties[topic_name];
|
|
47334
47711
|
if (!properties) return;
|
|
47335
47712
|
properties.__origin__ = gobj_read_str_attr(gobj_yuno(), "node_uuid");
|
|
47336
|
-
|
|
47713
|
+
let kw_update = {
|
|
47337
47714
|
treedb_name: priv.treedb_name,
|
|
47338
47715
|
topic_name: "__graphs__",
|
|
47339
47716
|
record: {
|
|
@@ -47347,7 +47724,8 @@ function save_topic_graph_properties(gobj, topic_name) {
|
|
|
47347
47724
|
autolink: false,
|
|
47348
47725
|
create: true
|
|
47349
47726
|
}
|
|
47350
|
-
}
|
|
47727
|
+
};
|
|
47728
|
+
gobj_publish_event(gobj, "EV_UPDATE_NODE", kw_update);
|
|
47351
47729
|
}
|
|
47352
47730
|
/************************************************************
|
|
47353
47731
|
* Pause/resume history recording.
|
|
@@ -47536,19 +47914,17 @@ function graph_add_plugin(gobj, plugin_key, options) {
|
|
|
47536
47914
|
}
|
|
47537
47915
|
plugin = graph_get_plugin(gobj, plugin_key);
|
|
47538
47916
|
switch (plugin_key) {
|
|
47539
|
-
case "history":
|
|
47540
|
-
|
|
47541
|
-
|
|
47542
|
-
|
|
47543
|
-
|
|
47544
|
-
|
|
47545
|
-
|
|
47546
|
-
|
|
47547
|
-
|
|
47548
|
-
|
|
47549
|
-
|
|
47550
|
-
}
|
|
47551
|
-
break;
|
|
47917
|
+
case "history": if (plugin) {
|
|
47918
|
+
plugin.on(HistoryEvent.CHANGE, () => {
|
|
47919
|
+
update_history_buttons(gobj);
|
|
47920
|
+
});
|
|
47921
|
+
graph.updatePlugin({
|
|
47922
|
+
key: plugin_key,
|
|
47923
|
+
beforeAddCommand: () => {
|
|
47924
|
+
return !priv._history_paused;
|
|
47925
|
+
}
|
|
47926
|
+
});
|
|
47927
|
+
}
|
|
47552
47928
|
}
|
|
47553
47929
|
}
|
|
47554
47930
|
function graph_remove_plugin(gobj, plugin_key) {
|
|
@@ -49587,9 +49963,7 @@ function handle_context_menu_click(gobj, value) {
|
|
|
49587
49963
|
case "resize_all_ports":
|
|
49588
49964
|
copy_size_to_ports(gobj, false);
|
|
49589
49965
|
break;
|
|
49590
|
-
case "resize_topic_ports":
|
|
49591
|
-
copy_size_to_ports(gobj, true);
|
|
49592
|
-
break;
|
|
49966
|
+
case "resize_topic_ports": copy_size_to_ports(gobj, true);
|
|
49593
49967
|
}
|
|
49594
49968
|
}
|
|
49595
49969
|
/************************************************************
|
|
@@ -50377,7 +50751,7 @@ function create_gclass$1(gclass_name) {
|
|
|
50377
50751
|
null
|
|
50378
50752
|
]
|
|
50379
50753
|
]]];
|
|
50380
|
-
|
|
50754
|
+
const event_types = [
|
|
50381
50755
|
["EV_DESCS", 0],
|
|
50382
50756
|
["EV_CLEAR_DATA", 0],
|
|
50383
50757
|
["EV_LOAD_DATA", 0],
|
|
@@ -50414,7 +50788,8 @@ function create_gclass$1(gclass_name) {
|
|
|
50414
50788
|
["EV_HIDE", 0],
|
|
50415
50789
|
["EV_RESIZE", 0],
|
|
50416
50790
|
["EV_THEME", 0]
|
|
50417
|
-
]
|
|
50791
|
+
];
|
|
50792
|
+
__gclass__$1 = gclass_create(gclass_name, event_types, states, gmt$1, 0, attrs_table$1, PRIVATE_DATA$1, 0, 0, 0, gclass_flag_t.gcflag_manual_start);
|
|
50418
50793
|
if (!__gclass__$1) return -1;
|
|
50419
50794
|
return 0;
|
|
50420
50795
|
}
|
|
@@ -50565,22 +50940,22 @@ var YUI_ROLLING = {
|
|
|
50565
50940
|
},
|
|
50566
50941
|
"6h": {
|
|
50567
50942
|
id: "6h",
|
|
50568
|
-
secs:
|
|
50943
|
+
secs: 21600,
|
|
50569
50944
|
label: "last 6h"
|
|
50570
50945
|
},
|
|
50571
50946
|
"24h": {
|
|
50572
50947
|
id: "24h",
|
|
50573
|
-
secs:
|
|
50948
|
+
secs: 86400,
|
|
50574
50949
|
label: "last 24h"
|
|
50575
50950
|
},
|
|
50576
50951
|
"7d": {
|
|
50577
50952
|
id: "7d",
|
|
50578
|
-
secs:
|
|
50953
|
+
secs: 604800,
|
|
50579
50954
|
label: "last 7 days"
|
|
50580
50955
|
},
|
|
50581
50956
|
"30d": {
|
|
50582
50957
|
id: "30d",
|
|
50583
|
-
secs:
|
|
50958
|
+
secs: 2592e3,
|
|
50584
50959
|
label: "last 30 days"
|
|
50585
50960
|
}
|
|
50586
50961
|
};
|
|
@@ -51943,7 +52318,8 @@ function ac_set_mode(gobj, event, kw, src) {
|
|
|
51943
52318
|
*
|
|
51944
52319
|
***************************************************************/
|
|
51945
52320
|
function ac_prev(gobj, event, kw, src) {
|
|
51946
|
-
|
|
52321
|
+
let mode = cur_mode(gobj);
|
|
52322
|
+
gobj_write_attr(gobj, "anchor", period_shift(mode.spec, gobj_read_integer_attr(gobj, "anchor"), -1));
|
|
51947
52323
|
close_calendar(gobj);
|
|
51948
52324
|
repaint(gobj);
|
|
51949
52325
|
publish_period(gobj);
|
|
@@ -51953,7 +52329,8 @@ function ac_prev(gobj, event, kw, src) {
|
|
|
51953
52329
|
*
|
|
51954
52330
|
***************************************************************/
|
|
51955
52331
|
function ac_next(gobj, event, kw, src) {
|
|
51956
|
-
|
|
52332
|
+
let mode = cur_mode(gobj);
|
|
52333
|
+
gobj_write_attr(gobj, "anchor", period_shift(mode.spec, gobj_read_integer_attr(gobj, "anchor"), 1));
|
|
51957
52334
|
close_calendar(gobj);
|
|
51958
52335
|
repaint(gobj);
|
|
51959
52336
|
publish_period(gobj);
|
|
@@ -52131,7 +52508,7 @@ function create_gclass(gclass_name) {
|
|
|
52131
52508
|
null
|
|
52132
52509
|
]
|
|
52133
52510
|
]]];
|
|
52134
|
-
|
|
52511
|
+
const event_types = [
|
|
52135
52512
|
["EV_SET_MODE", 0],
|
|
52136
52513
|
["EV_PREV", 0],
|
|
52137
52514
|
["EV_NEXT", 0],
|
|
@@ -52142,7 +52519,8 @@ function create_gclass(gclass_name) {
|
|
|
52142
52519
|
["EV_REFRESH", 0],
|
|
52143
52520
|
["EV_LANGUAGE_CHANGED", 0],
|
|
52144
52521
|
["EV_PERIOD_CHANGED", event_flag_t.EVF_OUTPUT_EVENT]
|
|
52145
|
-
]
|
|
52522
|
+
];
|
|
52523
|
+
__gclass__ = gclass_create(gclass_name, event_types, states, gmt, 0, attrs_table, PRIVATE_DATA, 0, 0, 0, 0);
|
|
52146
52524
|
if (!__gclass__) return -1;
|
|
52147
52525
|
return 0;
|
|
52148
52526
|
}
|
|
@@ -52242,8 +52620,8 @@ function traffic_now() {
|
|
|
52242
52620
|
function traffic_size(n) {
|
|
52243
52621
|
n = Number(n) || 0;
|
|
52244
52622
|
if (n < 1024) return n + " B";
|
|
52245
|
-
if (n <
|
|
52246
|
-
return (n /
|
|
52623
|
+
if (n < 1048576) return (n / 1024).toFixed(1) + " KB";
|
|
52624
|
+
return (n / 1048576).toFixed(1) + " MB";
|
|
52247
52625
|
}
|
|
52248
52626
|
/************************************************************
|
|
52249
52627
|
* Seconds-since-epoch → ISO string, or null if not a plausible
|
|
@@ -52326,7 +52704,8 @@ function set_output_route(v) {
|
|
|
52326
52704
|
refresh_dev_chrome();
|
|
52327
52705
|
}
|
|
52328
52706
|
function toggle_pref(key, def) {
|
|
52329
|
-
|
|
52707
|
+
let v = dev_num(key, def) ? 0 : 1;
|
|
52708
|
+
kw_set_local_storage_value(key, v);
|
|
52330
52709
|
rerender_all();
|
|
52331
52710
|
refresh_dev_chrome();
|
|
52332
52711
|
}
|
|
@@ -53586,7 +53965,7 @@ function apply_dev_traces() {
|
|
|
53586
53965
|
function setup_dev(self, show) {
|
|
53587
53966
|
if (show) {
|
|
53588
53967
|
ensure_dev_style();
|
|
53589
|
-
|
|
53968
|
+
let win = gobj_create_service("Developer-Window", "C_YUI_WINDOW", {
|
|
53590
53969
|
$parent: document.getElementById("top-layer") || null,
|
|
53591
53970
|
subscriber: null,
|
|
53592
53971
|
showMax: true,
|
|
@@ -53603,7 +53982,8 @@ function setup_dev(self, show) {
|
|
|
53603
53982
|
on_close: function() {
|
|
53604
53983
|
kw_set_local_storage_value("open_developer_window", 0);
|
|
53605
53984
|
}
|
|
53606
|
-
}, self)
|
|
53985
|
+
}, self);
|
|
53986
|
+
gobj_start(win);
|
|
53607
53987
|
kw_set_local_storage_value("open_developer_window", 1);
|
|
53608
53988
|
setTimeout(() => {
|
|
53609
53989
|
refresh_dev_chrome();
|
|
@@ -53707,7 +54087,8 @@ function setup_frontend_view(self) {
|
|
|
53707
54087
|
log_error("yui_frontend_view: cannot create the frontend-view window");
|
|
53708
54088
|
return null;
|
|
53709
54089
|
}
|
|
53710
|
-
let
|
|
54090
|
+
let tree = gobj_create_pure_child("frontend_view_tree", "C_YUI_GOBJ_TREE_JS", {}, win);
|
|
54091
|
+
let $tree = gobj_read_attr(tree, "$container");
|
|
53711
54092
|
if (!$tree) {
|
|
53712
54093
|
log_error("yui_frontend_view: C_YUI_GOBJ_TREE_JS without $container");
|
|
53713
54094
|
return win;
|
|
@@ -53717,6 +54098,6 @@ function setup_frontend_view(self) {
|
|
|
53717
54098
|
return win;
|
|
53718
54099
|
}
|
|
53719
54100
|
//#endregion
|
|
53720
|
-
export { EditControl, MarkerControl, YUI_PERIODS, YUI_PERIODS_DEFAULT, YUI_ROLLING, addClasses, apply_dev_traces, attach_clear, build_dev_panel, dev_window_was_open, disableElements, enableElements, epoch_to_local_input, epoch_to_ms, expose_view_container, fmt_epoch, getStrokeColor, infer_period, info_traffic, inject_svg_icons, is_current_period, iso_week, local_input_to_epoch, ms_to_epoch, period_bounds, period_bounds_epoch, period_label, period_name, period_shift, period_spec, period_start, refresh_clear, register_c_g6_nodes_tree, register_c_yui_form, register_c_yui_gobj_tree_js, register_c_yui_json, register_c_yui_json_graph, register_c_yui_map, register_c_yui_nav, register_c_yui_pager, register_c_yui_period, register_c_yui_service_view, register_c_yui_shell, register_c_yui_treedb_graph, register_c_yui_treedb_schema, register_c_yui_treedb_topic_with_form, register_c_yui_treedb_topics, register_c_yui_uplot, register_c_yui_window, register_c_yui_window_manager, register_c_yui_wizard, removeChildElements, removeClasses, rolling_bounds, safe_locale, set_active_state, set_cancel_state, set_submit_state, setup_dev, setup_frontend_view, toggleClasses, yui_is_dark, yui_mount_service_view, yui_shell_close_drawer, yui_shell_close_dropdown, yui_shell_confirm_ok, yui_shell_confirm_yesno, yui_shell_confirm_yesnocancel, yui_shell_navigate, yui_shell_open_drawer, yui_shell_overlay_dismissed, yui_shell_pop_escape, yui_shell_push_escape, yui_shell_refresh_avatars, yui_shell_register_event_handler, yui_shell_register_overlay, yui_shell_set_avatar_provider, yui_shell_set_connection_state, yui_shell_set_sub_routes, yui_shell_set_toolbar_item_badge, yui_shell_set_toolbar_item_icon, yui_shell_set_translator, yui_shell_show_error, yui_shell_show_info, yui_shell_show_modal, yui_shell_show_route_map, yui_shell_show_warning, yui_shell_toggle_drawer, yui_shell_unpark_route, yui_theme_now, yui_toolbar, yui_watch_theme };
|
|
54101
|
+
export { EditControl, MarkerControl, YUI_PERIODS, YUI_PERIODS_DEFAULT, YUI_ROLLING, addClasses, apply_dev_traces, attach_clear, build_dev_panel, dev_window_was_open, disableElements, enableElements, epoch_to_local_input, epoch_to_ms, expose_view_container, fmt_epoch, getStrokeColor, infer_period, info_traffic, inject_svg_icons, is_current_period, iso_week, local_input_to_epoch, ms_to_epoch, period_bounds, period_bounds_epoch, period_label, period_name, period_shift, period_spec, period_start, refresh_clear, register_c_g6_nodes_tree, register_c_yui_form, register_c_yui_gobj_tree_js, register_c_yui_json, register_c_yui_json_graph, register_c_yui_map, register_c_yui_nav, register_c_yui_pager, register_c_yui_period, register_c_yui_service_view, register_c_yui_shell, register_c_yui_treedb_graph, register_c_yui_treedb_schema, register_c_yui_treedb_topic_with_form, register_c_yui_treedb_topics, register_c_yui_uplot, register_c_yui_window, register_c_yui_window_manager, register_c_yui_wizard, removeChildElements, removeClasses, rolling_bounds, safe_locale, set_active_state, set_cancel_state, set_submit_state, setup_dev, setup_frontend_view, toggleClasses, yui_is_dark, yui_mount_service_view, yui_shell_close_drawer, yui_shell_close_dropdown, yui_shell_confirm_danger, yui_shell_confirm_ok, yui_shell_confirm_yesno, yui_shell_confirm_yesnocancel, yui_shell_navigate, yui_shell_open_drawer, yui_shell_overlay_dismissed, yui_shell_pop_escape, yui_shell_push_escape, yui_shell_refresh_avatars, yui_shell_register_event_handler, yui_shell_register_overlay, yui_shell_set_avatar_provider, yui_shell_set_connection_state, yui_shell_set_sub_routes, yui_shell_set_toolbar_item_badge, yui_shell_set_toolbar_item_icon, yui_shell_set_translator, yui_shell_show_error, yui_shell_show_info, yui_shell_show_modal, yui_shell_show_route_map, yui_shell_show_warning, yui_shell_toggle_drawer, yui_shell_unpark_route, yui_theme_now, yui_toolbar, yui_watch_theme };
|
|
53721
54102
|
|
|
53722
54103
|
//# sourceMappingURL=gobj-ui.es.js.map
|