@yuneta/gobj-ui 7.23.125 → 7.23.127

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.
@@ -6030,8 +6030,6 @@ function yui_tabulator_name_row_selects(table, t) {
6030
6030
  }
6031
6031
  function yui_tabulator_relocalize(table, t) {
6032
6032
  if (!table) return;
6033
- yui_tabulator_name_filters(table, t);
6034
- yui_tabulator_name_row_selects(table, t);
6035
6033
  try {
6036
6034
  let name = next_lang_name();
6037
6035
  let strings = tabulator_strings(t);
@@ -6041,6 +6039,8 @@ function yui_tabulator_relocalize(table, t) {
6041
6039
  if (localize && typeof localize.installLang === "function") localize.installLang(name, strings);
6042
6040
  else (0, _yuneta_gobj_js.log_warning)("yui_tabulator_relocalize: no localize module: Tabulator's own chrome stays in the old language");
6043
6041
  table.setLocale(name);
6042
+ yui_tabulator_name_filters(table, t);
6043
+ yui_tabulator_name_row_selects(table, t);
6044
6044
  } catch (e) {
6045
6045
  (0, _yuneta_gobj_js.log_warning)(`yui_tabulator_relocalize: table gone: ${e}`);
6046
6046
  }
@@ -8443,7 +8443,7 @@ function create_tabulator$1(gobj, $extend, name, template) {
8443
8443
  tabulator.on("renderComplete", function() {
8444
8444
  yui_tabulator_name_row_selects(tabulator, i18next.t);
8445
8445
  });
8446
- tabulator.on("tableBuilt", function() {
8446
+ tabulator.on("columnsLoaded", function() {
8447
8447
  yui_tabulator_name_row_selects(tabulator, i18next.t);
8448
8448
  });
8449
8449
  tabulator.on("rowClick", function(e, row) {
@@ -25218,6 +25218,10 @@ function create_tabulator(gobj) {
25218
25218
  tabulator.element.classList.toggle("yui-single-page", single_page);
25219
25219
  tabulator.element.classList.toggle("yui-no-paginator", no_paginator);
25220
25220
  }
25221
+ tabulator.on("columnsLoaded", function() {
25222
+ yui_tabulator_name_filters(tabulator, i18next.t);
25223
+ yui_tabulator_name_row_selects(tabulator, i18next.t);
25224
+ });
25221
25225
  tabulator._ready = false;
25222
25226
  tabulator.on("tableBuilt", function() {
25223
25227
  yui_tabulator_name_filters(tabulator, i18next.t);
@@ -6025,8 +6025,6 @@ function yui_tabulator_name_row_selects(table, t) {
6025
6025
  }
6026
6026
  function yui_tabulator_relocalize(table, t) {
6027
6027
  if (!table) return;
6028
- yui_tabulator_name_filters(table, t);
6029
- yui_tabulator_name_row_selects(table, t);
6030
6028
  try {
6031
6029
  let name = next_lang_name();
6032
6030
  let strings = tabulator_strings(t);
@@ -6036,6 +6034,8 @@ function yui_tabulator_relocalize(table, t) {
6036
6034
  if (localize && typeof localize.installLang === "function") localize.installLang(name, strings);
6037
6035
  else log_warning("yui_tabulator_relocalize: no localize module: Tabulator's own chrome stays in the old language");
6038
6036
  table.setLocale(name);
6037
+ yui_tabulator_name_filters(table, t);
6038
+ yui_tabulator_name_row_selects(table, t);
6039
6039
  } catch (e) {
6040
6040
  log_warning(`yui_tabulator_relocalize: table gone: ${e}`);
6041
6041
  }
@@ -8438,7 +8438,7 @@ function create_tabulator$1(gobj, $extend, name, template) {
8438
8438
  tabulator.on("renderComplete", function() {
8439
8439
  yui_tabulator_name_row_selects(tabulator, t);
8440
8440
  });
8441
- tabulator.on("tableBuilt", function() {
8441
+ tabulator.on("columnsLoaded", function() {
8442
8442
  yui_tabulator_name_row_selects(tabulator, t);
8443
8443
  });
8444
8444
  tabulator.on("rowClick", function(e, row) {
@@ -25213,6 +25213,10 @@ function create_tabulator(gobj) {
25213
25213
  tabulator.element.classList.toggle("yui-single-page", single_page);
25214
25214
  tabulator.element.classList.toggle("yui-no-paginator", no_paginator);
25215
25215
  }
25216
+ tabulator.on("columnsLoaded", function() {
25217
+ yui_tabulator_name_filters(tabulator, t);
25218
+ yui_tabulator_name_row_selects(tabulator, t);
25219
+ });
25216
25220
  tabulator._ready = false;
25217
25221
  tabulator.on("tableBuilt", function() {
25218
25222
  yui_tabulator_name_filters(tabulator, t);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yuneta/gobj-ui",
3
- "version": "7.23.125",
3
+ "version": "7.23.127",
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,9 +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() {
1845
+ /* And on every rebuild of the COLUMNS: an empty table renders no
1846
+ * body, so `renderComplete` never fires and the header's own box
1847
+ * would keep its English name -- and a `setColumns()` rebuilds the
1848
+ * header, throwing away whatever name was on it. */
1849
+ tabulator.on("columnsLoaded", function() {
1848
1850
  yui_tabulator_name_row_selects(tabulator, t);
1849
1851
  });
1850
1852
  tabulator.on("rowClick", function(e, row) {
@@ -1652,6 +1652,16 @@ function create_tabulator(gobj)
1652
1652
  tabulator.element.classList.toggle("yui-no-paginator", no_paginator);
1653
1653
  }
1654
1654
 
1655
+ /* `columnsLoaded` and not only `tableBuilt`: EVERY rebuild of the
1656
+ * columns rebuilds the header, and the header carries two things
1657
+ * Tabulator draws without a name -- the per-column filter box and the
1658
+ * select-all checkbox. A language change runs `setColumns()`, so the
1659
+ * names put on at build were thrown away with the old header and the
1660
+ * boxes came back in English. This event fires on both paths. */
1661
+ tabulator.on("columnsLoaded", function() {
1662
+ yui_tabulator_name_filters(tabulator, t);
1663
+ yui_tabulator_name_row_selects(tabulator, t);
1664
+ });
1655
1665
  tabulator._ready = false;
1656
1666
  tabulator.on("tableBuilt", function() {
1657
1667
  /* Tabulator gives its header-filter boxes no name of any kind:
@@ -192,10 +192,6 @@ function yui_tabulator_relocalize(table, t)
192
192
  if(!table) {
193
193
  return;
194
194
  }
195
- /* Neither the header filters nor the row-selection boxes have a
196
- * name of their own; give them one again in the new language. */
197
- yui_tabulator_name_filters(table, t);
198
- yui_tabulator_name_row_selects(table, t);
199
195
  try {
200
196
  let name = next_lang_name();
201
197
  let strings = tabulator_strings(t);
@@ -219,6 +215,16 @@ function yui_tabulator_relocalize(table, t)
219
215
  }
220
216
 
221
217
  table.setLocale(name); /* a NEW name: this is what re-renders */
218
+
219
+ /* AFTER setLocale, never before. Neither the header filters nor
220
+ * the row-selection boxes have a name of their own, and the
221
+ * re-render setLocale triggers REBUILDS the header -- so a name
222
+ * written first is thrown away with the old header, and the boxes
223
+ * come back in Tabulator's English. Which is exactly what a dump
224
+ * of the deployed page showed: clean on first paint, "Select Row"
225
+ * again after one language change. */
226
+ yui_tabulator_name_filters(table, t);
227
+ yui_tabulator_name_row_selects(table, t);
222
228
  } catch(e) {
223
229
  log_warning(`yui_tabulator_relocalize: table gone: ${e}`);
224
230
  }