@yuneta/gobj-ui 2.0.0 → 2.2.3

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 (58) hide show
  1. package/README.md +25 -20
  2. package/dist/gobj-ui.cjs.js +2340 -528
  3. package/dist/gobj-ui.es.js +2340 -530
  4. package/index.js +32 -31
  5. package/package.json +6 -7
  6. package/{c_g6_nodes_tree.js → src/c_g6_nodes_tree.js} +6 -1
  7. package/{c_yui_form.js → src/c_yui_form.js} +1 -1
  8. package/{c_yui_gobj_tree_js.js → src/c_yui_gobj_tree_js.js} +1 -1
  9. package/{c_yui_json_graph.js → src/c_yui_json_graph.js} +1 -1
  10. package/{c_yui_main.js → src/c_yui_main.js} +3 -3
  11. package/{c_yui_map.js → src/c_yui_map.js} +6 -1
  12. package/{c_yui_nav.js → src/c_yui_nav.js} +134 -26
  13. package/{c_yui_pager.js → src/c_yui_pager.js} +1 -1
  14. package/{c_yui_routing.css → src/c_yui_routing.css} +1 -1
  15. package/{c_yui_routing.js → src/c_yui_routing.js} +1 -1
  16. package/{c_yui_shell.css → src/c_yui_shell.css} +110 -0
  17. package/{c_yui_shell.js → src/c_yui_shell.js} +175 -13
  18. package/{c_yui_tabs.js → src/c_yui_tabs.js} +1 -1
  19. package/{c_yui_treedb_graph.js → src/c_yui_treedb_graph.js} +35 -9
  20. package/{c_yui_treedb_topic_with_form.js → src/c_yui_treedb_topic_with_form.js} +1 -1
  21. package/{c_yui_treedb_topics.js → src/c_yui_treedb_topics.js} +36 -8
  22. package/{c_yui_uplot.js → src/c_yui_uplot.js} +1 -1
  23. package/{c_yui_window.js → src/c_yui_window.js} +242 -21
  24. package/src/c_yui_window_manager.js +602 -0
  25. package/{c_yui_wizard.js → src/c_yui_wizard.js} +1 -1
  26. package/{shell_modals.js → src/shell_modals.js} +53 -13
  27. package/src/tabulator.css +53 -0
  28. package/src/yui_dev.js +1484 -0
  29. package/{yui_icons.css → src/yui_icons.css} +5 -0
  30. package/src/yui_inputs.css +32 -0
  31. package/src/yui_inputs.js +71 -0
  32. package/vite.config.js +0 -131
  33. package/yui_dev.js +0 -583
  34. /package/{c_yui_main.css → src/c_yui_main.css} +0 -0
  35. /package/{c_yui_map.css → src/c_yui_map.css} +0 -0
  36. /package/{c_yui_treedb_topic_with_form.css → src/c_yui_treedb_topic_with_form.css} +0 -0
  37. /package/{g6_drag_canvas_touch.js → src/g6_drag_canvas_touch.js} +0 -0
  38. /package/{lib_graph.css → src/lib_graph.css} +0 -0
  39. /package/{lib_graph.js → src/lib_graph.js} +0 -0
  40. /package/{lib_icons.js → src/lib_icons.js} +0 -0
  41. /package/{lib_maplibre.js → src/lib_maplibre.js} +0 -0
  42. /package/{pager_helpers.js → src/pager_helpers.js} +0 -0
  43. /package/{pager_helpers.test.js → src/pager_helpers.test.js} +0 -0
  44. /package/{route_resolver.js → src/route_resolver.js} +0 -0
  45. /package/{route_resolver.test.js → src/route_resolver.test.js} +0 -0
  46. /package/{shell_focus_trap.js → src/shell_focus_trap.js} +0 -0
  47. /package/{shell_focus_trap.test.js → src/shell_focus_trap.test.js} +0 -0
  48. /package/{shell_show_on.js → src/shell_show_on.js} +0 -0
  49. /package/{shell_show_on.test.js → src/shell_show_on.test.js} +0 -0
  50. /package/{shell_toolbar_helpers.js → src/shell_toolbar_helpers.js} +0 -0
  51. /package/{shell_toolbar_helpers.test.js → src/shell_toolbar_helpers.test.js} +0 -0
  52. /package/{themes.js → src/themes.js} +0 -0
  53. /package/{wizard_helpers.js → src/wizard_helpers.js} +0 -0
  54. /package/{wizard_helpers.test.js → src/wizard_helpers.test.js} +0 -0
  55. /package/{ytable.css → src/ytable.css} +0 -0
  56. /package/{ytable.js → src/ytable.js} +0 -0
  57. /package/{yui_toolbar.css → src/yui_toolbar.css} +0 -0
  58. /package/{yui_toolbar.js → src/yui_toolbar.js} +0 -0
@@ -176,27 +176,55 @@ export function yui_shell_show_modal(shell, content, opts)
176
176
  ? ["div", {class: "box"}, [["p", {i18n: content}, content]]]
177
177
  : null;
178
178
 
179
+ /* Adaptive DIALOG mode (`opts.dialog: true`): the standardized
180
+ * "single window / popup" chrome — a centered card with the close X
181
+ * at the top-right on desktop, and a full-screen sheet with a back
182
+ * arrow at the top-left on mobile. A header bar carries `opts.title`
183
+ * and BOTH dismiss controls; CSS shows the right one per breakpoint.
184
+ * Both call close() — the app's on_close decides navigation (usually
185
+ * history.back()), so gobj-ui stays routing-agnostic. */
186
+ let dialog = !!(opts && opts.dialog);
187
+ let title = (opts && opts.title) || "";
188
+
179
189
  /* The external Bulma `.modal-close is-large` sits at the
180
190
  * top-right of the viewport, outside the content box. Callers
181
191
  * whose content provides its own in-box close (e.g. a
182
192
  * C_YUI_PAGER header) pass `with_close_button: false` to omit
183
193
  * it; Escape and the backdrop still close the modal. */
184
194
  let with_close = !(opts && opts.with_close_button === false);
185
- let modal_children = [
186
- ["div", {class: "modal-background"}],
187
- ["div", {class: "modal-content"},
188
- inner ? [inner] : []
189
- ]
190
- ];
191
- if(with_close) {
192
- modal_children.push(
193
- ["button", {class: "modal-close is-large",
194
- "aria-label": "close"}]
195
- );
195
+ let modal_children;
196
+ if(dialog) {
197
+ let header = ["div", {class: "yui-dialog-header"}, [
198
+ ["button", {class: "yui-dialog-back", type: "button", "aria-label": "back"},
199
+ [["i", {class: "yi-arrow-left"}]]],
200
+ ["span", {class: "yui-dialog-title", i18n: title}, title],
201
+ ["button", {class: "yui-dialog-x", type: "button", "aria-label": "close"},
202
+ [["i", {class: "yi-xmark"}]]],
203
+ ]];
204
+ let body = ["div", {class: "yui-dialog-body"}, inner ? [inner] : []];
205
+ modal_children = [
206
+ ["div", {class: "modal-background"}],
207
+ ["div", {class: "modal-content yui-dialog-content"}, [header, body]]
208
+ ];
209
+ /* The header X replaces the external Bulma close button. */
210
+ with_close = false;
211
+ } else {
212
+ modal_children = [
213
+ ["div", {class: "modal-background"}],
214
+ ["div", {class: "modal-content"},
215
+ inner ? [inner] : []
216
+ ]
217
+ ];
218
+ if(with_close) {
219
+ modal_children.push(
220
+ ["button", {class: "modal-close is-large",
221
+ "aria-label": "close"}]
222
+ );
223
+ }
196
224
  }
197
225
 
198
226
  let $modal = createElement2(
199
- ["div", {class: "modal yui-modal is-active",
227
+ ["div", {class: "modal yui-modal" + (dialog ? " yui-dialog" : "") + " is-active",
200
228
  role: "dialog", "aria-modal": "true"},
201
229
  modal_children
202
230
  ]
@@ -204,7 +232,9 @@ export function yui_shell_show_modal(shell, content, opts)
204
232
  $layer.appendChild($modal);
205
233
 
206
234
  if(!inner && content && typeof content.appendChild !== "undefined") {
207
- let $content = $modal.querySelector(".modal-content");
235
+ let $content = dialog
236
+ ? $modal.querySelector(".yui-dialog-body")
237
+ : $modal.querySelector(".modal-content");
208
238
  $content.appendChild(content);
209
239
  }
210
240
 
@@ -255,6 +285,16 @@ export function yui_shell_show_modal(shell, content, opts)
255
285
  if($close_btn) {
256
286
  $close_btn.addEventListener("click", close);
257
287
  }
288
+ if(dialog) {
289
+ let $back = $modal.querySelector(".yui-dialog-back");
290
+ if($back) {
291
+ $back.addEventListener("click", close);
292
+ }
293
+ let $x = $modal.querySelector(".yui-dialog-x");
294
+ if($x) {
295
+ $x.addEventListener("click", close);
296
+ }
297
+ }
258
298
 
259
299
  return { close };
260
300
  }
@@ -0,0 +1,53 @@
1
+ /***********************************************************************
2
+ * tabulator.css
3
+ *
4
+ * Cross-app Tabulator theme fixes and reusable helpers.
5
+ *
6
+ * Tabulator is a first-class element across the yunos, so its
7
+ * styling belongs to the library — not duplicated per app.
8
+ * Import this once (after `tabulator.min.css` +
9
+ * `tabulator_bulma.css`) so every consumer gets the same
10
+ * theme-aware behaviour.
11
+ *
12
+ * Copyright (c) 2026, ArtGins.
13
+ * All Rights Reserved.
14
+ ***********************************************************************/
15
+
16
+ /* ====================================================================
17
+ * Active / selected row highlight.
18
+ * Green wash + left accent, theme-aware, with enough specificity
19
+ * (three classes) to beat the striped-row !important backgrounds.
20
+ * Add `yui-row-active` to a `.tabulator-row` element to mark it.
21
+ * ==================================================================== */
22
+ .tabulator-row.yui-row-active,
23
+ .tabulator-row.yui-row-active.tabulator-row-odd,
24
+ .tabulator-row.yui-row-active.tabulator-row-even {
25
+ background-color: #E8F6EE !important;
26
+ box-shadow: inset 4px 0 0 #2BB673;
27
+ }
28
+
29
+ [data-theme=dark] .tabulator-row.yui-row-active,
30
+ [data-theme=dark] .tabulator-row.yui-row-active.tabulator-row-odd,
31
+ [data-theme=dark] .tabulator-row.yui-row-active.tabulator-row-even {
32
+ background-color: rgba(43, 182, 115, 0.22) !important;
33
+ box-shadow: inset 4px 0 0 #2BB673;
34
+ }
35
+
36
+ /* ====================================================================
37
+ * Tree expand/collapse control (the +/- box) in dark theme.
38
+ * Tabulator hardcodes the box border and the +/- strokes to #333 on
39
+ * a near-black wash — a dark glyph in a dark box on a dark background,
40
+ * effectively invisible. Repaint border, wash and strokes light.
41
+ * ==================================================================== */
42
+ [data-theme=dark] .tabulator-data-tree-control {
43
+ background: rgba(255, 255, 255, 0.14) !important;
44
+ border-color: rgba(255, 255, 255, 0.85) !important;
45
+ }
46
+ [data-theme=dark] .tabulator-data-tree-control:hover {
47
+ background: rgba(255, 255, 255, 0.28) !important;
48
+ }
49
+ [data-theme=dark] .tabulator-data-tree-control .tabulator-data-tree-control-expand,
50
+ [data-theme=dark] .tabulator-data-tree-control .tabulator-data-tree-control-expand:after,
51
+ [data-theme=dark] .tabulator-data-tree-control .tabulator-data-tree-control-collapse:after {
52
+ background: #ffffff !important;
53
+ }