@yuneta/gobj-ui 7.23.180 → 7.23.182
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 +1 -1
- package/dist/gobj-ui.cjs.js +25 -24
- package/dist/gobj-ui.es.js +25 -24
- package/package.json +1 -1
- package/src/c_yui_json.js +9 -0
- package/src/c_yui_treedb_topic_with_form.js +22 -23
package/README.md
CHANGED
|
@@ -572,7 +572,7 @@ Two layout facts the browser taught this component, both worth keeping:
|
|
|
572
572
|
|
|
573
573
|
- Attributes: `subscriber`, `title` (i18n key, optional — hidden on mobile,
|
|
574
574
|
where the toolbar cannot hold it as well as the buttons), `json_data`
|
|
575
|
-
(initial JSON, optional), `view_mode` (`"tree"` default | `"text"` |
|
|
575
|
+
(initial JSON, optional — given, the viewer starts in `ST_READY`), `view_mode` (`"tree"` default | `"text"` |
|
|
576
576
|
`"graph"`), `$container` (mounted by the parent).
|
|
577
577
|
- Input events: `EV_SET_JSON {json}` (replace the whole document; `ST_EMPTY` →
|
|
578
578
|
`ST_READY`), `EV_SUBTREE_LOADED {path, json}` (splice a fetched subtree),
|
package/dist/gobj-ui.cjs.js
CHANGED
|
@@ -14023,6 +14023,7 @@ function mt_create$13(gobj) {
|
|
|
14023
14023
|
* Framework Method: Start
|
|
14024
14024
|
***************************************************************/
|
|
14025
14025
|
function mt_start$13(gobj) {
|
|
14026
|
+
if (gobj.priv.root !== null) (0, _yuneta_gobj_js.gobj_change_state)(gobj, "ST_READY");
|
|
14026
14027
|
render_view$1(gobj);
|
|
14027
14028
|
}
|
|
14028
14029
|
/***************************************************************
|
|
@@ -26820,57 +26821,57 @@ function build_ui$5(gobj) {
|
|
|
26820
26821
|
});
|
|
26821
26822
|
$view_toolbar.appendChild($search_box);
|
|
26822
26823
|
}
|
|
26823
|
-
if (
|
|
26824
|
-
let $
|
|
26824
|
+
if (with_schema_button) {
|
|
26825
|
+
let $schema = (0, _yuneta_gobj_js.createElement2)([
|
|
26825
26826
|
"button",
|
|
26826
26827
|
{
|
|
26827
|
-
class: "button mr-1",
|
|
26828
|
-
title: (0, i18next.t)("
|
|
26829
|
-
"data-i18n-title": "
|
|
26830
|
-
"aria-label": (0, i18next.t)("
|
|
26831
|
-
"data-i18n-aria-label": "
|
|
26828
|
+
class: "TREEDB_TABLE_SCHEMA button mr-1",
|
|
26829
|
+
title: (0, i18next.t)("schema"),
|
|
26830
|
+
"data-i18n-title": "schema",
|
|
26831
|
+
"aria-label": (0, i18next.t)("schema"),
|
|
26832
|
+
"data-i18n-aria-label": "schema"
|
|
26832
26833
|
},
|
|
26833
|
-
[yui_toolbar_icon("yi-
|
|
26834
|
+
[yui_toolbar_icon("yi-hexagon-nodes"), [
|
|
26834
26835
|
"span",
|
|
26835
26836
|
{
|
|
26836
26837
|
class: "is-hidden-mobile",
|
|
26837
|
-
i18n: "
|
|
26838
|
+
i18n: "schema",
|
|
26838
26839
|
style: "padding-left:5px;"
|
|
26839
26840
|
},
|
|
26840
|
-
"
|
|
26841
|
+
"schema"
|
|
26841
26842
|
]],
|
|
26842
26843
|
{ "click": (event) => {
|
|
26843
26844
|
event.stopPropagation();
|
|
26844
|
-
(0, _yuneta_gobj_js.gobj_send_event)(gobj, "
|
|
26845
|
+
(0, _yuneta_gobj_js.gobj_send_event)(gobj, "EV_SHOW_SCHEMA", {}, gobj);
|
|
26845
26846
|
} }
|
|
26846
26847
|
]);
|
|
26847
|
-
$view_toolbar.appendChild($
|
|
26848
|
+
$view_toolbar.appendChild($schema);
|
|
26848
26849
|
}
|
|
26849
|
-
if (
|
|
26850
|
-
let $
|
|
26850
|
+
if (with_refresh_button) {
|
|
26851
|
+
let $refresh = (0, _yuneta_gobj_js.createElement2)([
|
|
26851
26852
|
"button",
|
|
26852
26853
|
{
|
|
26853
|
-
class: "
|
|
26854
|
-
title: (0, i18next.t)("
|
|
26855
|
-
"data-i18n-title": "
|
|
26856
|
-
"aria-label": (0, i18next.t)("
|
|
26857
|
-
"data-i18n-aria-label": "
|
|
26854
|
+
class: "button mr-1",
|
|
26855
|
+
title: (0, i18next.t)("refresh"),
|
|
26856
|
+
"data-i18n-title": "refresh",
|
|
26857
|
+
"aria-label": (0, i18next.t)("refresh"),
|
|
26858
|
+
"data-i18n-aria-label": "refresh"
|
|
26858
26859
|
},
|
|
26859
|
-
[yui_toolbar_icon("yi-
|
|
26860
|
+
[yui_toolbar_icon("yi-arrows-rotate"), [
|
|
26860
26861
|
"span",
|
|
26861
26862
|
{
|
|
26862
26863
|
class: "is-hidden-mobile",
|
|
26863
|
-
i18n: "
|
|
26864
|
+
i18n: "refresh",
|
|
26864
26865
|
style: "padding-left:5px;"
|
|
26865
26866
|
},
|
|
26866
|
-
"
|
|
26867
|
+
"refresh"
|
|
26867
26868
|
]],
|
|
26868
26869
|
{ "click": (event) => {
|
|
26869
26870
|
event.stopPropagation();
|
|
26870
|
-
(0, _yuneta_gobj_js.gobj_send_event)(gobj, "
|
|
26871
|
+
(0, _yuneta_gobj_js.gobj_send_event)(gobj, "EV_REFRESH", {}, gobj);
|
|
26871
26872
|
} }
|
|
26872
26873
|
]);
|
|
26873
|
-
$view_toolbar.appendChild($
|
|
26874
|
+
$view_toolbar.appendChild($refresh);
|
|
26874
26875
|
}
|
|
26875
26876
|
if (with_columns_button) {
|
|
26876
26877
|
let $columns = (0, _yuneta_gobj_js.createElement2)([
|
package/dist/gobj-ui.es.js
CHANGED
|
@@ -14018,6 +14018,7 @@ function mt_create$13(gobj) {
|
|
|
14018
14018
|
* Framework Method: Start
|
|
14019
14019
|
***************************************************************/
|
|
14020
14020
|
function mt_start$13(gobj) {
|
|
14021
|
+
if (gobj.priv.root !== null) gobj_change_state(gobj, "ST_READY");
|
|
14021
14022
|
render_view$1(gobj);
|
|
14022
14023
|
}
|
|
14023
14024
|
/***************************************************************
|
|
@@ -26815,57 +26816,57 @@ function build_ui$5(gobj) {
|
|
|
26815
26816
|
});
|
|
26816
26817
|
$view_toolbar.appendChild($search_box);
|
|
26817
26818
|
}
|
|
26818
|
-
if (
|
|
26819
|
-
let $
|
|
26819
|
+
if (with_schema_button) {
|
|
26820
|
+
let $schema = createElement2([
|
|
26820
26821
|
"button",
|
|
26821
26822
|
{
|
|
26822
|
-
class: "button mr-1",
|
|
26823
|
-
title: t("
|
|
26824
|
-
"data-i18n-title": "
|
|
26825
|
-
"aria-label": t("
|
|
26826
|
-
"data-i18n-aria-label": "
|
|
26823
|
+
class: "TREEDB_TABLE_SCHEMA button mr-1",
|
|
26824
|
+
title: t("schema"),
|
|
26825
|
+
"data-i18n-title": "schema",
|
|
26826
|
+
"aria-label": t("schema"),
|
|
26827
|
+
"data-i18n-aria-label": "schema"
|
|
26827
26828
|
},
|
|
26828
|
-
[yui_toolbar_icon("yi-
|
|
26829
|
+
[yui_toolbar_icon("yi-hexagon-nodes"), [
|
|
26829
26830
|
"span",
|
|
26830
26831
|
{
|
|
26831
26832
|
class: "is-hidden-mobile",
|
|
26832
|
-
i18n: "
|
|
26833
|
+
i18n: "schema",
|
|
26833
26834
|
style: "padding-left:5px;"
|
|
26834
26835
|
},
|
|
26835
|
-
"
|
|
26836
|
+
"schema"
|
|
26836
26837
|
]],
|
|
26837
26838
|
{ "click": (event) => {
|
|
26838
26839
|
event.stopPropagation();
|
|
26839
|
-
gobj_send_event(gobj, "
|
|
26840
|
+
gobj_send_event(gobj, "EV_SHOW_SCHEMA", {}, gobj);
|
|
26840
26841
|
} }
|
|
26841
26842
|
]);
|
|
26842
|
-
$view_toolbar.appendChild($
|
|
26843
|
+
$view_toolbar.appendChild($schema);
|
|
26843
26844
|
}
|
|
26844
|
-
if (
|
|
26845
|
-
let $
|
|
26845
|
+
if (with_refresh_button) {
|
|
26846
|
+
let $refresh = createElement2([
|
|
26846
26847
|
"button",
|
|
26847
26848
|
{
|
|
26848
|
-
class: "
|
|
26849
|
-
title: t("
|
|
26850
|
-
"data-i18n-title": "
|
|
26851
|
-
"aria-label": t("
|
|
26852
|
-
"data-i18n-aria-label": "
|
|
26849
|
+
class: "button mr-1",
|
|
26850
|
+
title: t("refresh"),
|
|
26851
|
+
"data-i18n-title": "refresh",
|
|
26852
|
+
"aria-label": t("refresh"),
|
|
26853
|
+
"data-i18n-aria-label": "refresh"
|
|
26853
26854
|
},
|
|
26854
|
-
[yui_toolbar_icon("yi-
|
|
26855
|
+
[yui_toolbar_icon("yi-arrows-rotate"), [
|
|
26855
26856
|
"span",
|
|
26856
26857
|
{
|
|
26857
26858
|
class: "is-hidden-mobile",
|
|
26858
|
-
i18n: "
|
|
26859
|
+
i18n: "refresh",
|
|
26859
26860
|
style: "padding-left:5px;"
|
|
26860
26861
|
},
|
|
26861
|
-
"
|
|
26862
|
+
"refresh"
|
|
26862
26863
|
]],
|
|
26863
26864
|
{ "click": (event) => {
|
|
26864
26865
|
event.stopPropagation();
|
|
26865
|
-
gobj_send_event(gobj, "
|
|
26866
|
+
gobj_send_event(gobj, "EV_REFRESH", {}, gobj);
|
|
26866
26867
|
} }
|
|
26867
26868
|
]);
|
|
26868
|
-
$view_toolbar.appendChild($
|
|
26869
|
+
$view_toolbar.appendChild($refresh);
|
|
26869
26870
|
}
|
|
26870
26871
|
if (with_columns_button) {
|
|
26871
26872
|
let $columns = createElement2([
|
package/package.json
CHANGED
package/src/c_yui_json.js
CHANGED
|
@@ -86,6 +86,7 @@ import {
|
|
|
86
86
|
refresh_language,
|
|
87
87
|
kw_get_local_storage_value,
|
|
88
88
|
kw_set_local_storage_value,
|
|
89
|
+
gobj_change_state,
|
|
89
90
|
} from "@yuneta/gobj-js";
|
|
90
91
|
|
|
91
92
|
import {
|
|
@@ -244,6 +245,14 @@ function mt_create(gobj)
|
|
|
244
245
|
***************************************************************/
|
|
245
246
|
function mt_start(gobj)
|
|
246
247
|
{
|
|
248
|
+
let priv = gobj.priv;
|
|
249
|
+
|
|
250
|
+
/* The FSM starts in ST_EMPTY, and a viewer handed `json_data` at
|
|
251
|
+
* create is not empty: left there it rendered the tree and then
|
|
252
|
+
* answered every expand/collapse with "Event NOT DEFINED in state". */
|
|
253
|
+
if(priv.root !== null) {
|
|
254
|
+
gobj_change_state(gobj, "ST_READY");
|
|
255
|
+
}
|
|
247
256
|
render_view(gobj);
|
|
248
257
|
}
|
|
249
258
|
|
|
@@ -795,23 +795,6 @@ function build_ui(gobj)
|
|
|
795
795
|
$view_toolbar.appendChild($search_box);
|
|
796
796
|
}
|
|
797
797
|
|
|
798
|
-
if(with_refresh_button) {
|
|
799
|
-
let $refresh = createElement2(
|
|
800
|
-
['button', {class: 'button mr-1',
|
|
801
|
-
title: t('refresh'), 'data-i18n-title': 'refresh',
|
|
802
|
-
'aria-label': t('refresh'), 'data-i18n-aria-label': 'refresh'}, [
|
|
803
|
-
yui_toolbar_icon('yi-arrows-rotate'),
|
|
804
|
-
['span', {class: 'is-hidden-mobile', i18n: 'refresh', style: 'padding-left:5px;'}, 'refresh']
|
|
805
|
-
], {
|
|
806
|
-
'click': (event) => {
|
|
807
|
-
event.stopPropagation();
|
|
808
|
-
gobj_send_event(gobj, "EV_REFRESH", {}, gobj);
|
|
809
|
-
}
|
|
810
|
-
}]
|
|
811
|
-
);
|
|
812
|
-
$view_toolbar.appendChild($refresh);
|
|
813
|
-
}
|
|
814
|
-
|
|
815
798
|
if(with_schema_button) {
|
|
816
799
|
/* What the columns of this topic ARE: types, flags, fkeys. The
|
|
817
800
|
* table shows the data; this shows the contract the data answers
|
|
@@ -833,6 +816,28 @@ function build_ui(gobj)
|
|
|
833
816
|
$view_toolbar.appendChild($schema);
|
|
834
817
|
}
|
|
835
818
|
|
|
819
|
+
/* The ORDER is a contract shared with every table toolbar of the
|
|
820
|
+
* ecosystem: what is particular to this view first (search, schema),
|
|
821
|
+
* then the common block ALWAYS as Refresh, Columns, Export, then Close
|
|
822
|
+
* when there is one. A button that moves from view to view has to be
|
|
823
|
+
* looked for every time. */
|
|
824
|
+
if(with_refresh_button) {
|
|
825
|
+
let $refresh = createElement2(
|
|
826
|
+
['button', {class: 'button mr-1',
|
|
827
|
+
title: t('refresh'), 'data-i18n-title': 'refresh',
|
|
828
|
+
'aria-label': t('refresh'), 'data-i18n-aria-label': 'refresh'}, [
|
|
829
|
+
yui_toolbar_icon('yi-arrows-rotate'),
|
|
830
|
+
['span', {class: 'is-hidden-mobile', i18n: 'refresh', style: 'padding-left:5px;'}, 'refresh']
|
|
831
|
+
], {
|
|
832
|
+
'click': (event) => {
|
|
833
|
+
event.stopPropagation();
|
|
834
|
+
gobj_send_event(gobj, "EV_REFRESH", {}, gobj);
|
|
835
|
+
}
|
|
836
|
+
}]
|
|
837
|
+
);
|
|
838
|
+
$view_toolbar.appendChild($refresh);
|
|
839
|
+
}
|
|
840
|
+
|
|
836
841
|
if(with_columns_button) {
|
|
837
842
|
/* A topic with a dozen columns is wider than the screen, and until
|
|
838
843
|
* now the reader could not decide WHICH of them to keep: the table
|
|
@@ -2567,9 +2572,6 @@ function open_schema_dialog(gobj)
|
|
|
2567
2572
|
priv.schema_modal = presented.modal;
|
|
2568
2573
|
priv.schema_win = presented.win;
|
|
2569
2574
|
|
|
2570
|
-
/* EV_SET_JSON and not the `json_data` attr: the attr renders the
|
|
2571
|
-
* tree but leaves the viewer in ST_IDLE, where a click to expand a
|
|
2572
|
-
* node is an event nobody handles. */
|
|
2573
2575
|
gobj_send_event(json_view, "EV_SET_JSON", {json: desc}, gobj);
|
|
2574
2576
|
}
|
|
2575
2577
|
|
|
@@ -2697,9 +2699,6 @@ function open_cell_json_dialog(gobj, row_id, col_id)
|
|
|
2697
2699
|
priv.cell_json_modal = presented.modal;
|
|
2698
2700
|
priv.cell_json_win = presented.win;
|
|
2699
2701
|
|
|
2700
|
-
/* EV_SET_JSON and not the `json_data` attr: the attr renders the
|
|
2701
|
-
* tree but leaves the viewer in ST_IDLE, where a click to expand a
|
|
2702
|
-
* node is an event nobody handles. */
|
|
2703
2702
|
gobj_send_event(json_view, "EV_SET_JSON", {json: value}, gobj);
|
|
2704
2703
|
}
|
|
2705
2704
|
|