@yuneta/gobj-ui 7.26.34 → 7.26.36

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.
Files changed (43) hide show
  1. package/README.md +223 -53
  2. package/dist/gobj-ui.cjs.js +1109 -143
  3. package/dist/gobj-ui.es.js +1109 -143
  4. package/package.json +2 -2
  5. package/scripts/validate-locales.mjs +672 -96
  6. package/src/c_yui_form.js +186 -9
  7. package/src/c_yui_gclass.js +2 -0
  8. package/src/c_yui_gobj_tree_js.js +2 -0
  9. package/src/c_yui_json.js +2 -0
  10. package/src/c_yui_json_graph.js +2 -0
  11. package/src/c_yui_nav.js +23 -5
  12. package/src/c_yui_shell.css +16 -0
  13. package/src/c_yui_shell.js +282 -26
  14. package/src/c_yui_treedb_graph.js +26 -8
  15. package/src/c_yui_treedb_topic_with_form.js +40 -18
  16. package/src/c_yui_treedb_topics.js +34 -11
  17. package/src/c_yui_window.js +132 -32
  18. package/src/c_yui_window_manager.js +250 -46
  19. package/src/form_json_editor_names.js +448 -0
  20. package/src/form_json_editor_names.wiring.test.js +595 -0
  21. package/src/form_label_i18n.wiring.test.js +169 -0
  22. package/src/i18n_key_functions.js +14 -6
  23. package/src/i18n_key_functions.test.js +124 -2
  24. package/src/lib_maplibre.js +26 -2
  25. package/src/lib_maplibre_relocalize.test.js +78 -0
  26. package/src/named_controls.wiring.test.js +468 -0
  27. package/src/nav_cards_helpers.js +9 -1
  28. package/src/nav_item_badge.wiring.test.js +182 -1
  29. package/src/shell_route_map.js +25 -8
  30. package/src/table_editor_name.wiring.test.js +201 -0
  31. package/src/treedb_column_title.wiring.test.js +151 -0
  32. package/src/treedb_json_drill.wiring.test.js +41 -1
  33. package/src/window_layer.wiring.test.js +348 -43
  34. package/src/window_show.wiring.test.js +6 -2
  35. package/src/window_stacking.wiring.test.js +334 -0
  36. package/src/yui_badge.js +58 -13
  37. package/src/yui_badge.test.js +40 -3
  38. package/src/yui_dev.js +2 -1
  39. package/src/yui_file_field.js +2 -0
  40. package/src/yui_frontend_view.js +2 -1
  41. package/src/yui_gclass_view.js +9 -6
  42. package/src/yui_tabulator_i18n.js +42 -0
  43. package/src/yui_tabulator_i18n.test.js +48 -1
@@ -3,7 +3,8 @@
3
3
  *
4
4
  * The names given AFTER the render to what Tabulator draws for
5
5
  * itself: the header filters and the row-selection boxes carry
6
- * an aria-label AND a title, like every control.
6
+ * an aria-label AND a title, like every control. And the name of
7
+ * the editor of a cell, asked at the moment of editing.
7
8
  *
8
9
  * Copyright (c) 2026, ArtGins.
9
10
  * All Rights Reserved.
@@ -13,6 +14,7 @@ import {describe, it, expect} from "vitest";
13
14
  import {
14
15
  yui_tabulator_name_filters,
15
16
  yui_tabulator_name_row_selects,
17
+ yui_tabulator_name_editor,
16
18
  } from "./yui_tabulator_i18n.js";
17
19
 
18
20
  /* An element double: attributes, and the one child a selector finds. */
@@ -78,3 +80,48 @@ describe("yui_tabulator_name_row_selects", () => {
78
80
  expect($box.attrs["data-i18n-title"]).toBe("select row");
79
81
  });
80
82
  });
83
+
84
+ describe("yui_tabulator_name_editor", () => {
85
+ /* Tabulator calls a FUNCTION editorParams with the cell when it starts
86
+ * editing it, and every built-in editor writes the elementAttributes
87
+ * it answers onto the box it draws (REV-CLOUD V23.5.6: the editable
88
+ * cells had no name). */
89
+ it("names the editor after the column, asked at the moment of editing", () => {
90
+ let lang = "en";
91
+ const names = {en: "Value", es: "Valor"};
92
+ const def = {field: "value", editor: "input", editorParams: {selectContents: true}};
93
+ yui_tabulator_name_editor(def, () => names[lang]);
94
+
95
+ expect(typeof def.editorParams).toBe("function");
96
+ let params = def.editorParams({});
97
+ expect(params.selectContents).toBe(true); // what it had stays
98
+ expect(params.elementAttributes).toEqual({"aria-label": "Value", title: "Value"});
99
+
100
+ lang = "es"; // a language change
101
+ params = def.editorParams({});
102
+ expect(params.elementAttributes).toEqual({"aria-label": "Valor", title: "Valor"});
103
+ });
104
+
105
+ it("keeps a function editorParams, and a name the column gave itself", () => {
106
+ const def = {
107
+ editor: "list",
108
+ editorParams: (cell) => ({values: cell.values,
109
+ elementAttributes: {"aria-label": "its own", maxlength: "3"}})
110
+ };
111
+ yui_tabulator_name_editor(def, () => "Kind");
112
+ const params = def.editorParams({values: ["a", "b"]});
113
+ expect(params.values).toEqual(["a", "b"]);
114
+ expect(params.elementAttributes).toEqual(
115
+ {"aria-label": "its own", title: "Kind", maxlength: "3"});
116
+ });
117
+
118
+ it("leaves a column without an editor, and a name it cannot give, alone", () => {
119
+ const plain = {field: "x"};
120
+ yui_tabulator_name_editor(plain, () => "X");
121
+ expect(plain.editorParams).toBe(undefined);
122
+
123
+ const def = {editor: "input", editorParams: {a: 1}};
124
+ yui_tabulator_name_editor(def, () => "");
125
+ expect(def.editorParams({})).toEqual({a: 1});
126
+ });
127
+ });