@yuneta/gobj-ui 7.23.118 → 7.23.120
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.
package/dist/gobj-ui.cjs.js
CHANGED
|
@@ -23398,8 +23398,40 @@ function tabulator_strings(t) {
|
|
|
23398
23398
|
* Silent no-op on a table that is gone: a language switch races nothing,
|
|
23399
23399
|
* but a view torn down mid-switch must not log a failure it cannot act on.
|
|
23400
23400
|
***************************************************************/
|
|
23401
|
+
/***************************************************************
|
|
23402
|
+
* Name the HEADER FILTER inputs.
|
|
23403
|
+
*
|
|
23404
|
+
* Tabulator draws one text box per filterable column and gives
|
|
23405
|
+
* it nothing: no label, no `aria-label`, no placeholder. On
|
|
23406
|
+
* screen its position says what it filters -- it sits under the
|
|
23407
|
+
* column's title -- and to anything that is not an eye it is a
|
|
23408
|
+
* row of anonymous text boxes.
|
|
23409
|
+
*
|
|
23410
|
+
* The name is composed from the column's own title, so it needs
|
|
23411
|
+
* ONE consumer key with an interpolation (`filter by column` ->
|
|
23412
|
+
* "Filtrar por {{column}}") instead of one per column, and it
|
|
23413
|
+
* follows a language change because this runs from
|
|
23414
|
+
* `yui_tabulator_relocalize()` as well as at build.
|
|
23415
|
+
***************************************************************/
|
|
23416
|
+
function yui_tabulator_name_filters(table, t) {
|
|
23417
|
+
if (!table || typeof table.getColumns !== "function") return;
|
|
23418
|
+
try {
|
|
23419
|
+
for (let col of table.getColumns()) {
|
|
23420
|
+
let $el = typeof col.getElement === "function" ? col.getElement() : null;
|
|
23421
|
+
if (!$el) continue;
|
|
23422
|
+
let $input = $el.querySelector(".tabulator-header-filter input, .tabulator-header-filter select");
|
|
23423
|
+
if (!$input) continue;
|
|
23424
|
+
let title = typeof col.getDefinition === "function" ? String(col.getDefinition().title || "") : "";
|
|
23425
|
+
let $title = $el.querySelector(".tabulator-col-title");
|
|
23426
|
+
if (!title && $title) title = $title.textContent.trim();
|
|
23427
|
+
if (!title) continue;
|
|
23428
|
+
$input.setAttribute("aria-label", t("filter by column", { column: title }));
|
|
23429
|
+
}
|
|
23430
|
+
} catch (e) {}
|
|
23431
|
+
}
|
|
23401
23432
|
function yui_tabulator_relocalize(table, t) {
|
|
23402
23433
|
if (!table) return;
|
|
23434
|
+
yui_tabulator_name_filters(table, t);
|
|
23403
23435
|
try {
|
|
23404
23436
|
let name = next_lang_name();
|
|
23405
23437
|
let strings = tabulator_strings(t);
|
|
@@ -25151,6 +25183,7 @@ function create_tabulator(gobj) {
|
|
|
25151
25183
|
}
|
|
25152
25184
|
tabulator._ready = false;
|
|
25153
25185
|
tabulator.on("tableBuilt", function() {
|
|
25186
|
+
yui_tabulator_name_filters(tabulator, i18next.t);
|
|
25154
25187
|
tabulator._ready = true;
|
|
25155
25188
|
update_rowcount();
|
|
25156
25189
|
yui_table_filter_clear(tabulator);
|
package/dist/gobj-ui.es.js
CHANGED
|
@@ -23393,8 +23393,40 @@ function tabulator_strings(t) {
|
|
|
23393
23393
|
* Silent no-op on a table that is gone: a language switch races nothing,
|
|
23394
23394
|
* but a view torn down mid-switch must not log a failure it cannot act on.
|
|
23395
23395
|
***************************************************************/
|
|
23396
|
+
/***************************************************************
|
|
23397
|
+
* Name the HEADER FILTER inputs.
|
|
23398
|
+
*
|
|
23399
|
+
* Tabulator draws one text box per filterable column and gives
|
|
23400
|
+
* it nothing: no label, no `aria-label`, no placeholder. On
|
|
23401
|
+
* screen its position says what it filters -- it sits under the
|
|
23402
|
+
* column's title -- and to anything that is not an eye it is a
|
|
23403
|
+
* row of anonymous text boxes.
|
|
23404
|
+
*
|
|
23405
|
+
* The name is composed from the column's own title, so it needs
|
|
23406
|
+
* ONE consumer key with an interpolation (`filter by column` ->
|
|
23407
|
+
* "Filtrar por {{column}}") instead of one per column, and it
|
|
23408
|
+
* follows a language change because this runs from
|
|
23409
|
+
* `yui_tabulator_relocalize()` as well as at build.
|
|
23410
|
+
***************************************************************/
|
|
23411
|
+
function yui_tabulator_name_filters(table, t) {
|
|
23412
|
+
if (!table || typeof table.getColumns !== "function") return;
|
|
23413
|
+
try {
|
|
23414
|
+
for (let col of table.getColumns()) {
|
|
23415
|
+
let $el = typeof col.getElement === "function" ? col.getElement() : null;
|
|
23416
|
+
if (!$el) continue;
|
|
23417
|
+
let $input = $el.querySelector(".tabulator-header-filter input, .tabulator-header-filter select");
|
|
23418
|
+
if (!$input) continue;
|
|
23419
|
+
let title = typeof col.getDefinition === "function" ? String(col.getDefinition().title || "") : "";
|
|
23420
|
+
let $title = $el.querySelector(".tabulator-col-title");
|
|
23421
|
+
if (!title && $title) title = $title.textContent.trim();
|
|
23422
|
+
if (!title) continue;
|
|
23423
|
+
$input.setAttribute("aria-label", t("filter by column", { column: title }));
|
|
23424
|
+
}
|
|
23425
|
+
} catch (e) {}
|
|
23426
|
+
}
|
|
23396
23427
|
function yui_tabulator_relocalize(table, t) {
|
|
23397
23428
|
if (!table) return;
|
|
23429
|
+
yui_tabulator_name_filters(table, t);
|
|
23398
23430
|
try {
|
|
23399
23431
|
let name = next_lang_name();
|
|
23400
23432
|
let strings = tabulator_strings(t);
|
|
@@ -25146,6 +25178,7 @@ function create_tabulator(gobj) {
|
|
|
25146
25178
|
}
|
|
25147
25179
|
tabulator._ready = false;
|
|
25148
25180
|
tabulator.on("tableBuilt", function() {
|
|
25181
|
+
yui_tabulator_name_filters(tabulator, t);
|
|
25149
25182
|
tabulator._ready = true;
|
|
25150
25183
|
update_rowcount();
|
|
25151
25184
|
yui_table_filter_clear(tabulator);
|
package/package.json
CHANGED
|
@@ -75,7 +75,8 @@ import {register_c_yui_form} from "./c_yui_form.js";
|
|
|
75
75
|
import {register_c_yui_json} from "./c_yui_json.js";
|
|
76
76
|
import {attach_clear} from "./yui_inputs.js";
|
|
77
77
|
|
|
78
|
-
import {yui_tabulator_lang, yui_tabulator_relocalize
|
|
78
|
+
import {yui_tabulator_lang, yui_tabulator_relocalize,
|
|
79
|
+
yui_tabulator_name_filters} from "./yui_tabulator_i18n.js";
|
|
79
80
|
|
|
80
81
|
import {
|
|
81
82
|
yui_selection_column,
|
|
@@ -1652,6 +1653,10 @@ function create_tabulator(gobj)
|
|
|
1652
1653
|
|
|
1653
1654
|
tabulator._ready = false;
|
|
1654
1655
|
tabulator.on("tableBuilt", function() {
|
|
1656
|
+
/* Tabulator gives its header-filter boxes no name of any kind:
|
|
1657
|
+
* on screen the column above says what each one filters, and to
|
|
1658
|
+
* a reader they are a row of anonymous text boxes. */
|
|
1659
|
+
yui_tabulator_name_filters(tabulator, t);
|
|
1655
1660
|
tabulator._ready = true;
|
|
1656
1661
|
update_rowcount();
|
|
1657
1662
|
/* La ✕ de cada filtro de cabecera. Un filtro se quita borrando lo
|
|
@@ -89,11 +89,67 @@ function tabulator_strings(t)
|
|
|
89
89
|
* Silent no-op on a table that is gone: a language switch races nothing,
|
|
90
90
|
* but a view torn down mid-switch must not log a failure it cannot act on.
|
|
91
91
|
***************************************************************/
|
|
92
|
+
|
|
93
|
+
/***************************************************************
|
|
94
|
+
* Name the HEADER FILTER inputs.
|
|
95
|
+
*
|
|
96
|
+
* Tabulator draws one text box per filterable column and gives
|
|
97
|
+
* it nothing: no label, no `aria-label`, no placeholder. On
|
|
98
|
+
* screen its position says what it filters -- it sits under the
|
|
99
|
+
* column's title -- and to anything that is not an eye it is a
|
|
100
|
+
* row of anonymous text boxes.
|
|
101
|
+
*
|
|
102
|
+
* The name is composed from the column's own title, so it needs
|
|
103
|
+
* ONE consumer key with an interpolation (`filter by column` ->
|
|
104
|
+
* "Filtrar por {{column}}") instead of one per column, and it
|
|
105
|
+
* follows a language change because this runs from
|
|
106
|
+
* `yui_tabulator_relocalize()` as well as at build.
|
|
107
|
+
***************************************************************/
|
|
108
|
+
function yui_tabulator_name_filters(table, t)
|
|
109
|
+
{
|
|
110
|
+
if(!table || typeof table.getColumns !== "function") {
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
try {
|
|
114
|
+
for(let col of table.getColumns()) {
|
|
115
|
+
let $el = typeof col.getElement === "function" ? col.getElement() : null;
|
|
116
|
+
if(!$el) {
|
|
117
|
+
continue;
|
|
118
|
+
}
|
|
119
|
+
let $input = $el.querySelector(".tabulator-header-filter input, " +
|
|
120
|
+
".tabulator-header-filter select");
|
|
121
|
+
if(!$input) {
|
|
122
|
+
continue;
|
|
123
|
+
}
|
|
124
|
+
let title = (typeof col.getDefinition === "function")
|
|
125
|
+
? String(col.getDefinition().title || "") : "";
|
|
126
|
+
let $title = $el.querySelector(".tabulator-col-title");
|
|
127
|
+
if(!title && $title) {
|
|
128
|
+
title = $title.textContent.trim();
|
|
129
|
+
}
|
|
130
|
+
if(!title) {
|
|
131
|
+
continue; /* a column with no title names nothing */
|
|
132
|
+
}
|
|
133
|
+
/* `filter by column` and NOT `filter column`: that key
|
|
134
|
+
* already exists in two apps as the header filter's
|
|
135
|
+
* PLACEHOLDER ("filtrar columna...") and carries no
|
|
136
|
+
* interpolation, so reusing it named all five boxes the
|
|
137
|
+
* same -- which is where this started. */
|
|
138
|
+
$input.setAttribute("aria-label", t("filter by column", {column: title}));
|
|
139
|
+
}
|
|
140
|
+
} catch(e) {
|
|
141
|
+
/* a table between renders has no columns to name */
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
92
145
|
function yui_tabulator_relocalize(table, t)
|
|
93
146
|
{
|
|
94
147
|
if(!table) {
|
|
95
148
|
return;
|
|
96
149
|
}
|
|
150
|
+
/* The header filters have no name of their own; give them one
|
|
151
|
+
* again in the new language. */
|
|
152
|
+
yui_tabulator_name_filters(table, t);
|
|
97
153
|
try {
|
|
98
154
|
let name = next_lang_name();
|
|
99
155
|
let strings = tabulator_strings(t);
|
|
@@ -125,4 +181,5 @@ function yui_tabulator_relocalize(table, t)
|
|
|
125
181
|
export {
|
|
126
182
|
yui_tabulator_lang,
|
|
127
183
|
yui_tabulator_relocalize,
|
|
184
|
+
yui_tabulator_name_filters,
|
|
128
185
|
};
|