@yuneta/gobj-ui 7.23.123 → 7.23.125

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.
@@ -6014,10 +6014,13 @@ function yui_tabulator_name_filters(table, t) {
6014
6014
  ***************************************************************/
6015
6015
  var TABULATOR_ROW_SELECT_ARIA = "Select Row";
6016
6016
  function yui_tabulator_name_row_selects(table, t) {
6017
- if (!table || typeof table.getElement !== "function") return;
6017
+ if (!table) return;
6018
6018
  try {
6019
- let $el = table.getElement();
6020
- if (!$el) return;
6019
+ let $el = table.element || (typeof table.getElement === "function" ? table.getElement() : null);
6020
+ if (!$el) {
6021
+ (0, _yuneta_gobj_js.log_warning)("yui_tabulator_name_row_selects: table has no element: its row-selection boxes keep Tabulator's English name");
6022
+ return;
6023
+ }
6021
6024
  let boxes = $el.querySelectorAll(`input[type=checkbox][aria-label="${TABULATOR_ROW_SELECT_ARIA}"]`);
6022
6025
  for (let $box of boxes) {
6023
6026
  $box.setAttribute("aria-label", t("select row"));
@@ -8440,6 +8443,9 @@ function create_tabulator$1(gobj, $extend, name, template) {
8440
8443
  tabulator.on("renderComplete", function() {
8441
8444
  yui_tabulator_name_row_selects(tabulator, i18next.t);
8442
8445
  });
8446
+ tabulator.on("tableBuilt", function() {
8447
+ yui_tabulator_name_row_selects(tabulator, i18next.t);
8448
+ });
8443
8449
  tabulator.on("rowClick", function(e, row) {
8444
8450
  e.preventDefault();
8445
8451
  if (get_selectable_state(row)) row.toggleSelect();
@@ -25215,6 +25221,7 @@ function create_tabulator(gobj) {
25215
25221
  tabulator._ready = false;
25216
25222
  tabulator.on("tableBuilt", function() {
25217
25223
  yui_tabulator_name_filters(tabulator, i18next.t);
25224
+ yui_tabulator_name_row_selects(tabulator, i18next.t);
25218
25225
  tabulator._ready = true;
25219
25226
  update_rowcount();
25220
25227
  yui_table_filter_clear(tabulator);
@@ -6009,10 +6009,13 @@ function yui_tabulator_name_filters(table, t) {
6009
6009
  ***************************************************************/
6010
6010
  var TABULATOR_ROW_SELECT_ARIA = "Select Row";
6011
6011
  function yui_tabulator_name_row_selects(table, t) {
6012
- if (!table || typeof table.getElement !== "function") return;
6012
+ if (!table) return;
6013
6013
  try {
6014
- let $el = table.getElement();
6015
- if (!$el) return;
6014
+ let $el = table.element || (typeof table.getElement === "function" ? table.getElement() : null);
6015
+ if (!$el) {
6016
+ log_warning("yui_tabulator_name_row_selects: table has no element: its row-selection boxes keep Tabulator's English name");
6017
+ return;
6018
+ }
6016
6019
  let boxes = $el.querySelectorAll(`input[type=checkbox][aria-label="${TABULATOR_ROW_SELECT_ARIA}"]`);
6017
6020
  for (let $box of boxes) {
6018
6021
  $box.setAttribute("aria-label", t("select row"));
@@ -8435,6 +8438,9 @@ function create_tabulator$1(gobj, $extend, name, template) {
8435
8438
  tabulator.on("renderComplete", function() {
8436
8439
  yui_tabulator_name_row_selects(tabulator, t);
8437
8440
  });
8441
+ tabulator.on("tableBuilt", function() {
8442
+ yui_tabulator_name_row_selects(tabulator, t);
8443
+ });
8438
8444
  tabulator.on("rowClick", function(e, row) {
8439
8445
  e.preventDefault();
8440
8446
  if (get_selectable_state(row)) row.toggleSelect();
@@ -25210,6 +25216,7 @@ function create_tabulator(gobj) {
25210
25216
  tabulator._ready = false;
25211
25217
  tabulator.on("tableBuilt", function() {
25212
25218
  yui_tabulator_name_filters(tabulator, t);
25219
+ yui_tabulator_name_row_selects(tabulator, t);
25213
25220
  tabulator._ready = true;
25214
25221
  update_rowcount();
25215
25222
  yui_table_filter_clear(tabulator);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yuneta/gobj-ui",
3
- "version": "7.23.123",
3
+ "version": "7.23.125",
4
4
  "type": "module",
5
5
  "main": "dist/gobj-ui.cjs.js",
6
6
  "module": "dist/gobj-ui.es.js",
package/src/c_yui_form.js CHANGED
@@ -1842,6 +1842,11 @@ function create_tabulator(gobj, $extend, name, template)
1842
1842
  tabulator.on("renderComplete", function() {
1843
1843
  yui_tabulator_name_row_selects(tabulator, t);
1844
1844
  });
1845
+ /* And at build: an EMPTY table renders no body, so `renderComplete`
1846
+ * never fires and the header's own box would keep its English name. */
1847
+ tabulator.on("tableBuilt", function() {
1848
+ yui_tabulator_name_row_selects(tabulator, t);
1849
+ });
1845
1850
  tabulator.on("rowClick", function(e, row) {
1846
1851
  //e - the click event object
1847
1852
  //row - row component
@@ -1658,6 +1658,13 @@ function create_tabulator(gobj)
1658
1658
  * on screen the column above says what each one filters, and to
1659
1659
  * a reader they are a row of anonymous text boxes. */
1660
1660
  yui_tabulator_name_filters(tabulator, t);
1661
+ /* The HEADER box too, and here rather than only in
1662
+ * `renderComplete`: an EMPTY table renders no body, so that event
1663
+ * never fires and the one box it does draw -- the header's -- kept
1664
+ * Tabulator's English name. Eight such tables were on screen in
1665
+ * the deployed schemas window, with six boxes between them and not
1666
+ * one row. */
1667
+ yui_tabulator_name_row_selects(tabulator, t);
1661
1668
  tabulator._ready = true;
1662
1669
  update_rowcount();
1663
1670
  /* La ✕ de cada filtro de cabecera. Un filtro se quita borrando lo
@@ -160,12 +160,20 @@ const TABULATOR_ROW_SELECT_ARIA = "Select Row";
160
160
 
161
161
  function yui_tabulator_name_row_selects(table, t)
162
162
  {
163
- if(!table || typeof table.getElement !== "function") {
163
+ if(!table) {
164
164
  return;
165
165
  }
166
166
  try {
167
- let $el = table.getElement();
167
+ /* A Tabulator INSTANCE carries its node as `.element`; only its
168
+ * Column/Row components have `getElement()`. Testing for the
169
+ * method and returning silently made this a no-op on every real
170
+ * table -- and a no-op is what a dump of the deployed page
171
+ * showed, with the boxes still saying "Select Row". */
172
+ let $el = table.element
173
+ || (typeof table.getElement === "function" ? table.getElement() : null);
168
174
  if(!$el) {
175
+ log_warning("yui_tabulator_name_row_selects: table has no element: "
176
+ + "its row-selection boxes keep Tabulator's English name");
169
177
  return;
170
178
  }
171
179
  let boxes = $el.querySelectorAll(