@yuneta/gobj-ui 7.23.188 → 7.23.190

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.
@@ -24751,10 +24751,9 @@ function open_json_viewer$1(gobj, opts) {
24751
24751
  }
24752
24752
  let mobile = is_mobile$2();
24753
24753
  let shell = yui_shell_of(gobj);
24754
- let jv = (0, _yuneta_gobj_js.gobj_create_service)(`treedb-topics-json-${(0, _yuneta_gobj_js.clean_name)((0, _yuneta_gobj_js.gobj_name)(gobj))}`, "C_YUI_JSON", {
24755
- subscriber: gobj,
24756
- json_data: schema ? (0, _yuneta_gobj_js.gobj_read_attr)(gobj, "descs") : null
24757
- }, gobj);
24754
+ let jv_kw = { subscriber: gobj };
24755
+ if (schema) jv_kw.json_data = (0, _yuneta_gobj_js.gobj_read_attr)(gobj, "descs");
24756
+ let jv = (0, _yuneta_gobj_js.gobj_create_service)(`treedb-topics-json-${(0, _yuneta_gobj_js.clean_name)((0, _yuneta_gobj_js.gobj_name)(gobj))}`, "C_YUI_JSON", jv_kw, gobj);
24758
24757
  if (!jv) {
24759
24758
  (0, _yuneta_gobj_js.log_error)(`${(0, _yuneta_gobj_js.gobj_short_name)(gobj)}: cannot create the JSON viewer`);
24760
24759
  return;
@@ -26441,6 +26440,7 @@ var attrs_table$5 = [
26441
26440
  (0, _yuneta_gobj_js.SDATA)(_yuneta_gobj_js.data_type_t.DTP_INTEGER, "page_size", 0, 0, "Rows per page. 0 leaves the `tabulator_settings` value alone. With with_remote_paging it is also the size of each fetch (200 when unset)"),
26442
26441
  (0, _yuneta_gobj_js.SDATA)(_yuneta_gobj_js.data_type_t.DTP_BOOLEAN, "with_in_row_edit_icons", 0, true, "Add a last column with internal EDIT/DELETE icon"),
26443
26442
  (0, _yuneta_gobj_js.SDATA)(_yuneta_gobj_js.data_type_t.DTP_BOOLEAN, "editable", 0, false, "Edit state"),
26443
+ (0, _yuneta_gobj_js.SDATA)(_yuneta_gobj_js.data_type_t.DTP_INTEGER, "max_col_width", 0, 420, "Ceiling, in px, for a data column. The table lays out `fitDataFill`, which sizes a column to its DATA: one `description` holding a paragraph took the whole viewport and left every other column off screen. 0 removes the ceiling; a reader still widens any column by hand (columns are resizable)"),
26444
26444
  (0, _yuneta_gobj_js.SDATA)(_yuneta_gobj_js.data_type_t.DTP_BOOLEAN, "with_checkbox", 0, true, "Auxiliary first column to select rows"),
26445
26445
  (0, _yuneta_gobj_js.SDATA)(_yuneta_gobj_js.data_type_t.DTP_BOOLEAN, "with_radio", 0, false, "Auxiliary first column to select one row"),
26446
26446
  (0, _yuneta_gobj_js.SDATA)(_yuneta_gobj_js.data_type_t.DTP_BOOLEAN, "with_selection_bar", 0, false, "Show the shared selection bar (\"N selected\" + a way out) above the table while in edition mode. OFF by default: the bar takes its words from the HOST's i18n, and a host that has not defined \"{{n}} selected\" and \"clear selection\" would render the keys"),
@@ -27333,6 +27333,7 @@ function create_tabulator(gobj) {
27333
27333
  }
27334
27334
  if (colDef.headerFilter && colDef.headerFilter !== "tickCross") colDef.minWidth = 150;
27335
27335
  }
27336
+ let max_col_width = (0, _yuneta_gobj_js.gobj_read_integer_attr)(gobj, "max_col_width");
27336
27337
  for (let i = 0; i < desc.cols.length; i++) {
27337
27338
  let col = desc.cols[i];
27338
27339
  if (!col.id || col.id[0] === "_") continue;
@@ -27435,6 +27436,7 @@ function create_tabulator(gobj) {
27435
27436
  hozAlign,
27436
27437
  formatter: colFormatter
27437
27438
  };
27439
+ if (max_col_width > 0) colDef.maxWidth = max_col_width;
27438
27440
  if (with_header_filters) apply_header_filter(colDef, field_desc);
27439
27441
  if (with_inline_edit) inline_editor_for(colDef, col, field_desc);
27440
27442
  if (vertAlign) colDef.vertAlign = vertAlign;
@@ -24746,10 +24746,9 @@ function open_json_viewer$1(gobj, opts) {
24746
24746
  }
24747
24747
  let mobile = is_mobile$2();
24748
24748
  let shell = yui_shell_of(gobj);
24749
- let jv = gobj_create_service(`treedb-topics-json-${clean_name(gobj_name(gobj))}`, "C_YUI_JSON", {
24750
- subscriber: gobj,
24751
- json_data: schema ? gobj_read_attr(gobj, "descs") : null
24752
- }, gobj);
24749
+ let jv_kw = { subscriber: gobj };
24750
+ if (schema) jv_kw.json_data = gobj_read_attr(gobj, "descs");
24751
+ let jv = gobj_create_service(`treedb-topics-json-${clean_name(gobj_name(gobj))}`, "C_YUI_JSON", jv_kw, gobj);
24753
24752
  if (!jv) {
24754
24753
  log_error(`${gobj_short_name(gobj)}: cannot create the JSON viewer`);
24755
24754
  return;
@@ -26436,6 +26435,7 @@ var attrs_table$5 = [
26436
26435
  SDATA(data_type_t.DTP_INTEGER, "page_size", 0, 0, "Rows per page. 0 leaves the `tabulator_settings` value alone. With with_remote_paging it is also the size of each fetch (200 when unset)"),
26437
26436
  SDATA(data_type_t.DTP_BOOLEAN, "with_in_row_edit_icons", 0, true, "Add a last column with internal EDIT/DELETE icon"),
26438
26437
  SDATA(data_type_t.DTP_BOOLEAN, "editable", 0, false, "Edit state"),
26438
+ SDATA(data_type_t.DTP_INTEGER, "max_col_width", 0, 420, "Ceiling, in px, for a data column. The table lays out `fitDataFill`, which sizes a column to its DATA: one `description` holding a paragraph took the whole viewport and left every other column off screen. 0 removes the ceiling; a reader still widens any column by hand (columns are resizable)"),
26439
26439
  SDATA(data_type_t.DTP_BOOLEAN, "with_checkbox", 0, true, "Auxiliary first column to select rows"),
26440
26440
  SDATA(data_type_t.DTP_BOOLEAN, "with_radio", 0, false, "Auxiliary first column to select one row"),
26441
26441
  SDATA(data_type_t.DTP_BOOLEAN, "with_selection_bar", 0, false, "Show the shared selection bar (\"N selected\" + a way out) above the table while in edition mode. OFF by default: the bar takes its words from the HOST's i18n, and a host that has not defined \"{{n}} selected\" and \"clear selection\" would render the keys"),
@@ -27328,6 +27328,7 @@ function create_tabulator(gobj) {
27328
27328
  }
27329
27329
  if (colDef.headerFilter && colDef.headerFilter !== "tickCross") colDef.minWidth = 150;
27330
27330
  }
27331
+ let max_col_width = gobj_read_integer_attr(gobj, "max_col_width");
27331
27332
  for (let i = 0; i < desc.cols.length; i++) {
27332
27333
  let col = desc.cols[i];
27333
27334
  if (!col.id || col.id[0] === "_") continue;
@@ -27430,6 +27431,7 @@ function create_tabulator(gobj) {
27430
27431
  hozAlign,
27431
27432
  formatter: colFormatter
27432
27433
  };
27434
+ if (max_col_width > 0) colDef.maxWidth = max_col_width;
27433
27435
  if (with_header_filters) apply_header_filter(colDef, field_desc);
27434
27436
  if (with_inline_edit) inline_editor_for(colDef, col, field_desc);
27435
27437
  if (vertAlign) colDef.vertAlign = vertAlign;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yuneta/gobj-ui",
3
- "version": "7.23.188",
3
+ "version": "7.23.190",
4
4
  "type": "module",
5
5
  "main": "dist/gobj-ui.cjs.js",
6
6
  "module": "dist/gobj-ui.es.js",
@@ -210,6 +210,7 @@ SDATA(data_type_t.DTP_BOOLEAN, "with_in_row_edit_icons", 0, true, "Add a
210
210
  SDATA(data_type_t.DTP_BOOLEAN, "editable", 0, false, "Edit state"),
211
211
 
212
212
  /*---------------- Selection Mode ----------------*/
213
+ SDATA(data_type_t.DTP_INTEGER, "max_col_width", 0, 420, "Ceiling, in px, for a data column. The table lays out `fitDataFill`, which sizes a column to its DATA: one `description` holding a paragraph took the whole viewport and left every other column off screen. 0 removes the ceiling; a reader still widens any column by hand (columns are resizable)"),
213
214
  SDATA(data_type_t.DTP_BOOLEAN, "with_checkbox", 0, true, "Auxiliary first column to select rows"),
214
215
  SDATA(data_type_t.DTP_BOOLEAN, "with_radio", 0, false, "Auxiliary first column to select one row"),
215
216
  SDATA(data_type_t.DTP_BOOLEAN, "with_selection_bar", 0, false, "Show the shared selection bar (\"N selected\" + a way out) above the table while in edition mode. OFF by default: the bar takes its words from the HOST's i18n, and a host that has not defined \"{{n}} selected\" and \"clear selection\" would render the keys"),
@@ -1341,6 +1342,8 @@ function create_tabulator(gobj)
1341
1342
  }
1342
1343
  }
1343
1344
 
1345
+ let max_col_width = gobj_read_integer_attr(gobj, "max_col_width");
1346
+
1344
1347
  for (let i = 0; i < desc.cols.length; i++) {
1345
1348
  let col = desc.cols[i];
1346
1349
  if(!col.id || col.id[0]==='_') {
@@ -1472,6 +1475,16 @@ function create_tabulator(gobj)
1472
1475
  hozAlign: hozAlign,
1473
1476
  formatter: colFormatter,
1474
1477
  };
1478
+ /* A ceiling, because `fitDataFill` sizes a column to its DATA and
1479
+ * a text column has no natural width: one `description` holding a
1480
+ * paragraph -- the agent's `configurations` is full of them --
1481
+ * came out wider than the viewport and pushed every other column,
1482
+ * the id included, off the screen. The cell keeps its whole text;
1483
+ * what the ceiling costs is having to widen the column, or open
1484
+ * the record, to read the end of it. */
1485
+ if(max_col_width > 0) {
1486
+ colDef.maxWidth = max_col_width;
1487
+ }
1475
1488
  if(with_header_filters) {
1476
1489
  apply_header_filter(colDef, field_desc);
1477
1490
  }
@@ -1718,19 +1718,29 @@ function open_json_viewer(gobj, opts)
1718
1718
  let mobile = is_mobile();
1719
1719
  let shell = yui_shell_of(gobj);
1720
1720
 
1721
+ /* No `title`: the host titles it — the window's title bar on
1722
+ * desktop, the dialog's header on mobile. The viewer's own title
1723
+ * would land INSIDE that host, doubling it. */
1724
+ let jv_kw = {
1725
+ subscriber: gobj /* publishes EV_EXPAND_PATH to us */
1726
+ };
1727
+ if(schema) {
1728
+ /* The schema is here already and it is small: it goes in whole,
1729
+ * and no drill-down happens because nothing is collapsed.
1730
+ *
1731
+ * Written as `json_data: schema? descs : null` it cost two
1732
+ * errors on EVERY raw-json open: a `DTP_JSON` attr takes a dict
1733
+ * or a list, and gobj-js REFUSES a null with "attr must be a
1734
+ * json dict/list" -- and then json2data() fails and the create
1735
+ * carries on with the attr unset. An attr you have nothing to
1736
+ * say about is one you do not mention. */
1737
+ jv_kw.json_data = gobj_read_attr(gobj, "descs");
1738
+ }
1739
+
1721
1740
  let jv = gobj_create_service(
1722
1741
  `treedb-topics-json-${clean_name(gobj_name(gobj))}`,
1723
1742
  "C_YUI_JSON",
1724
- {
1725
- /* No `title`: the host titles it — the window's title bar on
1726
- * desktop, the dialog's header on mobile. The viewer's own
1727
- * title would land INSIDE that host, doubling it. */
1728
- subscriber: gobj, /* publishes EV_EXPAND_PATH to us */
1729
- /* The schema is here already and it is small: it goes in
1730
- * whole, and no drill-down happens because nothing is
1731
- * collapsed. */
1732
- json_data: schema? gobj_read_attr(gobj, "descs") : null
1733
- },
1743
+ jv_kw,
1734
1744
  gobj
1735
1745
  );
1736
1746
  if(!jv) {