@yuneta/gobj-ui 7.26.31 → 7.26.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +237 -72
- package/dist/gobj-ui.cjs.js +26 -18
- package/dist/gobj-ui.es.js +26 -18
- package/package.json +1 -1
- package/scripts/validate-locales.mjs +1755 -328
- package/src/c_g6_nodes_tree.js +6 -4
- package/src/c_yui_form.js +15 -9
- package/src/c_yui_treedb_graph.js +6 -3
- package/src/c_yui_treedb_topics.js +6 -3
- package/src/form_template_field.wiring.test.js +160 -0
- package/src/i18n_key_functions.js +54 -31
- package/src/i18n_key_functions.test.js +461 -49
- package/src/yui_table_select.js +20 -13
package/dist/gobj-ui.es.js
CHANGED
|
@@ -10706,7 +10706,9 @@ function get_form_values(gobj, $form) {
|
|
|
10706
10706
|
else value = value_.text;
|
|
10707
10707
|
}
|
|
10708
10708
|
break;
|
|
10709
|
-
case "fieldset":
|
|
10709
|
+
case "fieldset":
|
|
10710
|
+
value = {};
|
|
10711
|
+
break;
|
|
10710
10712
|
case "table":
|
|
10711
10713
|
let template = gobj_read_attr(gobj, "template");
|
|
10712
10714
|
if (!empty_string(name) && kw_has_key(template, name)) {
|
|
@@ -10728,7 +10730,7 @@ function get_form_values(gobj, $form) {
|
|
|
10728
10730
|
break;
|
|
10729
10731
|
default: log_error(sprintf("%s: $form type unknown: '%s'", gobj_short_name(gobj), tag));
|
|
10730
10732
|
}
|
|
10731
|
-
value = form_value_2_treedb_value(gobj, field_desc, value);
|
|
10733
|
+
if (tag !== "fieldset") value = form_value_2_treedb_value(gobj, field_desc, value);
|
|
10732
10734
|
let path;
|
|
10733
10735
|
if (empty_string(prefix)) path = name;
|
|
10734
10736
|
else path = prefix + "`" + name;
|
|
@@ -27185,12 +27187,14 @@ function answer_print_tranger_refused$1(gobj, path, answer) {
|
|
|
27185
27187
|
}
|
|
27186
27188
|
/************************************************************
|
|
27187
27189
|
* The text of a transport's refusal: gobj_command() answers a string,
|
|
27188
|
-
* a command response or a number.
|
|
27190
|
+
* a command response or a number. Data only ("" when it says
|
|
27191
|
+
* nothing): the caller writes its own key as the fallback, where
|
|
27192
|
+
* validate-locales reads it.
|
|
27189
27193
|
************************************************************/
|
|
27190
27194
|
function refusal_text$1(ret) {
|
|
27191
27195
|
if (typeof ret === "string" && ret) return ret;
|
|
27192
27196
|
if (ret && typeof ret === "object" && typeof ret.comment === "string" && ret.comment) return ret.comment;
|
|
27193
|
-
return "
|
|
27197
|
+
return "";
|
|
27194
27198
|
}
|
|
27195
27199
|
/************************************************************
|
|
27196
27200
|
* The whole tranger, for the raw-json viewer.
|
|
@@ -27218,7 +27222,7 @@ function request_print_tranger$1(gobj, path) {
|
|
|
27218
27222
|
}, gobj);
|
|
27219
27223
|
if (ret) {
|
|
27220
27224
|
log_error(ret);
|
|
27221
|
-
answer_print_tranger_refused$1(gobj, path, { error: refusal_text$1(ret) });
|
|
27225
|
+
answer_print_tranger_refused$1(gobj, path, { error: refusal_text$1(ret) || "print-tranger failed" });
|
|
27222
27226
|
return;
|
|
27223
27227
|
}
|
|
27224
27228
|
if (path) priv.drills_in_flight.add(path);
|
|
@@ -28359,8 +28363,8 @@ function yui_clear_selection(tabulator) {
|
|
|
28359
28363
|
* through `refresh_language()`. Call it on EV_LANGUAGE_CHANGED.
|
|
28360
28364
|
***************************************************************/
|
|
28361
28365
|
function yui_selection_bar(t, opts) {
|
|
28362
|
-
|
|
28363
|
-
|
|
28366
|
+
const o = opts || {};
|
|
28367
|
+
const actions = Array.isArray(o.actions) ? o.actions : [];
|
|
28364
28368
|
let name = o.name || "TABLE";
|
|
28365
28369
|
let count = 0;
|
|
28366
28370
|
let $count = createElement2([
|
|
@@ -28387,7 +28391,6 @@ function yui_selection_bar(t, opts) {
|
|
|
28387
28391
|
]],
|
|
28388
28392
|
{ click: action.on_click }
|
|
28389
28393
|
]);
|
|
28390
|
-
$b._yui_label = action.label || "";
|
|
28391
28394
|
$buttons.push($b);
|
|
28392
28395
|
}
|
|
28393
28396
|
let $clear = createElement2([
|
|
@@ -28420,15 +28423,18 @@ function yui_selection_bar(t, opts) {
|
|
|
28420
28423
|
function label_of($b) {
|
|
28421
28424
|
return $b.querySelector("span.icon ~ span");
|
|
28422
28425
|
}
|
|
28426
|
+
function paint_label($b, key) {
|
|
28427
|
+
let $label = label_of($b);
|
|
28428
|
+
if ($label && key) $label.textContent = t(key);
|
|
28429
|
+
$b.title = key ? t(key) : "";
|
|
28430
|
+
$b.setAttribute("aria-label", $b.title);
|
|
28431
|
+
}
|
|
28423
28432
|
function refresh() {
|
|
28424
28433
|
$count.textContent = t("{{n}} selected", { n: count });
|
|
28425
|
-
|
|
28426
|
-
|
|
28427
|
-
|
|
28428
|
-
|
|
28429
|
-
$b.title = key ? t(key) : "";
|
|
28430
|
-
$b.setAttribute("aria-label", $b.title);
|
|
28431
|
-
}
|
|
28434
|
+
actions.forEach((action, i) => {
|
|
28435
|
+
paint_label($buttons[i], action.label || "");
|
|
28436
|
+
});
|
|
28437
|
+
paint_label($clear, "clear selection");
|
|
28432
28438
|
$el.classList.toggle("is-hidden", count <= 0);
|
|
28433
28439
|
}
|
|
28434
28440
|
function set_count(n) {
|
|
@@ -71273,12 +71279,14 @@ function answer_print_tranger_refused(gobj, path, answer) {
|
|
|
71273
71279
|
}
|
|
71274
71280
|
/************************************************************
|
|
71275
71281
|
* The text of a transport's refusal: gobj_command() answers a string,
|
|
71276
|
-
* a command response or a number.
|
|
71282
|
+
* a command response or a number. Data only ("" when it says
|
|
71283
|
+
* nothing): the caller writes its own key as the fallback, where
|
|
71284
|
+
* validate-locales reads it.
|
|
71277
71285
|
************************************************************/
|
|
71278
71286
|
function refusal_text(ret) {
|
|
71279
71287
|
if (typeof ret === "string" && ret) return ret;
|
|
71280
71288
|
if (ret && typeof ret === "object" && typeof ret.comment === "string" && ret.comment) return ret.comment;
|
|
71281
|
-
return "
|
|
71289
|
+
return "";
|
|
71282
71290
|
}
|
|
71283
71291
|
/************************************************************
|
|
71284
71292
|
* Fetch the treedb's raw tranger (or one subtree when `path` is set) as
|
|
@@ -71307,7 +71315,7 @@ function request_print_tranger(gobj, path) {
|
|
|
71307
71315
|
}, gobj);
|
|
71308
71316
|
if (ret) {
|
|
71309
71317
|
log_error(ret);
|
|
71310
|
-
answer_print_tranger_refused(gobj, path, { error: refusal_text(ret) });
|
|
71318
|
+
answer_print_tranger_refused(gobj, path, { error: refusal_text(ret) || "print-tranger failed" });
|
|
71311
71319
|
return;
|
|
71312
71320
|
}
|
|
71313
71321
|
if (path) priv.drills_in_flight.add(path);
|