@yuneta/gobj-ui 5.14.0 → 5.14.2

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.
@@ -14333,7 +14333,7 @@ function yui_shell_show_route_map(shell, opts) {
14333
14333
  if (typeof m.close === "function") m.close();
14334
14334
  return null;
14335
14335
  }
14336
- if ((0, _yuneta_gobj_js.gclass_find_by_name)("C_YUI_WINDOW") !== null) {
14336
+ if ((0, _yuneta_gobj_js.gclass_find_by_name)("C_YUI_WINDOW")) {
14337
14337
  let win_ref = { gobj: null };
14338
14338
  let $body = build_body(shell, t);
14339
14339
  let $parent = yui_shell_popup_layer(shell) || typeof document !== "undefined" && document.getElementById("top-layer") || null;
@@ -14911,7 +14911,7 @@ function build_schema_child(gobj) {
14911
14911
  let priv = gobj.priv;
14912
14912
  if (priv.schema_gobj) return;
14913
14913
  if (!(0, _yuneta_gobj_js.is_object)((0, _yuneta_gobj_js.gobj_read_attr)(gobj, "descs"))) return;
14914
- if ((0, _yuneta_gobj_js.gclass_find_by_name)("C_YUI_TREEDB_SCHEMA") === null) {
14914
+ if (!(0, _yuneta_gobj_js.gclass_find_by_name)("C_YUI_TREEDB_SCHEMA")) {
14915
14915
  (0, _yuneta_gobj_js.log_error)(`${(0, _yuneta_gobj_js.gobj_short_name)(gobj)}: C_YUI_TREEDB_SCHEMA not registered by the app`);
14916
14916
  return;
14917
14917
  }
@@ -15374,7 +15374,7 @@ function open_json_viewer$1(gobj) {
15374
15374
  request_print_tranger$1(gobj, "");
15375
15375
  return;
15376
15376
  }
15377
- if ((0, _yuneta_gobj_js.gclass_find_by_name)("C_YUI_JSON") === null) {
15377
+ if (!(0, _yuneta_gobj_js.gclass_find_by_name)("C_YUI_JSON")) {
15378
15378
  (0, _yuneta_gobj_js.log_error)(`${(0, _yuneta_gobj_js.gobj_short_name)(gobj)}: C_YUI_JSON not registered by the app`);
15379
15379
  yui_shell_show_error(yui_shell_of(gobj), "raw json viewer unavailable", { t: i18next.t });
15380
15380
  return;
@@ -16688,6 +16688,10 @@ function create_tabulator(gobj) {
16688
16688
  case "real":
16689
16689
  hozAlign = "right";
16690
16690
  sorter = "number";
16691
+ break;
16692
+ case "rowid":
16693
+ hozAlign = "right";
16694
+ sorter = "number";
16691
16695
  }
16692
16696
  let colDef = {
16693
16697
  title: col_label(col, (0, _yuneta_gobj_js.gobj_read_str_attr)(gobj, "topic_name")),
@@ -16841,7 +16845,8 @@ function transform__treedb_value_2_table_value(gobj, col, value, row, field) {
16841
16845
  case "string":
16842
16846
  case "email":
16843
16847
  case "tel":
16844
- case "url": break;
16848
+ case "url":
16849
+ case "rowid": break;
16845
16850
  case "integer": break;
16846
16851
  case "real": break;
16847
16852
  case "boolean": break;
@@ -18554,7 +18559,7 @@ function is_mobile() {
18554
18559
  function open_json_viewer(gobj) {
18555
18560
  let priv = gobj.priv;
18556
18561
  if (priv.json_win || priv.json_modal) return;
18557
- if ((0, _yuneta_gobj_js.gclass_find_by_name)("C_YUI_JSON") === null) {
18562
+ if (!(0, _yuneta_gobj_js.gclass_find_by_name)("C_YUI_JSON")) {
18558
18563
  (0, _yuneta_gobj_js.log_error)(`${(0, _yuneta_gobj_js.gobj_short_name)(gobj)}: C_YUI_JSON not registered by the app`);
18559
18564
  yui_shell_show_error(yui_shell_of(gobj), "raw json viewer unavailable", { t: i18next.t });
18560
18565
  return;
@@ -14328,7 +14328,7 @@ function yui_shell_show_route_map(shell, opts) {
14328
14328
  if (typeof m.close === "function") m.close();
14329
14329
  return null;
14330
14330
  }
14331
- if (gclass_find_by_name("C_YUI_WINDOW") !== null) {
14331
+ if (gclass_find_by_name("C_YUI_WINDOW")) {
14332
14332
  let win_ref = { gobj: null };
14333
14333
  let $body = build_body(shell, t);
14334
14334
  let $parent = yui_shell_popup_layer(shell) || typeof document !== "undefined" && document.getElementById("top-layer") || null;
@@ -14906,7 +14906,7 @@ function build_schema_child(gobj) {
14906
14906
  let priv = gobj.priv;
14907
14907
  if (priv.schema_gobj) return;
14908
14908
  if (!is_object(gobj_read_attr(gobj, "descs"))) return;
14909
- if (gclass_find_by_name("C_YUI_TREEDB_SCHEMA") === null) {
14909
+ if (!gclass_find_by_name("C_YUI_TREEDB_SCHEMA")) {
14910
14910
  log_error(`${gobj_short_name(gobj)}: C_YUI_TREEDB_SCHEMA not registered by the app`);
14911
14911
  return;
14912
14912
  }
@@ -15369,7 +15369,7 @@ function open_json_viewer$1(gobj) {
15369
15369
  request_print_tranger$1(gobj, "");
15370
15370
  return;
15371
15371
  }
15372
- if (gclass_find_by_name("C_YUI_JSON") === null) {
15372
+ if (!gclass_find_by_name("C_YUI_JSON")) {
15373
15373
  log_error(`${gobj_short_name(gobj)}: C_YUI_JSON not registered by the app`);
15374
15374
  yui_shell_show_error(yui_shell_of(gobj), "raw json viewer unavailable", { t });
15375
15375
  return;
@@ -16683,6 +16683,10 @@ function create_tabulator(gobj) {
16683
16683
  case "real":
16684
16684
  hozAlign = "right";
16685
16685
  sorter = "number";
16686
+ break;
16687
+ case "rowid":
16688
+ hozAlign = "right";
16689
+ sorter = "number";
16686
16690
  }
16687
16691
  let colDef = {
16688
16692
  title: col_label(col, gobj_read_str_attr(gobj, "topic_name")),
@@ -16836,7 +16840,8 @@ function transform__treedb_value_2_table_value(gobj, col, value, row, field) {
16836
16840
  case "string":
16837
16841
  case "email":
16838
16842
  case "tel":
16839
- case "url": break;
16843
+ case "url":
16844
+ case "rowid": break;
16840
16845
  case "integer": break;
16841
16846
  case "real": break;
16842
16847
  case "boolean": break;
@@ -18541,7 +18546,7 @@ function is_mobile() {
18541
18546
  function open_json_viewer(gobj) {
18542
18547
  let priv = gobj.priv;
18543
18548
  if (priv.json_win || priv.json_modal) return;
18544
- if (gclass_find_by_name("C_YUI_JSON") === null) {
18549
+ if (!gclass_find_by_name("C_YUI_JSON")) {
18545
18550
  log_error(`${gobj_short_name(gobj)}: C_YUI_JSON not registered by the app`);
18546
18551
  yui_shell_show_error(yui_shell_of(gobj), "raw json viewer unavailable", { t });
18547
18552
  return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yuneta/gobj-ui",
3
- "version": "5.14.0",
3
+ "version": "5.14.2",
4
4
  "type": "module",
5
5
  "main": "dist/gobj-ui.cjs.js",
6
6
  "module": "dist/gobj-ui.es.js",
@@ -572,7 +572,7 @@ function open_json_viewer(gobj)
572
572
  if(priv.json_win || priv.json_modal) {
573
573
  return; /* already open */
574
574
  }
575
- if(gclass_find_by_name("C_YUI_JSON") === null) {
575
+ if(!gclass_find_by_name("C_YUI_JSON")) {
576
576
  log_error(`${gobj_short_name(gobj)}: C_YUI_JSON not registered by the app`);
577
577
  yui_shell_show_error(yui_shell_of(gobj), "raw json viewer unavailable", {t: t});
578
578
  return;
@@ -842,6 +842,12 @@ function create_tabulator(gobj)
842
842
  hozAlign = "right";
843
843
  sorter = "number";
844
844
  break;
845
+ /* A rowid is a NUMBER stored as a string key: sorted as text,
846
+ * "9" lands after "69". Read like the integer it is. */
847
+ case "rowid":
848
+ hozAlign = "right";
849
+ sorter = "number";
850
+ break;
845
851
  }
846
852
 
847
853
  let colDef = {
@@ -1068,6 +1074,7 @@ function transform__treedb_value_2_table_value(gobj, col, value, row, field)
1068
1074
  case "email": // string subtype — plain text in the cell
1069
1075
  case "tel": // string subtype — plain text in the cell
1070
1076
  case "url": // string subtype — plain text in the cell
1077
+ case "rowid": // the record's own key — shown as it comes
1071
1078
  break;
1072
1079
  case "integer":
1073
1080
  break;
@@ -714,7 +714,7 @@ function build_schema_child(gobj)
714
714
  if(!is_object(gobj_read_attr(gobj, "descs"))) {
715
715
  return;
716
716
  }
717
- if(gclass_find_by_name("C_YUI_TREEDB_SCHEMA") === null) {
717
+ if(!gclass_find_by_name("C_YUI_TREEDB_SCHEMA")) {
718
718
  log_error(`${gobj_short_name(gobj)}: C_YUI_TREEDB_SCHEMA not registered by the app`);
719
719
  return;
720
720
  }
@@ -1442,7 +1442,7 @@ function open_json_viewer(gobj)
1442
1442
  return;
1443
1443
  }
1444
1444
 
1445
- if(gclass_find_by_name("C_YUI_JSON") === null) {
1445
+ if(!gclass_find_by_name("C_YUI_JSON")) {
1446
1446
  log_error(`${gobj_short_name(gobj)}: C_YUI_JSON not registered by the app`);
1447
1447
  yui_shell_show_error(yui_shell_of(gobj), "raw json viewer unavailable", {t: t});
1448
1448
  return;
@@ -453,8 +453,13 @@ export function yui_shell_show_route_map(shell, opts)
453
453
  return null;
454
454
  }
455
455
 
456
- /* Preferred: a resizable, maximisable floating window. */
457
- if(gclass_find_by_name("C_YUI_WINDOW") !== null) {
456
+ /* Preferred: a resizable, maximisable floating window.
457
+ *
458
+ * Truthiness, never `!== null`: a lookup that does not find its name
459
+ * used to answer `undefined`, so `!== null` was TRUE for a gclass that
460
+ * is NOT registered and this branch built a window out of nothing.
461
+ * gobj-js >= 7.12.0 returns null, and this reads right either way. */
462
+ if(gclass_find_by_name("C_YUI_WINDOW")) {
458
463
  let win_ref = {gobj: null};
459
464
  /* A workspace surface, not a thing floating over one view: it
460
465
  * joins the dock when the app HAS one (minimise, restore, focus