@yuneta/gobj-ui 7.23.180 → 7.23.181
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 +1 -0
- package/dist/gobj-ui.es.js +1 -0
- package/package.json +1 -1
- package/src/c_yui_json.js +9 -0
- package/src/c_yui_treedb_topic_with_form.js +0 -6
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
|
/***************************************************************
|
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
|
/***************************************************************
|
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
|
|
|
@@ -2567,9 +2567,6 @@ function open_schema_dialog(gobj)
|
|
|
2567
2567
|
priv.schema_modal = presented.modal;
|
|
2568
2568
|
priv.schema_win = presented.win;
|
|
2569
2569
|
|
|
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
2570
|
gobj_send_event(json_view, "EV_SET_JSON", {json: desc}, gobj);
|
|
2574
2571
|
}
|
|
2575
2572
|
|
|
@@ -2697,9 +2694,6 @@ function open_cell_json_dialog(gobj, row_id, col_id)
|
|
|
2697
2694
|
priv.cell_json_modal = presented.modal;
|
|
2698
2695
|
priv.cell_json_win = presented.win;
|
|
2699
2696
|
|
|
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
2697
|
gobj_send_event(json_view, "EV_SET_JSON", {json: value}, gobj);
|
|
2704
2698
|
}
|
|
2705
2699
|
|