@yuneta/gobj-ui 7.26.30 → 7.26.32

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.
@@ -4050,7 +4050,7 @@ var MOBILE_MAX = 768;
4050
4050
  ***************************************************************/
4051
4051
  var attrs_table$21 = [
4052
4052
  (0, _yuneta_gobj_js.SDATA)(_yuneta_gobj_js.data_type_t.DTP_POINTER, "subscriber", 0, null, "Subscriber of output events"),
4053
- (0, _yuneta_gobj_js.SDATA)(_yuneta_gobj_js.data_type_t.DTP_POINTER, "$parent", 0, null, "$container will be appended to $parent if not null, else to document.body"),
4053
+ (0, _yuneta_gobj_js.SDATA)(_yuneta_gobj_js.data_type_t.DTP_POINTER, "$parent", 0, null, "$container will be appended to $parent if not null, else to the overlay layer of the shell (document.body when there is none)"),
4054
4054
  (0, _yuneta_gobj_js.SDATA)(_yuneta_gobj_js.data_type_t.DTP_INTEGER, "x", 0, "300", "X position"),
4055
4055
  (0, _yuneta_gobj_js.SDATA)(_yuneta_gobj_js.data_type_t.DTP_INTEGER, "y", 0, "100", "Y position"),
4056
4056
  (0, _yuneta_gobj_js.SDATA)(_yuneta_gobj_js.data_type_t.DTP_INTEGER, "width", 0, "700", "Width of the window"),
@@ -4545,8 +4545,8 @@ function build_ui$18(gobj) {
4545
4545
  }
4546
4546
  (0, _yuneta_gobj_js.refresh_language)($container, i18next.t);
4547
4547
  let $parent = (0, _yuneta_gobj_js.gobj_read_attr)(gobj, "$parent");
4548
- if ($parent) $parent.appendChild($container);
4549
- else document.body.appendChild($container);
4548
+ if (!$parent) $parent = default_parent(gobj);
4549
+ $parent.appendChild($container);
4550
4550
  if ((0, _yuneta_gobj_js.gobj_read_bool_attr)(gobj, "openMaximized")) max$2(gobj);
4551
4551
  else if (!mobile) {
4552
4552
  if ((0, _yuneta_gobj_js.gobj_read_bool_attr)(gobj, "content_size")) $container.style.height = "auto";
@@ -4632,6 +4632,30 @@ function close_window(gobj) {
4632
4632
  };
4633
4633
  }
4634
4634
  /************************************************************
4635
+ * Where a window lives when its host names no `$parent`: the
4636
+ * OVERLAY layer of the shell -- above the content, below the
4637
+ * toolbar's dropdowns, the dialogs and the toasts.
4638
+ *
4639
+ * It used to be document.body, and that put every window above
4640
+ * the WHOLE shell: `.yui-shell` is position:fixed, a stacking
4641
+ * context of its own, so the z-index of its modal layer (99)
4642
+ * counted only inside it, and a window at z-index 11 on the body
4643
+ * covered it. The confirmation a window's own close asks ("all
4644
+ * changes will be lost") opened UNDER the window that asked it,
4645
+ * where no click could reach it; a toast, a dropdown of the
4646
+ * toolbar, any dialog opened with a window on screen, the same.
4647
+ *
4648
+ * Inside the layer the dock's z-index still orders the windows
4649
+ * among themselves. No shell (a page with windows and no shell):
4650
+ * the body, as before.
4651
+ ************************************************************/
4652
+ function default_parent(gobj) {
4653
+ let shell = yui_shell_of(gobj);
4654
+ let layers = shell && shell.priv && shell.priv.layers;
4655
+ if (layers && layers.overlay) return layers.overlay;
4656
+ return document.body;
4657
+ }
4658
+ /************************************************************
4635
4659
  *
4636
4660
  ************************************************************/
4637
4661
  function toggle(gobj) {
@@ -6734,7 +6758,9 @@ function yui_tabulator_name_filters(table, t) {
6734
6758
  let $title = $el.querySelector(".tabulator-col-title");
6735
6759
  if (!title && $title) title = $title.textContent.trim();
6736
6760
  if (!title) continue;
6737
- $input.setAttribute("aria-label", t("filter by column", { column: title }));
6761
+ let name = t("filter by column", { column: title });
6762
+ $input.setAttribute("aria-label", name);
6763
+ $input.setAttribute("title", name);
6738
6764
  }
6739
6765
  } catch (e) {}
6740
6766
  }
@@ -6765,6 +6791,8 @@ function yui_tabulator_name_row_selects(table, t) {
6765
6791
  for (let $box of boxes) {
6766
6792
  $box.setAttribute("aria-label", t("select row"));
6767
6793
  $box.setAttribute("data-i18n-aria-label", "select row");
6794
+ $box.setAttribute("title", t("select row"));
6795
+ $box.setAttribute("data-i18n-title", "select row");
6768
6796
  }
6769
6797
  } catch (e) {}
6770
6798
  }
@@ -9163,11 +9191,19 @@ function name_form_control$1($field, conf) {
9163
9191
  $control.setAttribute("aria-label", (0, i18next.t)(key));
9164
9192
  $control.setAttribute("data-i18n-aria-label", key);
9165
9193
  }
9194
+ if ($control && !$control.getAttribute("title")) {
9195
+ $control.setAttribute("title", (0, i18next.t)(key));
9196
+ $control.setAttribute("data-i18n-title", key);
9197
+ }
9166
9198
  let $ts = $field.querySelector(".ts-control input");
9167
9199
  if ($ts && !$ts.getAttribute("aria-label")) {
9168
9200
  $ts.setAttribute("aria-label", (0, i18next.t)(key));
9169
9201
  $ts.setAttribute("data-i18n-aria-label", key);
9170
9202
  }
9203
+ if ($ts && !$ts.getAttribute("title")) {
9204
+ $ts.setAttribute("title", (0, i18next.t)(key));
9205
+ $ts.setAttribute("data-i18n-title", key);
9206
+ }
9171
9207
  let $clear = $field.querySelector(".ts-wrapper .clear-button");
9172
9208
  if ($clear) {
9173
9209
  const CLEAR_KEY = "remove all selected options";
@@ -10257,6 +10293,8 @@ function create_coordinates(gobj, attrs) {
10257
10293
  type: "text",
10258
10294
  placeholder: (0, i18next.t)("coordinates..."),
10259
10295
  "data-i18n-placeholder": "coordinates...",
10296
+ title: (0, i18next.t)("coordinates"),
10297
+ "data-i18n-title": "coordinates",
10260
10298
  "aria-label": (0, i18next.t)("coordinates"),
10261
10299
  "data-i18n-aria-label": "coordinates"
10262
10300
  },
@@ -27152,12 +27190,14 @@ function answer_print_tranger_refused$1(gobj, path, answer) {
27152
27190
  }
27153
27191
  /************************************************************
27154
27192
  * The text of a transport's refusal: gobj_command() answers a string,
27155
- * a command response or a number.
27193
+ * a command response or a number. Data only ("" when it says
27194
+ * nothing): the caller writes its own key as the fallback, where
27195
+ * validate-locales reads it.
27156
27196
  ************************************************************/
27157
27197
  function refusal_text$1(ret) {
27158
27198
  if (typeof ret === "string" && ret) return ret;
27159
27199
  if (ret && typeof ret === "object" && typeof ret.comment === "string" && ret.comment) return ret.comment;
27160
- return "print-tranger failed";
27200
+ return "";
27161
27201
  }
27162
27202
  /************************************************************
27163
27203
  * The whole tranger, for the raw-json viewer.
@@ -27185,7 +27225,7 @@ function request_print_tranger$1(gobj, path) {
27185
27225
  }, gobj);
27186
27226
  if (ret) {
27187
27227
  (0, _yuneta_gobj_js.log_error)(ret);
27188
- answer_print_tranger_refused$1(gobj, path, { error: refusal_text$1(ret) });
27228
+ answer_print_tranger_refused$1(gobj, path, { error: refusal_text$1(ret) || "print-tranger failed" });
27189
27229
  return;
27190
27230
  }
27191
27231
  if (path) priv.drills_in_flight.add(path);
@@ -28326,8 +28366,8 @@ function yui_clear_selection(tabulator) {
28326
28366
  * through `refresh_language()`. Call it on EV_LANGUAGE_CHANGED.
28327
28367
  ***************************************************************/
28328
28368
  function yui_selection_bar(t, opts) {
28329
- let o = opts || {};
28330
- let actions = Array.isArray(o.actions) ? o.actions : [];
28369
+ const o = opts || {};
28370
+ const actions = Array.isArray(o.actions) ? o.actions : [];
28331
28371
  let name = o.name || "TABLE";
28332
28372
  let count = 0;
28333
28373
  let $count = (0, _yuneta_gobj_js.createElement2)([
@@ -28354,7 +28394,6 @@ function yui_selection_bar(t, opts) {
28354
28394
  ]],
28355
28395
  { click: action.on_click }
28356
28396
  ]);
28357
- $b._yui_label = action.label || "";
28358
28397
  $buttons.push($b);
28359
28398
  }
28360
28399
  let $clear = (0, _yuneta_gobj_js.createElement2)([
@@ -28387,15 +28426,18 @@ function yui_selection_bar(t, opts) {
28387
28426
  function label_of($b) {
28388
28427
  return $b.querySelector("span.icon ~ span");
28389
28428
  }
28429
+ function paint_label($b, key) {
28430
+ let $label = label_of($b);
28431
+ if ($label && key) $label.textContent = t(key);
28432
+ $b.title = key ? t(key) : "";
28433
+ $b.setAttribute("aria-label", $b.title);
28434
+ }
28390
28435
  function refresh() {
28391
28436
  $count.textContent = t("{{n}} selected", { n: count });
28392
- for (let $b of $buttons.concat([$clear])) {
28393
- let $label = label_of($b);
28394
- const key = $b === $clear ? "clear selection" : $b._yui_label;
28395
- if ($label && key) $label.textContent = t(key);
28396
- $b.title = key ? t(key) : "";
28397
- $b.setAttribute("aria-label", $b.title);
28398
- }
28437
+ actions.forEach((action, i) => {
28438
+ paint_label($buttons[i], action.label || "");
28439
+ });
28440
+ paint_label($clear, "clear selection");
28399
28441
  $el.classList.toggle("is-hidden", count <= 0);
28400
28442
  }
28401
28443
  function set_count(n) {
@@ -71240,12 +71282,14 @@ function answer_print_tranger_refused(gobj, path, answer) {
71240
71282
  }
71241
71283
  /************************************************************
71242
71284
  * The text of a transport's refusal: gobj_command() answers a string,
71243
- * a command response or a number.
71285
+ * a command response or a number. Data only ("" when it says
71286
+ * nothing): the caller writes its own key as the fallback, where
71287
+ * validate-locales reads it.
71244
71288
  ************************************************************/
71245
71289
  function refusal_text(ret) {
71246
71290
  if (typeof ret === "string" && ret) return ret;
71247
71291
  if (ret && typeof ret === "object" && typeof ret.comment === "string" && ret.comment) return ret.comment;
71248
- return "print-tranger failed";
71292
+ return "";
71249
71293
  }
71250
71294
  /************************************************************
71251
71295
  * Fetch the treedb's raw tranger (or one subtree when `path` is set) as
@@ -71274,7 +71318,7 @@ function request_print_tranger(gobj, path) {
71274
71318
  }, gobj);
71275
71319
  if (ret) {
71276
71320
  (0, _yuneta_gobj_js.log_error)(ret);
71277
- answer_print_tranger_refused(gobj, path, { error: refusal_text(ret) });
71321
+ answer_print_tranger_refused(gobj, path, { error: refusal_text(ret) || "print-tranger failed" });
71278
71322
  return;
71279
71323
  }
71280
71324
  if (path) priv.drills_in_flight.add(path);
@@ -4045,7 +4045,7 @@ var MOBILE_MAX = 768;
4045
4045
  ***************************************************************/
4046
4046
  var attrs_table$21 = [
4047
4047
  SDATA(data_type_t.DTP_POINTER, "subscriber", 0, null, "Subscriber of output events"),
4048
- SDATA(data_type_t.DTP_POINTER, "$parent", 0, null, "$container will be appended to $parent if not null, else to document.body"),
4048
+ SDATA(data_type_t.DTP_POINTER, "$parent", 0, null, "$container will be appended to $parent if not null, else to the overlay layer of the shell (document.body when there is none)"),
4049
4049
  SDATA(data_type_t.DTP_INTEGER, "x", 0, "300", "X position"),
4050
4050
  SDATA(data_type_t.DTP_INTEGER, "y", 0, "100", "Y position"),
4051
4051
  SDATA(data_type_t.DTP_INTEGER, "width", 0, "700", "Width of the window"),
@@ -4540,8 +4540,8 @@ function build_ui$18(gobj) {
4540
4540
  }
4541
4541
  refresh_language($container, t);
4542
4542
  let $parent = gobj_read_attr(gobj, "$parent");
4543
- if ($parent) $parent.appendChild($container);
4544
- else document.body.appendChild($container);
4543
+ if (!$parent) $parent = default_parent(gobj);
4544
+ $parent.appendChild($container);
4545
4545
  if (gobj_read_bool_attr(gobj, "openMaximized")) max$2(gobj);
4546
4546
  else if (!mobile) {
4547
4547
  if (gobj_read_bool_attr(gobj, "content_size")) $container.style.height = "auto";
@@ -4627,6 +4627,30 @@ function close_window(gobj) {
4627
4627
  };
4628
4628
  }
4629
4629
  /************************************************************
4630
+ * Where a window lives when its host names no `$parent`: the
4631
+ * OVERLAY layer of the shell -- above the content, below the
4632
+ * toolbar's dropdowns, the dialogs and the toasts.
4633
+ *
4634
+ * It used to be document.body, and that put every window above
4635
+ * the WHOLE shell: `.yui-shell` is position:fixed, a stacking
4636
+ * context of its own, so the z-index of its modal layer (99)
4637
+ * counted only inside it, and a window at z-index 11 on the body
4638
+ * covered it. The confirmation a window's own close asks ("all
4639
+ * changes will be lost") opened UNDER the window that asked it,
4640
+ * where no click could reach it; a toast, a dropdown of the
4641
+ * toolbar, any dialog opened with a window on screen, the same.
4642
+ *
4643
+ * Inside the layer the dock's z-index still orders the windows
4644
+ * among themselves. No shell (a page with windows and no shell):
4645
+ * the body, as before.
4646
+ ************************************************************/
4647
+ function default_parent(gobj) {
4648
+ let shell = yui_shell_of(gobj);
4649
+ let layers = shell && shell.priv && shell.priv.layers;
4650
+ if (layers && layers.overlay) return layers.overlay;
4651
+ return document.body;
4652
+ }
4653
+ /************************************************************
4630
4654
  *
4631
4655
  ************************************************************/
4632
4656
  function toggle(gobj) {
@@ -6729,7 +6753,9 @@ function yui_tabulator_name_filters(table, t) {
6729
6753
  let $title = $el.querySelector(".tabulator-col-title");
6730
6754
  if (!title && $title) title = $title.textContent.trim();
6731
6755
  if (!title) continue;
6732
- $input.setAttribute("aria-label", t("filter by column", { column: title }));
6756
+ let name = t("filter by column", { column: title });
6757
+ $input.setAttribute("aria-label", name);
6758
+ $input.setAttribute("title", name);
6733
6759
  }
6734
6760
  } catch (e) {}
6735
6761
  }
@@ -6760,6 +6786,8 @@ function yui_tabulator_name_row_selects(table, t) {
6760
6786
  for (let $box of boxes) {
6761
6787
  $box.setAttribute("aria-label", t("select row"));
6762
6788
  $box.setAttribute("data-i18n-aria-label", "select row");
6789
+ $box.setAttribute("title", t("select row"));
6790
+ $box.setAttribute("data-i18n-title", "select row");
6763
6791
  }
6764
6792
  } catch (e) {}
6765
6793
  }
@@ -9158,11 +9186,19 @@ function name_form_control$1($field, conf) {
9158
9186
  $control.setAttribute("aria-label", t(key));
9159
9187
  $control.setAttribute("data-i18n-aria-label", key);
9160
9188
  }
9189
+ if ($control && !$control.getAttribute("title")) {
9190
+ $control.setAttribute("title", t(key));
9191
+ $control.setAttribute("data-i18n-title", key);
9192
+ }
9161
9193
  let $ts = $field.querySelector(".ts-control input");
9162
9194
  if ($ts && !$ts.getAttribute("aria-label")) {
9163
9195
  $ts.setAttribute("aria-label", t(key));
9164
9196
  $ts.setAttribute("data-i18n-aria-label", key);
9165
9197
  }
9198
+ if ($ts && !$ts.getAttribute("title")) {
9199
+ $ts.setAttribute("title", t(key));
9200
+ $ts.setAttribute("data-i18n-title", key);
9201
+ }
9166
9202
  let $clear = $field.querySelector(".ts-wrapper .clear-button");
9167
9203
  if ($clear) {
9168
9204
  const CLEAR_KEY = "remove all selected options";
@@ -10252,6 +10288,8 @@ function create_coordinates(gobj, attrs) {
10252
10288
  type: "text",
10253
10289
  placeholder: t("coordinates..."),
10254
10290
  "data-i18n-placeholder": "coordinates...",
10291
+ title: t("coordinates"),
10292
+ "data-i18n-title": "coordinates",
10255
10293
  "aria-label": t("coordinates"),
10256
10294
  "data-i18n-aria-label": "coordinates"
10257
10295
  },
@@ -27147,12 +27185,14 @@ function answer_print_tranger_refused$1(gobj, path, answer) {
27147
27185
  }
27148
27186
  /************************************************************
27149
27187
  * The text of a transport's refusal: gobj_command() answers a string,
27150
- * a command response or a number.
27188
+ * a command response or a number. Data only ("" when it says
27189
+ * nothing): the caller writes its own key as the fallback, where
27190
+ * validate-locales reads it.
27151
27191
  ************************************************************/
27152
27192
  function refusal_text$1(ret) {
27153
27193
  if (typeof ret === "string" && ret) return ret;
27154
27194
  if (ret && typeof ret === "object" && typeof ret.comment === "string" && ret.comment) return ret.comment;
27155
- return "print-tranger failed";
27195
+ return "";
27156
27196
  }
27157
27197
  /************************************************************
27158
27198
  * The whole tranger, for the raw-json viewer.
@@ -27180,7 +27220,7 @@ function request_print_tranger$1(gobj, path) {
27180
27220
  }, gobj);
27181
27221
  if (ret) {
27182
27222
  log_error(ret);
27183
- answer_print_tranger_refused$1(gobj, path, { error: refusal_text$1(ret) });
27223
+ answer_print_tranger_refused$1(gobj, path, { error: refusal_text$1(ret) || "print-tranger failed" });
27184
27224
  return;
27185
27225
  }
27186
27226
  if (path) priv.drills_in_flight.add(path);
@@ -28321,8 +28361,8 @@ function yui_clear_selection(tabulator) {
28321
28361
  * through `refresh_language()`. Call it on EV_LANGUAGE_CHANGED.
28322
28362
  ***************************************************************/
28323
28363
  function yui_selection_bar(t, opts) {
28324
- let o = opts || {};
28325
- let actions = Array.isArray(o.actions) ? o.actions : [];
28364
+ const o = opts || {};
28365
+ const actions = Array.isArray(o.actions) ? o.actions : [];
28326
28366
  let name = o.name || "TABLE";
28327
28367
  let count = 0;
28328
28368
  let $count = createElement2([
@@ -28349,7 +28389,6 @@ function yui_selection_bar(t, opts) {
28349
28389
  ]],
28350
28390
  { click: action.on_click }
28351
28391
  ]);
28352
- $b._yui_label = action.label || "";
28353
28392
  $buttons.push($b);
28354
28393
  }
28355
28394
  let $clear = createElement2([
@@ -28382,15 +28421,18 @@ function yui_selection_bar(t, opts) {
28382
28421
  function label_of($b) {
28383
28422
  return $b.querySelector("span.icon ~ span");
28384
28423
  }
28424
+ function paint_label($b, key) {
28425
+ let $label = label_of($b);
28426
+ if ($label && key) $label.textContent = t(key);
28427
+ $b.title = key ? t(key) : "";
28428
+ $b.setAttribute("aria-label", $b.title);
28429
+ }
28385
28430
  function refresh() {
28386
28431
  $count.textContent = t("{{n}} selected", { n: count });
28387
- for (let $b of $buttons.concat([$clear])) {
28388
- let $label = label_of($b);
28389
- const key = $b === $clear ? "clear selection" : $b._yui_label;
28390
- if ($label && key) $label.textContent = t(key);
28391
- $b.title = key ? t(key) : "";
28392
- $b.setAttribute("aria-label", $b.title);
28393
- }
28432
+ actions.forEach((action, i) => {
28433
+ paint_label($buttons[i], action.label || "");
28434
+ });
28435
+ paint_label($clear, "clear selection");
28394
28436
  $el.classList.toggle("is-hidden", count <= 0);
28395
28437
  }
28396
28438
  function set_count(n) {
@@ -71235,12 +71277,14 @@ function answer_print_tranger_refused(gobj, path, answer) {
71235
71277
  }
71236
71278
  /************************************************************
71237
71279
  * The text of a transport's refusal: gobj_command() answers a string,
71238
- * a command response or a number.
71280
+ * a command response or a number. Data only ("" when it says
71281
+ * nothing): the caller writes its own key as the fallback, where
71282
+ * validate-locales reads it.
71239
71283
  ************************************************************/
71240
71284
  function refusal_text(ret) {
71241
71285
  if (typeof ret === "string" && ret) return ret;
71242
71286
  if (ret && typeof ret === "object" && typeof ret.comment === "string" && ret.comment) return ret.comment;
71243
- return "print-tranger failed";
71287
+ return "";
71244
71288
  }
71245
71289
  /************************************************************
71246
71290
  * Fetch the treedb's raw tranger (or one subtree when `path` is set) as
@@ -71269,7 +71313,7 @@ function request_print_tranger(gobj, path) {
71269
71313
  }, gobj);
71270
71314
  if (ret) {
71271
71315
  log_error(ret);
71272
- answer_print_tranger_refused(gobj, path, { error: refusal_text(ret) });
71316
+ answer_print_tranger_refused(gobj, path, { error: refusal_text(ret) || "print-tranger failed" });
71273
71317
  return;
71274
71318
  }
71275
71319
  if (path) priv.drills_in_flight.add(path);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yuneta/gobj-ui",
3
- "version": "7.26.30",
3
+ "version": "7.26.32",
4
4
  "type": "module",
5
5
  "main": "dist/gobj-ui.cjs.js",
6
6
  "module": "dist/gobj-ui.es.js",