@yuneta/gobj-ui 5.5.0 → 5.7.0
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/README.md +40 -0
- package/dist/gobj-ui.cjs.js +319 -149
- package/dist/gobj-ui.es.js +319 -150
- package/index.js +1 -0
- package/package.json +2 -2
- package/src/c_yui_form.js +100 -75
- package/src/c_yui_nav.js +6 -1
- package/src/c_yui_shell.css +47 -0
- package/src/c_yui_shell.js +106 -2
- package/src/form_toolbar_plan.js +59 -0
- package/src/form_toolbar_plan.test.js +54 -0
package/dist/gobj-ui.es.js
CHANGED
|
@@ -885,7 +885,7 @@ function mt_start$15(gobj) {
|
|
|
885
885
|
if (typeof shell_cfg.remember_section_position === "boolean") gobj_write_attr(gobj, "remember_section_position", shell_cfg.remember_section_position);
|
|
886
886
|
build_item_index(gobj, config);
|
|
887
887
|
instantiate_menus(gobj, config);
|
|
888
|
-
build_toolbar(gobj, config);
|
|
888
|
+
build_toolbar$1(gobj, config);
|
|
889
889
|
preinstantiate_eager_views(gobj);
|
|
890
890
|
if (gobj_read_attr(gobj, "use_hash")) {
|
|
891
891
|
priv.hash_handler = () => {
|
|
@@ -1611,7 +1611,7 @@ function safe_id(s) {
|
|
|
1611
1611
|
* Per-item `show_on` is honoured: each rendered item is wrapped with
|
|
1612
1612
|
* the same Bulma-helper logic as zones.
|
|
1613
1613
|
************************************************************/
|
|
1614
|
-
function build_toolbar(gobj, config) {
|
|
1614
|
+
function build_toolbar$1(gobj, config) {
|
|
1615
1615
|
let tb = config && config.toolbar;
|
|
1616
1616
|
if (!tb || !is_array(tb.items)) return;
|
|
1617
1617
|
let priv = gobj.priv;
|
|
@@ -1651,17 +1651,59 @@ function build_toolbar(gobj, config) {
|
|
|
1651
1651
|
$zone.appendChild($bar);
|
|
1652
1652
|
}
|
|
1653
1653
|
/************************************************************
|
|
1654
|
+
* The badge node of a toolbar item — the little count pinned to
|
|
1655
|
+
* the corner of its icon (unread notifications, active alarms).
|
|
1656
|
+
*
|
|
1657
|
+
* ALWAYS rendered, hidden when empty, so the runtime setter has a
|
|
1658
|
+
* node to write into and does not have to rebuild the button.
|
|
1659
|
+
*
|
|
1660
|
+
* EMPTY IS 0, "" AND null ALIKE: a badge reading "0" is worse than
|
|
1661
|
+
* no badge — it draws the eye to say nothing. A count is only
|
|
1662
|
+
* worth a pixel when there IS something.
|
|
1663
|
+
*
|
|
1664
|
+
* Capped at 99+: the toolbar is a fixed-width row, and a four
|
|
1665
|
+
* digit pill pushes the items next to it off a phone screen.
|
|
1666
|
+
*
|
|
1667
|
+
* role="status" and NOT aria-hidden, deliberately. The button
|
|
1668
|
+
* carries an explicit aria-label, and an explicit label REPLACES
|
|
1669
|
+
* the element's content for a screen reader — so a badge inside
|
|
1670
|
+
* it would be silent. As its own live region it is both read and
|
|
1671
|
+
* announced when the count changes, which is the whole point of a
|
|
1672
|
+
* badge that means "something needs you".
|
|
1673
|
+
************************************************************/
|
|
1674
|
+
function badge_text(value) {
|
|
1675
|
+
if (value === null || value === void 0 || value === false) return "";
|
|
1676
|
+
if (typeof value === "number") {
|
|
1677
|
+
if (!isFinite(value) || value <= 0) return "";
|
|
1678
|
+
return value > 99 ? "99+" : String(Math.floor(value));
|
|
1679
|
+
}
|
|
1680
|
+
return String(value).trim();
|
|
1681
|
+
}
|
|
1682
|
+
function badge_node(value) {
|
|
1683
|
+
let text = badge_text(value);
|
|
1684
|
+
let attrs = {
|
|
1685
|
+
class: "yui-toolbar-badge",
|
|
1686
|
+
role: "status"
|
|
1687
|
+
};
|
|
1688
|
+
if (!text) attrs.hidden = "hidden";
|
|
1689
|
+
return [
|
|
1690
|
+
"span",
|
|
1691
|
+
attrs,
|
|
1692
|
+
text
|
|
1693
|
+
];
|
|
1694
|
+
}
|
|
1695
|
+
/************************************************************
|
|
1654
1696
|
* Renderer for the default ("action") item kind.
|
|
1655
1697
|
************************************************************/
|
|
1656
1698
|
function build_toolbar_action_item(gobj, it) {
|
|
1657
1699
|
let children = [];
|
|
1658
1700
|
if (!empty_string(it.icon)) children.push([
|
|
1659
1701
|
"span",
|
|
1660
|
-
{ class: "icon" },
|
|
1661
|
-
["i", {
|
|
1702
|
+
{ class: "icon yui-toolbar-icon" },
|
|
1703
|
+
[["i", {
|
|
1662
1704
|
class: it.icon,
|
|
1663
1705
|
"aria-hidden": "true"
|
|
1664
|
-
}]
|
|
1706
|
+
}], badge_node(it.badge)]
|
|
1665
1707
|
]);
|
|
1666
1708
|
if (!empty_string(it.name)) children.push([
|
|
1667
1709
|
"span",
|
|
@@ -2672,6 +2714,41 @@ function yui_shell_set_toolbar_item_icon(shell_gobj, item_id, icon_class) {
|
|
|
2672
2714
|
if ($i) $i.className = icon_class;
|
|
2673
2715
|
}
|
|
2674
2716
|
/************************************************************
|
|
2717
|
+
* Set (or clear) a toolbar item's badge — the count pinned to
|
|
2718
|
+
* its icon.
|
|
2719
|
+
*
|
|
2720
|
+
* yui_shell_set_toolbar_item_badge(shell, "alarms", 3);
|
|
2721
|
+
* yui_shell_set_toolbar_item_badge(shell, "alarms", 0); // hidden
|
|
2722
|
+
*
|
|
2723
|
+
* This is the API that matters: a count is a RUNTIME fact. The
|
|
2724
|
+
* `badge` field of a toolbar item only seeds the first paint, and
|
|
2725
|
+
* an app whose number never changes did not need a badge.
|
|
2726
|
+
*
|
|
2727
|
+
* 0 / "" / null / false all clear it, and a number over 99 renders
|
|
2728
|
+
* "99+" — see badge_node(). Accepts a string for the states that
|
|
2729
|
+
* are not counts ("!", "…").
|
|
2730
|
+
*
|
|
2731
|
+
* Silent no-op on an unknown item id: a toolbar that does not
|
|
2732
|
+
* declare the item (an app without alarms) must not be an error
|
|
2733
|
+
* at every tick of whatever feeds the number.
|
|
2734
|
+
************************************************************/
|
|
2735
|
+
function yui_shell_set_toolbar_item_badge(shell_gobj, item_id, value) {
|
|
2736
|
+
if (!shell_gobj || !is_gobj(shell_gobj) || empty_string(item_id)) return;
|
|
2737
|
+
let $container = gobj_read_attr(shell_gobj, "$container");
|
|
2738
|
+
if (!$container) return;
|
|
2739
|
+
let $badge = $container.querySelector(`[data-toolbar-item-id="${item_id}"] .yui-toolbar-badge`);
|
|
2740
|
+
if (!$badge) return;
|
|
2741
|
+
let text = badge_text(value);
|
|
2742
|
+
if (!text) {
|
|
2743
|
+
$badge.textContent = "";
|
|
2744
|
+
$badge.setAttribute("hidden", "hidden");
|
|
2745
|
+
return;
|
|
2746
|
+
}
|
|
2747
|
+
if ($badge.textContent === text && !$badge.hasAttribute("hidden")) return;
|
|
2748
|
+
$badge.textContent = text;
|
|
2749
|
+
$badge.removeAttribute("hidden");
|
|
2750
|
+
}
|
|
2751
|
+
/************************************************************
|
|
2675
2752
|
* Programmatic close of any open toolbar dropdown. Useful for
|
|
2676
2753
|
* external triggers (e.g. EV_LOGOUT firing from elsewhere) that
|
|
2677
2754
|
* want to dismiss whatever menu is on screen.
|
|
@@ -5678,6 +5755,59 @@ function refresh_clear($input) {
|
|
|
5678
5755
|
$btn.classList.toggle("is-visible", clear_visible($input));
|
|
5679
5756
|
}
|
|
5680
5757
|
//#endregion
|
|
5758
|
+
//#region src/form_toolbar_plan.js
|
|
5759
|
+
/***********************************************************************
|
|
5760
|
+
* form_toolbar_plan.js
|
|
5761
|
+
*
|
|
5762
|
+
* Which buttons the C_YUI_FORM toolbar shows, and where.
|
|
5763
|
+
*
|
|
5764
|
+
* Pure, so it can be tested without a DOM: the gclass turns the
|
|
5765
|
+
* plan into elements, this decides the plan.
|
|
5766
|
+
*
|
|
5767
|
+
* Copyright (c) 2026, ArtGins.
|
|
5768
|
+
* All Rights Reserved.
|
|
5769
|
+
***********************************************************************/
|
|
5770
|
+
var LEFT_BUTTONS = [
|
|
5771
|
+
"save",
|
|
5772
|
+
"undo",
|
|
5773
|
+
"clear"
|
|
5774
|
+
];
|
|
5775
|
+
var RIGHT_BUTTONS = ["copy", "paste"];
|
|
5776
|
+
var DEFAULT_TOOLBAR = [
|
|
5777
|
+
"save",
|
|
5778
|
+
"undo",
|
|
5779
|
+
"clear",
|
|
5780
|
+
"copy",
|
|
5781
|
+
"paste"
|
|
5782
|
+
];
|
|
5783
|
+
/***************************************************************
|
|
5784
|
+
* plan_toolbar(wanted) -> {left, right, unknown}
|
|
5785
|
+
*
|
|
5786
|
+
* wanted an array of button names, in the order asked for.
|
|
5787
|
+
* Anything that is not an array means "the default
|
|
5788
|
+
* five", so a caller that sets nothing keeps exactly
|
|
5789
|
+
* the toolbar this gclass always had.
|
|
5790
|
+
* [] means no toolbar at all.
|
|
5791
|
+
*
|
|
5792
|
+
* unknown names that match no button. They are reported and
|
|
5793
|
+
* NOT silently dropped: a typo in the list would
|
|
5794
|
+
* otherwise remove the save button with no trace.
|
|
5795
|
+
***************************************************************/
|
|
5796
|
+
function plan_toolbar(wanted) {
|
|
5797
|
+
if (!Array.isArray(wanted)) wanted = DEFAULT_TOOLBAR;
|
|
5798
|
+
let left = [];
|
|
5799
|
+
let right = [];
|
|
5800
|
+
let unknown = [];
|
|
5801
|
+
for (let name of wanted) if (LEFT_BUTTONS.indexOf(name) >= 0) left.push(name);
|
|
5802
|
+
else if (RIGHT_BUTTONS.indexOf(name) >= 0) right.push(name);
|
|
5803
|
+
else unknown.push(name);
|
|
5804
|
+
return {
|
|
5805
|
+
left,
|
|
5806
|
+
right,
|
|
5807
|
+
unknown
|
|
5808
|
+
};
|
|
5809
|
+
}
|
|
5810
|
+
//#endregion
|
|
5681
5811
|
//#region src/yui_theme.js
|
|
5682
5812
|
/***********************************************************************
|
|
5683
5813
|
* yui_theme.js
|
|
@@ -5809,6 +5939,13 @@ var attrs_table$13 = [
|
|
|
5809
5939
|
SDATA(data_type_t.DTP_BOOLEAN, "with_checkbox", 0, false, "Show a first column with checkbox to select rows"),
|
|
5810
5940
|
SDATA(data_type_t.DTP_BOOLEAN, "with_rownum", 0, false, "Print first column with row number"),
|
|
5811
5941
|
SDATA(data_type_t.DTP_BOOLEAN, "with_delete_row_btn", 0, false, "Print last column with delete row button"),
|
|
5942
|
+
SDATA(data_type_t.DTP_JSON, "toolbar", 0, [
|
|
5943
|
+
"save",
|
|
5944
|
+
"undo",
|
|
5945
|
+
"clear",
|
|
5946
|
+
"copy",
|
|
5947
|
+
"paste"
|
|
5948
|
+
], "Toolbar buttons to show, in order: save, undo, clear, copy, paste. [] hides the toolbar"),
|
|
5812
5949
|
SDATA(data_type_t.DTP_JSON, "tabulator_settings", 0, {
|
|
5813
5950
|
layout: "fitDataFill",
|
|
5814
5951
|
validationMode: "highlight",
|
|
@@ -5919,6 +6056,175 @@ async function readClipboard$1(gobj) {
|
|
|
5919
6056
|
}
|
|
5920
6057
|
}
|
|
5921
6058
|
/************************************************************
|
|
6059
|
+
* Bottom toolbar, from the `toolbar` attr.
|
|
6060
|
+
*
|
|
6061
|
+
* The five buttons it can show, and their order, are the
|
|
6062
|
+
* caller's: a dialog with a single action asks for ["save"],
|
|
6063
|
+
* and [] leaves no toolbar at all. Default is the five it
|
|
6064
|
+
* always had, so nothing moves for a caller that says nothing.
|
|
6065
|
+
************************************************************/
|
|
6066
|
+
function toolbar_button(gobj, name) {
|
|
6067
|
+
switch (name) {
|
|
6068
|
+
case "save": return [
|
|
6069
|
+
"button",
|
|
6070
|
+
{
|
|
6071
|
+
class: "button p-1 button-save",
|
|
6072
|
+
title: "save",
|
|
6073
|
+
"aria-label": "save",
|
|
6074
|
+
disabled: true
|
|
6075
|
+
},
|
|
6076
|
+
[[
|
|
6077
|
+
"span",
|
|
6078
|
+
{ class: "icon m-0" },
|
|
6079
|
+
"<i class=\"yi-floppy-disk\"></i>"
|
|
6080
|
+
], [
|
|
6081
|
+
"span",
|
|
6082
|
+
{
|
|
6083
|
+
class: "is-hidden-mobile pl-1 pr-1",
|
|
6084
|
+
i18n: "save"
|
|
6085
|
+
},
|
|
6086
|
+
"save"
|
|
6087
|
+
]],
|
|
6088
|
+
{ click: function(evt) {
|
|
6089
|
+
evt.stopPropagation();
|
|
6090
|
+
gobj_send_event(gobj, "EV_SAVE_RECORD", {}, gobj);
|
|
6091
|
+
} }
|
|
6092
|
+
];
|
|
6093
|
+
case "undo": return [
|
|
6094
|
+
"button",
|
|
6095
|
+
{
|
|
6096
|
+
class: "button p-1 button-undo",
|
|
6097
|
+
title: "undo",
|
|
6098
|
+
"aria-label": "undo",
|
|
6099
|
+
disabled: true
|
|
6100
|
+
},
|
|
6101
|
+
[[
|
|
6102
|
+
"span",
|
|
6103
|
+
{ class: "icon m-0" },
|
|
6104
|
+
"<i class=\"yi-arrow-rotate-left\"></i>"
|
|
6105
|
+
], [
|
|
6106
|
+
"span",
|
|
6107
|
+
{
|
|
6108
|
+
class: "is-hidden-mobile pl-1 pr-1",
|
|
6109
|
+
i18n: "undo"
|
|
6110
|
+
},
|
|
6111
|
+
"undo"
|
|
6112
|
+
]],
|
|
6113
|
+
{ click: function(evt) {
|
|
6114
|
+
evt.stopPropagation();
|
|
6115
|
+
gobj_send_event(gobj, "EV_UNDO_RECORD", {}, gobj);
|
|
6116
|
+
} }
|
|
6117
|
+
];
|
|
6118
|
+
case "clear": return [
|
|
6119
|
+
"button",
|
|
6120
|
+
{
|
|
6121
|
+
class: "button p-1",
|
|
6122
|
+
title: "clear",
|
|
6123
|
+
"aria-label": "clear"
|
|
6124
|
+
},
|
|
6125
|
+
[[
|
|
6126
|
+
"span",
|
|
6127
|
+
{ class: "icon m-0" },
|
|
6128
|
+
"<i class=\"yi-broom-wide\"></i>"
|
|
6129
|
+
], [
|
|
6130
|
+
"span",
|
|
6131
|
+
{
|
|
6132
|
+
class: "is-hidden-mobile pl-1 pr-1",
|
|
6133
|
+
i18n: "clear"
|
|
6134
|
+
},
|
|
6135
|
+
"clear"
|
|
6136
|
+
]],
|
|
6137
|
+
{ click: function(evt) {
|
|
6138
|
+
evt.stopPropagation();
|
|
6139
|
+
gobj_send_event(gobj, "EV_CLEAR_RECORD", {}, gobj);
|
|
6140
|
+
} }
|
|
6141
|
+
];
|
|
6142
|
+
case "copy": return [
|
|
6143
|
+
"button",
|
|
6144
|
+
{
|
|
6145
|
+
class: "button p-1",
|
|
6146
|
+
title: "copy",
|
|
6147
|
+
"aria-label": "copy"
|
|
6148
|
+
},
|
|
6149
|
+
[[
|
|
6150
|
+
"span",
|
|
6151
|
+
{ class: "icon m-0" },
|
|
6152
|
+
"<i class=\"yi-copy\"></i>"
|
|
6153
|
+
], [
|
|
6154
|
+
"span",
|
|
6155
|
+
{
|
|
6156
|
+
class: "is-hidden-mobile pl-1 pr-1",
|
|
6157
|
+
i18n: "copy"
|
|
6158
|
+
},
|
|
6159
|
+
"copy"
|
|
6160
|
+
]],
|
|
6161
|
+
{ click: function(evt) {
|
|
6162
|
+
evt.stopPropagation();
|
|
6163
|
+
gobj_send_event(gobj, "EV_COPY_RECORD", {}, gobj);
|
|
6164
|
+
} }
|
|
6165
|
+
];
|
|
6166
|
+
case "paste": return [
|
|
6167
|
+
"button",
|
|
6168
|
+
{
|
|
6169
|
+
class: "button p-1",
|
|
6170
|
+
title: "paste",
|
|
6171
|
+
"aria-label": "paste"
|
|
6172
|
+
},
|
|
6173
|
+
[[
|
|
6174
|
+
"span",
|
|
6175
|
+
{ class: "icon m-0" },
|
|
6176
|
+
"<i class=\"yi-paste\"></i>"
|
|
6177
|
+
], [
|
|
6178
|
+
"span",
|
|
6179
|
+
{
|
|
6180
|
+
class: "is-hidden-mobile pl-1 pr-1",
|
|
6181
|
+
i18n: "paste"
|
|
6182
|
+
},
|
|
6183
|
+
"paste"
|
|
6184
|
+
]],
|
|
6185
|
+
{ click: async function(evt) {
|
|
6186
|
+
evt.stopPropagation();
|
|
6187
|
+
await readClipboard$1(gobj);
|
|
6188
|
+
} }
|
|
6189
|
+
];
|
|
6190
|
+
default: return null;
|
|
6191
|
+
}
|
|
6192
|
+
}
|
|
6193
|
+
function build_toolbar(gobj) {
|
|
6194
|
+
const plan = plan_toolbar(gobj_read_attr(gobj, "toolbar"));
|
|
6195
|
+
for (let name of plan.unknown) log_warning(`${gobj_short_name(gobj)}: unknown toolbar button '${name}'`);
|
|
6196
|
+
if (!plan.left.length && !plan.right.length) return [
|
|
6197
|
+
"span",
|
|
6198
|
+
{
|
|
6199
|
+
class: "yui-toolbar-form-empty",
|
|
6200
|
+
style: "display:none;"
|
|
6201
|
+
},
|
|
6202
|
+
""
|
|
6203
|
+
];
|
|
6204
|
+
return [
|
|
6205
|
+
"div",
|
|
6206
|
+
{
|
|
6207
|
+
class: "yui-toolbar-form is-flex-shrink-0 is-flex is-flex-direction-row is-justify-content-space-between is-align-items-center",
|
|
6208
|
+
style: "width:100%; flex-wrap:wrap; row-gap:6px;"
|
|
6209
|
+
},
|
|
6210
|
+
[[
|
|
6211
|
+
"div",
|
|
6212
|
+
{
|
|
6213
|
+
class: "p-1 is-flex is-flex-direction-row is-align-items-center",
|
|
6214
|
+
style: "column-gap:6px;"
|
|
6215
|
+
},
|
|
6216
|
+
plan.left.map((n) => toolbar_button(gobj, n))
|
|
6217
|
+
], [
|
|
6218
|
+
"div",
|
|
6219
|
+
{
|
|
6220
|
+
class: "p-1 is-flex is-flex-direction-row is-align-items-center",
|
|
6221
|
+
style: "column-gap:6px;"
|
|
6222
|
+
},
|
|
6223
|
+
plan.right.map((n) => toolbar_button(gobj, n))
|
|
6224
|
+
]]
|
|
6225
|
+
];
|
|
6226
|
+
}
|
|
6227
|
+
/************************************************************
|
|
5922
6228
|
* Build UI
|
|
5923
6229
|
************************************************************/
|
|
5924
6230
|
function build_ui$11(gobj) {
|
|
@@ -5935,149 +6241,7 @@ function build_ui$11(gobj) {
|
|
|
5935
6241
|
style: "overflow-y:auto; min-height:0;"
|
|
5936
6242
|
},
|
|
5937
6243
|
build_form(gobj)
|
|
5938
|
-
],
|
|
5939
|
-
"div",
|
|
5940
|
-
{
|
|
5941
|
-
class: "yui-toolbar-form is-flex-shrink-0 is-flex is-flex-direction-row is-justify-content-space-between is-align-items-center",
|
|
5942
|
-
style: "width:100%; flex-wrap:wrap; row-gap:6px;"
|
|
5943
|
-
},
|
|
5944
|
-
[[
|
|
5945
|
-
"div",
|
|
5946
|
-
{
|
|
5947
|
-
class: "p-1 is-flex is-flex-direction-row is-align-items-center",
|
|
5948
|
-
style: "column-gap:6px;"
|
|
5949
|
-
},
|
|
5950
|
-
[
|
|
5951
|
-
[
|
|
5952
|
-
"button",
|
|
5953
|
-
{
|
|
5954
|
-
class: "button p-1 button-save",
|
|
5955
|
-
title: "save",
|
|
5956
|
-
"aria-label": "save",
|
|
5957
|
-
disabled: true
|
|
5958
|
-
},
|
|
5959
|
-
[[
|
|
5960
|
-
"span",
|
|
5961
|
-
{ class: "icon m-0" },
|
|
5962
|
-
"<i class=\"yi-floppy-disk\"></i>"
|
|
5963
|
-
], [
|
|
5964
|
-
"span",
|
|
5965
|
-
{
|
|
5966
|
-
class: "is-hidden-mobile pl-1 pr-1",
|
|
5967
|
-
i18n: "save"
|
|
5968
|
-
},
|
|
5969
|
-
"save"
|
|
5970
|
-
]],
|
|
5971
|
-
{ click: function(evt) {
|
|
5972
|
-
evt.stopPropagation();
|
|
5973
|
-
gobj_send_event(gobj, "EV_SAVE_RECORD", {}, gobj);
|
|
5974
|
-
} }
|
|
5975
|
-
],
|
|
5976
|
-
[
|
|
5977
|
-
"button",
|
|
5978
|
-
{
|
|
5979
|
-
class: "button p-1 button-undo",
|
|
5980
|
-
title: "undo",
|
|
5981
|
-
"aria-label": "undo",
|
|
5982
|
-
disabled: true
|
|
5983
|
-
},
|
|
5984
|
-
[[
|
|
5985
|
-
"span",
|
|
5986
|
-
{ class: "icon m-0" },
|
|
5987
|
-
"<i class=\"yi-arrow-rotate-left\"></i>"
|
|
5988
|
-
], [
|
|
5989
|
-
"span",
|
|
5990
|
-
{
|
|
5991
|
-
class: "is-hidden-mobile pl-1 pr-1",
|
|
5992
|
-
i18n: "undo"
|
|
5993
|
-
},
|
|
5994
|
-
"undo"
|
|
5995
|
-
]],
|
|
5996
|
-
{ click: function(evt) {
|
|
5997
|
-
evt.stopPropagation();
|
|
5998
|
-
gobj_send_event(gobj, "EV_UNDO_RECORD", {}, gobj);
|
|
5999
|
-
} }
|
|
6000
|
-
],
|
|
6001
|
-
[
|
|
6002
|
-
"button",
|
|
6003
|
-
{
|
|
6004
|
-
class: "button p-1",
|
|
6005
|
-
title: "clear",
|
|
6006
|
-
"aria-label": "clear"
|
|
6007
|
-
},
|
|
6008
|
-
[[
|
|
6009
|
-
"span",
|
|
6010
|
-
{ class: "icon m-0" },
|
|
6011
|
-
"<i class=\"yi-broom-wide\"></i>"
|
|
6012
|
-
], [
|
|
6013
|
-
"span",
|
|
6014
|
-
{
|
|
6015
|
-
class: "is-hidden-mobile pl-1 pr-1",
|
|
6016
|
-
i18n: "clear"
|
|
6017
|
-
},
|
|
6018
|
-
"clear"
|
|
6019
|
-
]],
|
|
6020
|
-
{ click: function(evt) {
|
|
6021
|
-
evt.stopPropagation();
|
|
6022
|
-
gobj_send_event(gobj, "EV_CLEAR_RECORD", {}, gobj);
|
|
6023
|
-
} }
|
|
6024
|
-
]
|
|
6025
|
-
]
|
|
6026
|
-
], [
|
|
6027
|
-
"div",
|
|
6028
|
-
{
|
|
6029
|
-
class: "p-1 is-flex is-flex-direction-row is-align-items-center",
|
|
6030
|
-
style: "column-gap:6px;"
|
|
6031
|
-
},
|
|
6032
|
-
[[
|
|
6033
|
-
"button",
|
|
6034
|
-
{
|
|
6035
|
-
class: "button p-1",
|
|
6036
|
-
title: "copy",
|
|
6037
|
-
"aria-label": "copy"
|
|
6038
|
-
},
|
|
6039
|
-
[[
|
|
6040
|
-
"span",
|
|
6041
|
-
{ class: "icon m-0" },
|
|
6042
|
-
"<i class=\"yi-copy\"></i>"
|
|
6043
|
-
], [
|
|
6044
|
-
"span",
|
|
6045
|
-
{
|
|
6046
|
-
class: "is-hidden-mobile pl-1 pr-1",
|
|
6047
|
-
i18n: "copy"
|
|
6048
|
-
},
|
|
6049
|
-
"copy"
|
|
6050
|
-
]],
|
|
6051
|
-
{ click: function(evt) {
|
|
6052
|
-
evt.stopPropagation();
|
|
6053
|
-
gobj_send_event(gobj, "EV_COPY_RECORD", {}, gobj);
|
|
6054
|
-
} }
|
|
6055
|
-
], [
|
|
6056
|
-
"button",
|
|
6057
|
-
{
|
|
6058
|
-
class: "button p-1",
|
|
6059
|
-
title: "paste",
|
|
6060
|
-
"aria-label": "paste"
|
|
6061
|
-
},
|
|
6062
|
-
[[
|
|
6063
|
-
"span",
|
|
6064
|
-
{ class: "icon m-0" },
|
|
6065
|
-
"<i class=\"yi-paste\"></i>"
|
|
6066
|
-
], [
|
|
6067
|
-
"span",
|
|
6068
|
-
{
|
|
6069
|
-
class: "is-hidden-mobile pl-1 pr-1",
|
|
6070
|
-
i18n: "paste"
|
|
6071
|
-
},
|
|
6072
|
-
"paste"
|
|
6073
|
-
]],
|
|
6074
|
-
{ click: async function(evt) {
|
|
6075
|
-
evt.stopPropagation();
|
|
6076
|
-
await readClipboard$1(gobj);
|
|
6077
|
-
} }
|
|
6078
|
-
]]
|
|
6079
|
-
]]
|
|
6080
|
-
]]
|
|
6244
|
+
], build_toolbar(gobj)]
|
|
6081
6245
|
]);
|
|
6082
6246
|
gobj_write_attr(gobj, "$container", $container);
|
|
6083
6247
|
apply_form_mode(gobj, $container.querySelector("form"));
|
|
@@ -12938,7 +13102,12 @@ function cards_grid_descriptor(items, show_label) {
|
|
|
12938
13102
|
* container; build_ui re-applies them on every rebuild.
|
|
12939
13103
|
*
|
|
12940
13104
|
* Each item supports:
|
|
12941
|
-
* id, name, icon (CSS class or svg id), route,
|
|
13105
|
+
* id, name, icon (CSS class or svg id), route, disabled
|
|
13106
|
+
* (`badge` was listed here for a long time and NOTHING ever
|
|
13107
|
+
* rendered it — a menu item cannot carry a count today. The
|
|
13108
|
+
* toolbar can: `badge` on a toolbar item plus
|
|
13109
|
+
* yui_shell_set_toolbar_item_badge(). Implement it here the
|
|
13110
|
+
* day a menu entry needs one, rather than re-listing it.)
|
|
12942
13111
|
* class — extra CSS class(es) on the item (tabs layout), e.g.
|
|
12943
13112
|
* a per-item state colour like "yui-nav-disconnected"
|
|
12944
13113
|
* closable — render a trailing ✕ that emits EV_NAV_ITEM_CLOSE
|
|
@@ -53529,6 +53698,6 @@ function setup_frontend_view(self) {
|
|
|
53529
53698
|
return win;
|
|
53530
53699
|
}
|
|
53531
53700
|
//#endregion
|
|
53532
|
-
export { EditControl, MarkerControl, YUI_PERIODS, YUI_PERIODS_DEFAULT, YUI_ROLLING, addClasses, apply_dev_traces, attach_clear, build_dev_panel, dev_window_was_open, disableElements, enableElements, epoch_to_local_input, epoch_to_ms, expose_view_container, fmt_epoch, getStrokeColor, infer_period, info_traffic, inject_svg_icons, is_current_period, iso_week, local_input_to_epoch, ms_to_epoch, period_bounds, period_bounds_epoch, period_label, period_name, period_shift, period_spec, period_start, refresh_clear, register_c_g6_nodes_tree, register_c_yui_form, register_c_yui_gobj_tree_js, register_c_yui_json, register_c_yui_json_graph, register_c_yui_map, register_c_yui_nav, register_c_yui_pager, register_c_yui_period, register_c_yui_service_view, register_c_yui_shell, register_c_yui_treedb_graph, register_c_yui_treedb_schema, register_c_yui_treedb_topic_with_form, register_c_yui_treedb_topics, register_c_yui_uplot, register_c_yui_window, register_c_yui_window_manager, register_c_yui_wizard, removeChildElements, removeClasses, rolling_bounds, safe_locale, set_active_state, set_cancel_state, set_submit_state, setup_dev, setup_frontend_view, toggleClasses, yui_is_dark, yui_mount_service_view, yui_shell_close_drawer, yui_shell_close_dropdown, yui_shell_confirm_ok, yui_shell_confirm_yesno, yui_shell_confirm_yesnocancel, yui_shell_navigate, yui_shell_open_drawer, yui_shell_overlay_dismissed, yui_shell_pop_escape, yui_shell_push_escape, yui_shell_refresh_avatars, yui_shell_register_event_handler, yui_shell_register_overlay, yui_shell_set_avatar_provider, yui_shell_set_connection_state, yui_shell_set_sub_routes, yui_shell_set_toolbar_item_icon, yui_shell_set_translator, yui_shell_show_error, yui_shell_show_info, yui_shell_show_modal, yui_shell_show_route_map, yui_shell_show_warning, yui_shell_toggle_drawer, yui_shell_unpark_route, yui_theme_now, yui_toolbar, yui_watch_theme };
|
|
53701
|
+
export { EditControl, MarkerControl, YUI_PERIODS, YUI_PERIODS_DEFAULT, YUI_ROLLING, addClasses, apply_dev_traces, attach_clear, build_dev_panel, dev_window_was_open, disableElements, enableElements, epoch_to_local_input, epoch_to_ms, expose_view_container, fmt_epoch, getStrokeColor, infer_period, info_traffic, inject_svg_icons, is_current_period, iso_week, local_input_to_epoch, ms_to_epoch, period_bounds, period_bounds_epoch, period_label, period_name, period_shift, period_spec, period_start, refresh_clear, register_c_g6_nodes_tree, register_c_yui_form, register_c_yui_gobj_tree_js, register_c_yui_json, register_c_yui_json_graph, register_c_yui_map, register_c_yui_nav, register_c_yui_pager, register_c_yui_period, register_c_yui_service_view, register_c_yui_shell, register_c_yui_treedb_graph, register_c_yui_treedb_schema, register_c_yui_treedb_topic_with_form, register_c_yui_treedb_topics, register_c_yui_uplot, register_c_yui_window, register_c_yui_window_manager, register_c_yui_wizard, removeChildElements, removeClasses, rolling_bounds, safe_locale, set_active_state, set_cancel_state, set_submit_state, setup_dev, setup_frontend_view, toggleClasses, yui_is_dark, yui_mount_service_view, yui_shell_close_drawer, yui_shell_close_dropdown, yui_shell_confirm_ok, yui_shell_confirm_yesno, yui_shell_confirm_yesnocancel, yui_shell_navigate, yui_shell_open_drawer, yui_shell_overlay_dismissed, yui_shell_pop_escape, yui_shell_push_escape, yui_shell_refresh_avatars, yui_shell_register_event_handler, yui_shell_register_overlay, yui_shell_set_avatar_provider, yui_shell_set_connection_state, yui_shell_set_sub_routes, yui_shell_set_toolbar_item_badge, yui_shell_set_toolbar_item_icon, yui_shell_set_translator, yui_shell_show_error, yui_shell_show_info, yui_shell_show_modal, yui_shell_show_route_map, yui_shell_show_warning, yui_shell_toggle_drawer, yui_shell_unpark_route, yui_theme_now, yui_toolbar, yui_watch_theme };
|
|
53533
53702
|
|
|
53534
53703
|
//# sourceMappingURL=gobj-ui.es.js.map
|
package/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yuneta/gobj-ui",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.7.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/gobj-ui.cjs.js",
|
|
6
6
|
"module": "dist/gobj-ui.es.js",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"@yuneta/gobj-js": "^7.8.7",
|
|
39
39
|
"bulma": "^1.0.4",
|
|
40
40
|
"i18next": "^26.3.6",
|
|
41
|
-
"maplibre-gl": "^6.
|
|
41
|
+
"maplibre-gl": "^6.1.0",
|
|
42
42
|
"tabulator-tables": "^6.5.2",
|
|
43
43
|
"tom-select": "^2.6.2",
|
|
44
44
|
"uplot": "^1.6.32",
|