@yuneta/gobj-ui 7.23.113 → 7.23.114

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.
@@ -68243,6 +68243,14 @@ function open_dialog(gobj, $content, title, logical, title_prefix) {
68243
68243
  * a language change does not have to know the form exists.
68244
68244
  ***************************************************************/
68245
68245
  function field(logical, name, label, $control, help) {
68246
+ if ((0, _yuneta_gobj_js.is_array)($control) && (0, _yuneta_gobj_js.is_object)($control[1]) && [
68247
+ "input",
68248
+ "select",
68249
+ "textarea"
68250
+ ].includes($control[0]) && !$control[1]["aria-label"]) {
68251
+ $control[1]["aria-label"] = (0, i18next.t)(label);
68252
+ $control[1]["data-i18n-aria-label"] = label;
68253
+ }
68246
68254
  return [
68247
68255
  "div",
68248
68256
  { class: `${logical} field mb-3` },
@@ -68238,6 +68238,14 @@ function open_dialog(gobj, $content, title, logical, title_prefix) {
68238
68238
  * a language change does not have to know the form exists.
68239
68239
  ***************************************************************/
68240
68240
  function field(logical, name, label, $control, help) {
68241
+ if (is_array($control) && is_object($control[1]) && [
68242
+ "input",
68243
+ "select",
68244
+ "textarea"
68245
+ ].includes($control[0]) && !$control[1]["aria-label"]) {
68246
+ $control[1]["aria-label"] = t(label);
68247
+ $control[1]["data-i18n-aria-label"] = label;
68248
+ }
68241
68249
  return [
68242
68250
  "div",
68243
68251
  { class: `${logical} field mb-3` },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yuneta/gobj-ui",
3
- "version": "7.23.113",
3
+ "version": "7.23.114",
4
4
  "type": "module",
5
5
  "main": "dist/gobj-ui.cjs.js",
6
6
  "module": "dist/gobj-ui.es.js",
@@ -107,6 +107,7 @@ import {
107
107
  kw_get_str,
108
108
  kw_get_dict,
109
109
  is_object,
110
+ is_array,
110
111
  empty_string,
111
112
  } from "@yuneta/gobj-js";
112
113
  import {yui_tint} from "./bulma_tint.js";
@@ -1557,6 +1558,17 @@ function open_dialog(gobj, $content, title, logical, title_prefix)
1557
1558
  ***************************************************************/
1558
1559
  function field(logical, name, label, $control, help)
1559
1560
  {
1561
+ /* The label is a SIBLING of the control -- Bulma's `field` shape --
1562
+ * so it names it for the eye and for nothing else: no `for`, no
1563
+ * wrapping, and a reader announces the box as unlabelled. The name
1564
+ * is put on the control itself, from the label's own key, so the
1565
+ * two cannot drift and a language change reaches both. */
1566
+ if(is_array($control) && is_object($control[1]) &&
1567
+ ["input", "select", "textarea"].includes($control[0]) &&
1568
+ !$control[1]["aria-label"]) {
1569
+ $control[1]["aria-label"] = t(label);
1570
+ $control[1]["data-i18n-aria-label"] = label;
1571
+ }
1560
1572
  return ["div", {class: `${logical} field mb-3`}, [
1561
1573
  ["label", {class: "label", i18n: label}, t(label)],
1562
1574
  ["div", {class: "control"}, [$control]],