@yuneta/gobj-ui 5.7.2 → 5.8.1
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
|
@@ -16198,7 +16198,7 @@ function build_ui$4(gobj) {
|
|
|
16198
16198
|
if (with_edition_mode) {
|
|
16199
16199
|
$table_toolbar = (0, _yuneta_gobj_js.createElement2)(["div", {
|
|
16200
16200
|
id: `${toolbar_id}`,
|
|
16201
|
-
class: "buttons mb-0"
|
|
16201
|
+
class: "TREEDB_TABLE_ACTIONS buttons mb-0"
|
|
16202
16202
|
}]);
|
|
16203
16203
|
let $edit_button = (0, _yuneta_gobj_js.createElement2)([
|
|
16204
16204
|
"button",
|
|
@@ -16322,19 +16322,19 @@ function build_ui$4(gobj) {
|
|
|
16322
16322
|
}
|
|
16323
16323
|
let $table_toolbar = create_table_toolbar();
|
|
16324
16324
|
let toolbar_id = (0, _yuneta_gobj_js.gobj_read_str_attr)(gobj, "toolbar_id");
|
|
16325
|
-
let $view_toolbar = (0, _yuneta_gobj_js.createElement2)(["div", { class: "is-flex is-align-items-center" }]);
|
|
16325
|
+
let $view_toolbar = (0, _yuneta_gobj_js.createElement2)(["div", { class: "TREEDB_TABLE_TOOLS is-flex is-align-items-center" }]);
|
|
16326
16326
|
let with_refresh_button = (0, _yuneta_gobj_js.gobj_read_bool_attr)(gobj, "with_refresh_button");
|
|
16327
16327
|
if ((0, _yuneta_gobj_js.gobj_read_bool_attr)(gobj, "with_search_button")) {
|
|
16328
16328
|
let search_id = `${toolbar_id}_search`;
|
|
16329
16329
|
let $search_box = (0, _yuneta_gobj_js.createElement2)([
|
|
16330
16330
|
"div",
|
|
16331
|
-
{ class: "control has-icons-left mr-1" },
|
|
16331
|
+
{ class: "TREEDB_TABLE_SEARCH control has-icons-left mr-1" },
|
|
16332
16332
|
[["input", {
|
|
16333
16333
|
id: search_id,
|
|
16334
16334
|
class: "input",
|
|
16335
16335
|
type: "text",
|
|
16336
|
-
placeholder: "search
|
|
16337
|
-
|
|
16336
|
+
placeholder: (0, i18next.t)("search"),
|
|
16337
|
+
"data-i18n-placeholder": "search"
|
|
16338
16338
|
}], [
|
|
16339
16339
|
"span",
|
|
16340
16340
|
{ class: "icon is-left" },
|
|
@@ -16389,7 +16389,7 @@ function build_ui$4(gobj) {
|
|
|
16389
16389
|
style: "height:100%;"
|
|
16390
16390
|
},
|
|
16391
16391
|
[["div", {
|
|
16392
|
-
class: "toolbar_tabulator_table m-1",
|
|
16392
|
+
class: "TREEDB_TABLE_TOOLBAR toolbar_tabulator_table m-1",
|
|
16393
16393
|
style: "display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap;"
|
|
16394
16394
|
}], ["div", {
|
|
16395
16395
|
id: `${(0, _yuneta_gobj_js.gobj_read_str_attr)(gobj, "table_id")}`,
|
package/dist/gobj-ui.es.js
CHANGED
|
@@ -16192,7 +16192,7 @@ function build_ui$4(gobj) {
|
|
|
16192
16192
|
if (with_edition_mode) {
|
|
16193
16193
|
$table_toolbar = createElement2(["div", {
|
|
16194
16194
|
id: `${toolbar_id}`,
|
|
16195
|
-
class: "buttons mb-0"
|
|
16195
|
+
class: "TREEDB_TABLE_ACTIONS buttons mb-0"
|
|
16196
16196
|
}]);
|
|
16197
16197
|
let $edit_button = createElement2([
|
|
16198
16198
|
"button",
|
|
@@ -16316,19 +16316,19 @@ function build_ui$4(gobj) {
|
|
|
16316
16316
|
}
|
|
16317
16317
|
let $table_toolbar = create_table_toolbar();
|
|
16318
16318
|
let toolbar_id = gobj_read_str_attr(gobj, "toolbar_id");
|
|
16319
|
-
let $view_toolbar = createElement2(["div", { class: "is-flex is-align-items-center" }]);
|
|
16319
|
+
let $view_toolbar = createElement2(["div", { class: "TREEDB_TABLE_TOOLS is-flex is-align-items-center" }]);
|
|
16320
16320
|
let with_refresh_button = gobj_read_bool_attr(gobj, "with_refresh_button");
|
|
16321
16321
|
if (gobj_read_bool_attr(gobj, "with_search_button")) {
|
|
16322
16322
|
let search_id = `${toolbar_id}_search`;
|
|
16323
16323
|
let $search_box = createElement2([
|
|
16324
16324
|
"div",
|
|
16325
|
-
{ class: "control has-icons-left mr-1" },
|
|
16325
|
+
{ class: "TREEDB_TABLE_SEARCH control has-icons-left mr-1" },
|
|
16326
16326
|
[["input", {
|
|
16327
16327
|
id: search_id,
|
|
16328
16328
|
class: "input",
|
|
16329
16329
|
type: "text",
|
|
16330
|
-
placeholder: "search
|
|
16331
|
-
|
|
16330
|
+
placeholder: t("search"),
|
|
16331
|
+
"data-i18n-placeholder": "search"
|
|
16332
16332
|
}], [
|
|
16333
16333
|
"span",
|
|
16334
16334
|
{ class: "icon is-left" },
|
|
@@ -16383,7 +16383,7 @@ function build_ui$4(gobj) {
|
|
|
16383
16383
|
style: "height:100%;"
|
|
16384
16384
|
},
|
|
16385
16385
|
[["div", {
|
|
16386
|
-
class: "toolbar_tabulator_table m-1",
|
|
16386
|
+
class: "TREEDB_TABLE_TOOLBAR toolbar_tabulator_table m-1",
|
|
16387
16387
|
style: "display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap;"
|
|
16388
16388
|
}], ["div", {
|
|
16389
16389
|
id: `${gobj_read_str_attr(gobj, "table_id")}`,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yuneta/gobj-ui",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.8.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/gobj-ui.cjs.js",
|
|
6
6
|
"module": "dist/gobj-ui.es.js",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"src/",
|
|
21
21
|
"vite-plugin-yuneta-html.js"
|
|
22
22
|
],
|
|
23
|
-
"description": "Yuneta UI Library
|
|
23
|
+
"description": "Yuneta UI Library \u2014 the active line: declarative shell (C_YUI_SHELL+NAV+PAGER+WIZARD) + windows, TreeDB views, forms, charts and maps. Consumed by wattyzer and the yunetas JS yunos (gui_agent, gui_treedb). The frozen legacy GClass GUI stack (C_YUI_MAIN/TABS/ROUTING) lives on the v1 branch, npm dist-tag 'legacy' (consumed by estadodelaire and hidraulia).",
|
|
24
24
|
"scripts": {
|
|
25
25
|
"build": "vite build",
|
|
26
26
|
"test": "vitest run",
|
|
@@ -46,6 +46,31 @@
|
|
|
46
46
|
min-width: 0;
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
+
/* Search box width: a rule, not an inline style, so the mobile block
|
|
50
|
+
* below can widen it (an inline max-width would win over any class). */
|
|
51
|
+
.TREEDB_TABLE_TOOLS .TREEDB_TABLE_SEARCH .input {
|
|
52
|
+
max-width: 200px;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/* Mobile: the tools of the list (search + refresh) take a row of their
|
|
56
|
+
* own, with the search stretched across it and the refresh pinned at
|
|
57
|
+
* the end. Without this the group keeps its natural width and leaves
|
|
58
|
+
* dead space, while the search -- the most used control of the two --
|
|
59
|
+
* stays the narrowest thing on screen. The refresh label is already
|
|
60
|
+
* dropped by is-hidden-mobile, decided in the markup: measuring at
|
|
61
|
+
* runtime would change the shape of the bar on a language switch. */
|
|
62
|
+
@media screen and (max-width: 768px) {
|
|
63
|
+
.TREEDB_TABLE_TOOLS {
|
|
64
|
+
width: 100%;
|
|
65
|
+
}
|
|
66
|
+
.TREEDB_TABLE_TOOLS .TREEDB_TABLE_SEARCH {
|
|
67
|
+
flex: 1 1 auto;
|
|
68
|
+
}
|
|
69
|
+
.TREEDB_TABLE_TOOLS .TREEDB_TABLE_SEARCH .input {
|
|
70
|
+
max-width: none;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
49
74
|
/* The edit/create form runs in the shell's standardized adaptive dialog
|
|
50
75
|
* (yui_shell_show_modal dialog:true, logical_class TREEDB_FORM_SHEET). The
|
|
51
76
|
* shell CSS already gives it the centred card / full-screen-mobile sheet;
|
|
@@ -343,7 +343,7 @@ function build_ui(gobj)
|
|
|
343
343
|
|
|
344
344
|
if(with_edition_mode) {
|
|
345
345
|
$table_toolbar = createElement2(
|
|
346
|
-
['div', {id: `${toolbar_id}`, class: 'buttons mb-0'}]
|
|
346
|
+
['div', {id: `${toolbar_id}`, class: 'TREEDB_TABLE_ACTIONS buttons mb-0'}]
|
|
347
347
|
);
|
|
348
348
|
let $edit_button = createElement2(
|
|
349
349
|
['button', {id: ``, class: 'button button-edit-record mr-1'}, [
|
|
@@ -463,7 +463,12 @@ function build_ui(gobj)
|
|
|
463
463
|
*----------------------------------------------*/
|
|
464
464
|
let toolbar_id = gobj_read_str_attr(gobj, "toolbar_id");
|
|
465
465
|
|
|
466
|
-
|
|
466
|
+
/* The tools of the list (search, refresh) sit apart from the record
|
|
467
|
+
* actions: actions left, tools right, and on mobile the tools take a
|
|
468
|
+
* row of their own with the search stretched across it. */
|
|
469
|
+
let $view_toolbar = createElement2(
|
|
470
|
+
['div', {class: 'TREEDB_TABLE_TOOLS is-flex is-align-items-center'}]
|
|
471
|
+
);
|
|
467
472
|
|
|
468
473
|
let with_refresh_button = gobj_read_bool_attr(gobj, "with_refresh_button");
|
|
469
474
|
let with_search_button = gobj_read_bool_attr(gobj, "with_search_button");
|
|
@@ -471,13 +476,16 @@ function build_ui(gobj)
|
|
|
471
476
|
if(with_search_button) {
|
|
472
477
|
let search_id = `${toolbar_id}_search`;
|
|
473
478
|
let $search_box = createElement2(
|
|
474
|
-
['div', {class: 'control has-icons-left mr-1'}, [
|
|
479
|
+
['div', {class: 'TREEDB_TABLE_SEARCH control has-icons-left mr-1'}, [
|
|
475
480
|
['input', {
|
|
476
481
|
id: search_id,
|
|
477
482
|
class: 'input',
|
|
478
483
|
type: 'text',
|
|
479
|
-
placeholder
|
|
480
|
-
|
|
484
|
+
/* The placeholder is not a text node, so the
|
|
485
|
+
* data-i18n walk cannot reach it — it needs its own
|
|
486
|
+
* key or it stays English for good. */
|
|
487
|
+
placeholder: t('search'),
|
|
488
|
+
'data-i18n-placeholder': 'search'
|
|
481
489
|
}],
|
|
482
490
|
['span', {class: 'icon is-left'}, [
|
|
483
491
|
['i', {class: 'yi-magnifying-glass'}]
|
|
@@ -536,7 +544,7 @@ function build_ui(gobj)
|
|
|
536
544
|
let table_id = gobj_read_str_attr(gobj, "table_id");
|
|
537
545
|
let $container = createElement2(
|
|
538
546
|
['div', {class: 'C_YUI_TREEDB_TOPIC_WITH_FORM', style: 'height:100%;'}, [
|
|
539
|
-
['div', {class: 'toolbar_tabulator_table m-1', style: 'display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap;'}],
|
|
547
|
+
['div', {class: 'TREEDB_TABLE_TOOLBAR toolbar_tabulator_table m-1', style: 'display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap;'}],
|
|
540
548
|
['div',
|
|
541
549
|
{
|
|
542
550
|
id: `${table_id}`,
|
package/src/shell_modals.js
CHANGED
|
@@ -562,6 +562,33 @@ export function yui_shell_confirm_yesno(shell, message, opts)
|
|
|
562
562
|
], opts).then(v => v === "yes");
|
|
563
563
|
}
|
|
564
564
|
|
|
565
|
+
/***************************************************************
|
|
566
|
+
* A DESTRUCTIVE confirmation: the button that does the damage is
|
|
567
|
+
* red, not blue.
|
|
568
|
+
*
|
|
569
|
+
* yui_shell_confirm_yesno() puts its yes in `is-link`, which is
|
|
570
|
+
* the right colour for "do you want to continue" and the wrong
|
|
571
|
+
* one for "this deletes an account": the two read the same at a
|
|
572
|
+
* glance, and the destructive one is the one that must not be
|
|
573
|
+
* clicked by reflex. The safe answer is also the LAST button,
|
|
574
|
+
* so Escape, the backdrop and the X all resolve to it.
|
|
575
|
+
*
|
|
576
|
+
* Returns a Promise<boolean>: true only if the red button was
|
|
577
|
+
* pressed.
|
|
578
|
+
***************************************************************/
|
|
579
|
+
export function yui_shell_confirm_danger(shell, message, opts)
|
|
580
|
+
{
|
|
581
|
+
let confirm_label = (opts && opts.confirm_label) || "Delete";
|
|
582
|
+
let cancel_label = (opts && opts.cancel_label) || "Cancel";
|
|
583
|
+
if(!opts || !opts.type) {
|
|
584
|
+
opts = Object.assign({}, opts, {type: "danger"});
|
|
585
|
+
}
|
|
586
|
+
return build_dialog(shell, message, [
|
|
587
|
+
{label: confirm_label, value: "confirm", kind: "danger"},
|
|
588
|
+
{label: cancel_label, value: "cancel"}
|
|
589
|
+
], opts).then(v => v === "confirm");
|
|
590
|
+
}
|
|
591
|
+
|
|
565
592
|
export function yui_shell_confirm_yesnocancel(shell, message, opts)
|
|
566
593
|
{
|
|
567
594
|
let yes_label = (opts && opts.yes_label) || "Yes";
|