@yuneta/gobj-ui 7.26.27 → 7.26.28

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.
Files changed (44) hide show
  1. package/README.md +458 -22
  2. package/dist/gobj-ui.cjs.js +1063 -216
  3. package/dist/gobj-ui.es.js +1064 -217
  4. package/package.json +1 -1
  5. package/scripts/validate-locales.mjs +2269 -316
  6. package/src/c_g6_nodes_tree.js +1086 -253
  7. package/src/c_yui_form.js +11 -1
  8. package/src/c_yui_fsm_graph.js +5 -0
  9. package/src/c_yui_gclass.js +11 -0
  10. package/src/c_yui_gobj_tree_js.js +17 -0
  11. package/src/c_yui_json_graph.js +5 -0
  12. package/src/c_yui_nav.js +9 -6
  13. package/src/c_yui_pager.js +1 -1
  14. package/src/c_yui_period.js +11 -4
  15. package/src/c_yui_schema_editor.js +19 -7
  16. package/src/c_yui_shell.js +7 -7
  17. package/src/c_yui_treedb_graph.js +15 -6
  18. package/src/c_yui_treedb_schema.js +5 -0
  19. package/src/c_yui_treedb_topic_with_form.js +10 -10
  20. package/src/c_yui_treedb_topics.js +6 -6
  21. package/src/c_yui_window.js +2 -2
  22. package/src/c_yui_wizard.js +8 -1
  23. package/src/form_json_field.js +7 -0
  24. package/src/g6_canvas_tab_order.js +84 -0
  25. package/src/g6_canvas_tab_order.wiring.test.js +232 -0
  26. package/src/g6_nodes_tree_controls.test.js +547 -0
  27. package/src/g6_nodes_tree_focus.wiring.test.js +1360 -0
  28. package/src/g6_nodes_tree_i18n_keys.test.js +241 -5
  29. package/src/i18n_key_functions.js +146 -0
  30. package/src/i18n_key_functions.test.js +1204 -0
  31. package/src/lib_graph.js +38 -1
  32. package/src/nav_backbar_name.wiring.test.js +82 -0
  33. package/src/schema_flags.js +47 -0
  34. package/src/schema_import.js +7 -0
  35. package/src/shell_modals.js +20 -16
  36. package/src/shell_route_map.js +12 -2
  37. package/src/wizard_helpers.js +8 -0
  38. package/src/yui_dev.js +16 -3
  39. package/src/yui_dev_controls.test.js +174 -0
  40. package/src/yui_gclass_view.js +2 -2
  41. package/src/yui_graph_camera.js +1 -1
  42. package/src/yui_install.js +10 -8
  43. package/src/yui_table_select.js +2 -2
  44. package/src/yui_time.js +18 -3
package/src/yui_time.js CHANGED
@@ -90,6 +90,21 @@ const YUI_ROLLING = {
90
90
  "30d": {id: "30d", secs: 30 * 24 * 3600, label: "last 30 days"}
91
91
  };
92
92
 
93
+ /* The keys that reach t() as data, where no scan of the source reads
94
+ * them: the id of every granularity of YUI_PERIODS (period_name), the
95
+ * label of every window of YUI_ROLLING (C_YUI_PERIOD), and the bucket
96
+ * labels period_label() picks by variable. Published for a consumer's
97
+ * validate-locales, which asks the app's locales for every key of an
98
+ * exported `*_I18N_KEYS` array -- the whole catalog, because which of
99
+ * it a period control offers is the HOST's data. A period or a window
100
+ * added to the catalog adds its key here (a test checks it). */
101
+ export const YUI_TIME_I18N_KEYS = [
102
+ "minute", "5min", "15min", "hour", "day", "week", "fortnight",
103
+ "month", "bimester", "quarter", "semester", "year", "decade",
104
+ "last hour", "last 6h", "last 24h", "last 7 days", "last 30 days",
105
+ "quarter {{n}} {{y}}", "semester {{n}} {{y}}"
106
+ ];
107
+
93
108
 
94
109
  /***************************
95
110
  * Locale / i18n
@@ -529,9 +544,9 @@ function period_name(period, t)
529
544
  {
530
545
  let spec = period_spec(period);
531
546
  if(!spec) {
532
- return tr(t, String((period && period.id) || period || ""));
547
+ return tr(t, /* i18n: data */ String((period && period.id) || period || ""));
533
548
  }
534
- return tr(t, spec.id);
549
+ return tr(t, /* i18n: YUI_TIME_I18N_KEYS */ spec.id);
535
550
  }
536
551
 
537
552
  /***************************************************************
@@ -610,7 +625,7 @@ function period_label(period, anchor_ms, t, locale)
610
625
 
611
626
  if(spec.unit === "month" && (spec.count === 3 || spec.count === 6)) {
612
627
  let n = Math.floor(start.getMonth() / spec.count) + 1;
613
- let key = (spec.count === 3) ? "quarter {{n}} {{y}}" : "semester {{n}} {{y}}";
628
+ const key = (spec.count === 3) ? "quarter {{n}} {{y}}" : "semester {{n}} {{y}}";
614
629
  return tr(t, key, {n: n, y: start.getFullYear()});
615
630
  }
616
631