@yuneta/gobj-ui 7.26.42 → 7.26.44
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 +227 -36
- package/dist/gobj-ui.cjs.js +770 -192
- package/dist/gobj-ui.es.js +770 -192
- package/package.json +2 -2
- package/scripts/validate-locales.mjs +355 -63
- package/src/c_yui_form.js +268 -155
- package/src/c_yui_node.js +51 -7
- package/src/c_yui_schema_editor.js +49 -3
- package/src/c_yui_shell.css +4 -1
- package/src/c_yui_shell.js +28 -2
- package/src/c_yui_window.js +373 -62
- package/src/c_yui_window_manager.js +74 -2
- package/src/escape_taken.js +58 -0
- package/src/form_close_asks_for_edits.wiring.test.js +6 -3
- package/src/form_json_editor_names.js +3 -1
- package/src/form_json_editor_names.wiring.test.js +8 -4
- package/src/form_json_expand.wiring.test.js +6 -3
- package/src/form_json_field.wiring.test.js +8 -4
- package/src/form_label_i18n.wiring.test.js +10 -5
- package/src/form_table_edits_ask.wiring.test.js +18 -8
- package/src/form_table_rearm.wiring.test.js +13 -5
- package/src/form_table_rows.wiring.test.js +533 -0
- package/src/form_table_validator.wiring.test.js +8 -4
- package/src/form_template_field.wiring.test.js +6 -3
- package/src/g6_long_press_clock.test.js +8 -3
- package/src/i18n_key_functions.js +63 -25
- package/src/i18n_key_functions.test.js +230 -8
- package/src/modal_guard_back.wiring.test.js +53 -0
- package/src/named_controls.wiring.test.js +53 -13
- package/src/node_nav_events.wiring.test.js +93 -1
- package/src/schema_editor_diagram_click.wiring.test.js +277 -0
- package/src/shell_dialog_names.wiring.test.js +149 -0
- package/src/shell_escape_taken.wiring.test.js +142 -0
- package/src/shell_focus_trap.js +30 -2
- package/src/shell_focus_trap.test.js +90 -6
- package/src/shell_modals.js +90 -19
- package/src/table_editor_name.wiring.test.js +10 -5
- package/src/treedb_column_title.wiring.test.js +8 -4
- package/src/treedb_graph_writes.wiring.test.js +6 -3
- package/src/treedb_json_drill.wiring.test.js +6 -3
- package/src/uplot_add_serie.test.js +6 -3
- package/src/uplot_ink.test.js +8 -4
- package/src/window_dialog.wiring.test.js +486 -0
- package/src/window_dock_band.wiring.test.js +189 -0
- package/src/window_rect_rounding.wiring.test.js +121 -0
- package/src/yui_tabulator_i18n.js +31 -1
- package/src/yui_tabulator_i18n.test.js +46 -0
package/src/shell_focus_trap.js
CHANGED
|
@@ -16,6 +16,14 @@
|
|
|
16
16
|
* - restores focus to whatever element had it before
|
|
17
17
|
* activation when release() runs.
|
|
18
18
|
*
|
|
19
|
+
* Only a control that is DRAWN counts: focus() on one that is
|
|
20
|
+
* not (display:none) does nothing. The adaptive dialog's back
|
|
21
|
+
* arrow is the first control of every dialog and is hidden on a
|
|
22
|
+
* laptop: up to 7.26.42 the trap gave it the focus on activation
|
|
23
|
+
* (so the focus stayed outside the dialog), and every Tab after
|
|
24
|
+
* that wrapped to it, did nothing and was prevented -- the
|
|
25
|
+
* keyboard never got into the dialog.
|
|
26
|
+
*
|
|
19
27
|
* Pure module — no gobj / Yuneta dependencies. The optional
|
|
20
28
|
* second argument lets callers inject a mock document object
|
|
21
29
|
* for unit tests.
|
|
@@ -43,6 +51,26 @@ export const FOCUSABLE_SELECTOR =
|
|
|
43
51
|
const __trap_stack__ = [];
|
|
44
52
|
|
|
45
53
|
|
|
54
|
+
/* Whether `el` is drawn, so focus() on it can take. An element that
|
|
55
|
+
* cannot say (a stub with no getClientRects) is taken as drawn. */
|
|
56
|
+
function is_drawn(el)
|
|
57
|
+
{
|
|
58
|
+
if(typeof el.checkVisibility === "function") {
|
|
59
|
+
return el.checkVisibility();
|
|
60
|
+
}
|
|
61
|
+
if(typeof el.getClientRects === "function") {
|
|
62
|
+
return el.getClientRects().length > 0;
|
|
63
|
+
}
|
|
64
|
+
return true;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/* The controls of $panel that can take the focus, in order. */
|
|
68
|
+
function focusables_of($panel)
|
|
69
|
+
{
|
|
70
|
+
return Array.from($panel.querySelectorAll(FOCUSABLE_SELECTOR)).filter(is_drawn);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
|
|
46
74
|
/***************************************************************
|
|
47
75
|
* Activate the focus-trap on $panel.
|
|
48
76
|
*
|
|
@@ -75,7 +103,7 @@ export function activate_focus_trap_on($panel, doc)
|
|
|
75
103
|
if(__trap_stack__[__trap_stack__.length - 1] !== trap) {
|
|
76
104
|
return;
|
|
77
105
|
}
|
|
78
|
-
let nodes = $panel
|
|
106
|
+
let nodes = focusables_of($panel);
|
|
79
107
|
if(nodes.length === 0) {
|
|
80
108
|
return;
|
|
81
109
|
}
|
|
@@ -99,7 +127,7 @@ export function activate_focus_trap_on($panel, doc)
|
|
|
99
127
|
__trap_stack__.push(trap);
|
|
100
128
|
|
|
101
129
|
/* Move focus to the first focusable child of the panel. */
|
|
102
|
-
let firstFocusable = $panel
|
|
130
|
+
let firstFocusable = focusables_of($panel)[0];
|
|
103
131
|
if(firstFocusable && typeof firstFocusable.focus === "function") {
|
|
104
132
|
firstFocusable.focus();
|
|
105
133
|
}
|
|
@@ -46,7 +46,9 @@ function make_doc(initial_active, body_contains = true)
|
|
|
46
46
|
let listeners = [];
|
|
47
47
|
return {
|
|
48
48
|
activeElement: initial_active,
|
|
49
|
-
addEventListener(_t, fn, _opts) {
|
|
49
|
+
addEventListener(_t, fn, _opts) {
|
|
50
|
+
listeners.push(fn);
|
|
51
|
+
},
|
|
50
52
|
removeEventListener(_t, fn, _opts) {
|
|
51
53
|
let i = listeners.indexOf(fn);
|
|
52
54
|
if(i >= 0) {
|
|
@@ -105,7 +107,9 @@ test("Tab from the last focusable wraps to the first", () => {
|
|
|
105
107
|
let ev = {
|
|
106
108
|
key: "Tab",
|
|
107
109
|
shiftKey: false,
|
|
108
|
-
preventDefault() {
|
|
110
|
+
preventDefault() {
|
|
111
|
+
prevented = true;
|
|
112
|
+
}
|
|
109
113
|
};
|
|
110
114
|
doc.listeners[0](ev);
|
|
111
115
|
|
|
@@ -129,7 +133,9 @@ test("Shift+Tab from the first focusable wraps to the last", () => {
|
|
|
129
133
|
let ev = {
|
|
130
134
|
key: "Tab",
|
|
131
135
|
shiftKey: true,
|
|
132
|
-
preventDefault() {
|
|
136
|
+
preventDefault() {
|
|
137
|
+
prevented = true;
|
|
138
|
+
}
|
|
133
139
|
};
|
|
134
140
|
doc.listeners[0](ev);
|
|
135
141
|
|
|
@@ -149,7 +155,9 @@ test("non-Tab keys are ignored by the trap", () => {
|
|
|
149
155
|
let ev = {
|
|
150
156
|
key: "Escape",
|
|
151
157
|
shiftKey: false,
|
|
152
|
-
preventDefault() {
|
|
158
|
+
preventDefault() {
|
|
159
|
+
prevented = true;
|
|
160
|
+
}
|
|
153
161
|
};
|
|
154
162
|
doc.listeners[0](ev);
|
|
155
163
|
|
|
@@ -173,7 +181,9 @@ test("focus jumps into the panel when activeElement is outside", () => {
|
|
|
173
181
|
let ev = {
|
|
174
182
|
key: "Tab",
|
|
175
183
|
shiftKey: false,
|
|
176
|
-
preventDefault() {
|
|
184
|
+
preventDefault() {
|
|
185
|
+
prevented = true;
|
|
186
|
+
}
|
|
177
187
|
};
|
|
178
188
|
doc.listeners[0](ev);
|
|
179
189
|
|
|
@@ -291,9 +301,83 @@ test("an empty panel installs the listener but does nothing on Tab", () => {
|
|
|
291
301
|
let ev = {
|
|
292
302
|
key: "Tab",
|
|
293
303
|
shiftKey: false,
|
|
294
|
-
preventDefault() {
|
|
304
|
+
preventDefault() {
|
|
305
|
+
prevented = true;
|
|
306
|
+
}
|
|
295
307
|
};
|
|
296
308
|
doc.listeners[0](ev);
|
|
297
309
|
/* No focusables → trap stays out of the way. */
|
|
298
310
|
expect(prevented).toBe(false);
|
|
299
311
|
});
|
|
312
|
+
|
|
313
|
+
|
|
314
|
+
/***************************************************************
|
|
315
|
+
* A control that is not DRAWN cannot take the focus: focus() on
|
|
316
|
+
* it does nothing. The adaptive dialog's back arrow is the first
|
|
317
|
+
* control of every dialog and is display:none on a laptop (its
|
|
318
|
+
* ✕ is, on a phone): the trap gave it the focus on activation,
|
|
319
|
+
* so the focus stayed outside the dialog; and every Tab after
|
|
320
|
+
* that "wrapped" to it, did nothing and was prevented, so the
|
|
321
|
+
* keyboard never got into the dialog at all.
|
|
322
|
+
***************************************************************/
|
|
323
|
+
function drawn(name)
|
|
324
|
+
{
|
|
325
|
+
return make_focusable(name, {getClientRects: () => [{width: 10, height: 10}]});
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
function not_drawn(name)
|
|
329
|
+
{
|
|
330
|
+
return make_focusable(name, {getClientRects: () => []});
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
test("activation gives the focus to the first DRAWN control", () => {
|
|
334
|
+
let back = not_drawn("back");
|
|
335
|
+
let close = drawn("close");
|
|
336
|
+
let panel = make_panel([back, close]);
|
|
337
|
+
let doc = make_doc(null);
|
|
338
|
+
|
|
339
|
+
let release = activate_focus_trap_on(panel, doc);
|
|
340
|
+
|
|
341
|
+
expect(back.focus_calls).toEqual([]);
|
|
342
|
+
expect(close.focus_calls).toEqual(["close.focus"]);
|
|
343
|
+
release();
|
|
344
|
+
});
|
|
345
|
+
|
|
346
|
+
test("Tab and Shift+Tab wrap to the first and last DRAWN controls", () => {
|
|
347
|
+
let back = not_drawn("back");
|
|
348
|
+
let a = drawn("a");
|
|
349
|
+
let b = drawn("b");
|
|
350
|
+
let x = not_drawn("x");
|
|
351
|
+
let panel = make_panel([back, a, b, x]);
|
|
352
|
+
let doc = make_doc(null);
|
|
353
|
+
|
|
354
|
+
let release = activate_focus_trap_on(panel, doc);
|
|
355
|
+
a.focus_calls.length = 0;
|
|
356
|
+
|
|
357
|
+
doc.activeElement = b;
|
|
358
|
+
let prevented = false;
|
|
359
|
+
doc.listeners[0]({
|
|
360
|
+
key: "Tab",
|
|
361
|
+
shiftKey: false,
|
|
362
|
+
preventDefault() {
|
|
363
|
+
prevented = true;
|
|
364
|
+
}
|
|
365
|
+
});
|
|
366
|
+
expect(prevented).toBe(true);
|
|
367
|
+
expect(a.focus_calls).toEqual(["a.focus"]);
|
|
368
|
+
expect(back.focus_calls).toEqual([]);
|
|
369
|
+
|
|
370
|
+
doc.activeElement = a;
|
|
371
|
+
prevented = false;
|
|
372
|
+
doc.listeners[0]({
|
|
373
|
+
key: "Tab",
|
|
374
|
+
shiftKey: true,
|
|
375
|
+
preventDefault() {
|
|
376
|
+
prevented = true;
|
|
377
|
+
}
|
|
378
|
+
});
|
|
379
|
+
expect(prevented).toBe(true);
|
|
380
|
+
expect(b.focus_calls).toEqual(["b.focus"]);
|
|
381
|
+
expect(x.focus_calls).toEqual([]);
|
|
382
|
+
release();
|
|
383
|
+
});
|
package/src/shell_modals.js
CHANGED
|
@@ -71,6 +71,25 @@ function modal_layer(shell)
|
|
|
71
71
|
return priv && priv.layers && priv.layers.modal;
|
|
72
72
|
}
|
|
73
73
|
|
|
74
|
+
/* What each shell has opened in its modal layer, modals and questions
|
|
75
|
+
* alike: a `before_close` that settles with undefined having opened
|
|
76
|
+
* nothing left the reader with a modal that does not close, and only
|
|
77
|
+
* this tells it from a question answered "no" (guarded_close). */
|
|
78
|
+
const __opened_by_shell__ = new WeakMap();
|
|
79
|
+
|
|
80
|
+
function note_opened(shell)
|
|
81
|
+
{
|
|
82
|
+
__opened_by_shell__.set(shell, opened_count(shell) + 1);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
function opened_count(shell)
|
|
86
|
+
{
|
|
87
|
+
return __opened_by_shell__.get(shell) || 0;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/* Unique ids for the nodes a dialog is named and described by. */
|
|
91
|
+
let __dialog_seq__ = 0;
|
|
92
|
+
|
|
74
93
|
/* Public: where a component should mount its own popup/dialog DOM
|
|
75
94
|
* (e.g. the treedb edit dialog). The popup layer (z 20) sits below
|
|
76
95
|
* the modal layer (z 99), so shell confirms always paint above the
|
|
@@ -248,8 +267,10 @@ export function yui_shell_show_modal(shell, content, opts)
|
|
|
248
267
|
return { close: () => {} };
|
|
249
268
|
}
|
|
250
269
|
|
|
270
|
+
let label_id = `yui-modal-${++__dialog_seq__}`;
|
|
251
271
|
let inner = (typeof content === "string")
|
|
252
|
-
? ["div", {class: "box"}, [["p", {
|
|
272
|
+
? ["div", {class: "box"}, [["p", {class: "MODAL_MESSAGE", id: `${label_id}-msg`,
|
|
273
|
+
i18n: content}, content]]]
|
|
253
274
|
: null;
|
|
254
275
|
|
|
255
276
|
/* Adaptive DIALOG mode (`opts.dialog: true`): the standardized
|
|
@@ -270,6 +291,29 @@ export function yui_shell_show_modal(shell, content, opts)
|
|
|
270
291
|
* nodes and would eat the spaces around it. */
|
|
271
292
|
let title_prefix = (opts && opts.title_prefix) || "";
|
|
272
293
|
|
|
294
|
+
/* The halves of the title NAME the dialog (aria-labelledby), in
|
|
295
|
+
* the dialog's header -- or, with no dialog chrome, in a title
|
|
296
|
+
* only a reader sees: a reader joins them with a space, and the
|
|
297
|
+
* kind half changes language. With no title, a plain message
|
|
298
|
+
* names it; with nothing, it has no name, and that is said. */
|
|
299
|
+
let title_halves = (title_prefix
|
|
300
|
+
? [["span", {class: "MODAL_TITLE_PREFIX", id: `${label_id}-prefix`},
|
|
301
|
+
text_node(title_prefix)]]
|
|
302
|
+
: []).concat(title
|
|
303
|
+
? [["span", {class: "MODAL_TITLE_KIND", id: `${label_id}-kind`, i18n: title},
|
|
304
|
+
text_node(title)]]
|
|
305
|
+
: []);
|
|
306
|
+
let label_ids = [];
|
|
307
|
+
if(title_prefix) {
|
|
308
|
+
label_ids.push(`${label_id}-prefix`);
|
|
309
|
+
}
|
|
310
|
+
if(title) {
|
|
311
|
+
label_ids.push(`${label_id}-kind`);
|
|
312
|
+
}
|
|
313
|
+
if(label_ids.length === 0 && inner) {
|
|
314
|
+
label_ids.push(`${label_id}-msg`);
|
|
315
|
+
}
|
|
316
|
+
|
|
273
317
|
/* The external Bulma `.modal-close is-large` sits at the
|
|
274
318
|
* top-right of the viewport, outside the content box. Callers
|
|
275
319
|
* whose content provides its own in-box close (e.g. a
|
|
@@ -282,11 +326,7 @@ export function yui_shell_show_modal(shell, content, opts)
|
|
|
282
326
|
["button", {class: "MODAL_BACK yui-dialog-back", type: "button", title: t("back"), "data-i18n-title": "back",
|
|
283
327
|
"aria-label": t("back"), "data-i18n-aria-label": "back"},
|
|
284
328
|
[["i", {class: "yi-arrow-left"}]]],
|
|
285
|
-
["span", {class: "MODAL_TITLE yui-dialog-title"},
|
|
286
|
-
(title_prefix ? [["span", {class: "MODAL_TITLE_PREFIX"}, text_node(title_prefix)]] : [])
|
|
287
|
-
.concat(title
|
|
288
|
-
? [["span", {class: "MODAL_TITLE_KIND", i18n: title}, text_node(title)]]
|
|
289
|
-
: [])],
|
|
329
|
+
["span", {class: "MODAL_TITLE yui-dialog-title"}, title_halves],
|
|
290
330
|
["button", {class: "MODAL_CLOSE yui-dialog-x", type: "button", title: t("close"), "data-i18n-title": "close",
|
|
291
331
|
"aria-label": t("close"), "data-i18n-aria-label": "close"},
|
|
292
332
|
[["i", {class: "yi-xmark"}]]],
|
|
@@ -305,6 +345,9 @@ export function yui_shell_show_modal(shell, content, opts)
|
|
|
305
345
|
inner ? [inner] : []
|
|
306
346
|
]
|
|
307
347
|
];
|
|
348
|
+
if(title_halves.length > 0) {
|
|
349
|
+
modal_children.unshift(["span", {class: "MODAL_TITLE is-sr-only"}, title_halves]);
|
|
350
|
+
}
|
|
308
351
|
if(with_close) {
|
|
309
352
|
modal_children.push(
|
|
310
353
|
["button", {class: "MODAL_CLOSE modal-close is-large",
|
|
@@ -327,15 +370,21 @@ export function yui_shell_show_modal(shell, content, opts)
|
|
|
327
370
|
* sheet already, and the media query below still wins. */
|
|
328
371
|
let wide = !!(opts && opts.wide);
|
|
329
372
|
|
|
330
|
-
let
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
373
|
+
let modal_attrs = {class: "MODAL" + (logical ? " " + logical : "") +
|
|
374
|
+
" modal yui-modal" + (dialog ? " yui-dialog" : "") +
|
|
375
|
+
(dialog && wide ? " yui-dialog-wide" : "") + " is-active",
|
|
376
|
+
role: "dialog", "aria-modal": "true"};
|
|
377
|
+
if(label_ids.length > 0) {
|
|
378
|
+
modal_attrs["aria-labelledby"] = label_ids.join(" ");
|
|
379
|
+
} else {
|
|
380
|
+
log_warning(
|
|
381
|
+
`yui_shell_show_modal: a dialog with no title and no message has no name for a reader` +
|
|
382
|
+
(logical ? ` (${logical})` : "") + `: give it opts.title`
|
|
383
|
+
);
|
|
384
|
+
}
|
|
385
|
+
let $modal = createElement2(["div", modal_attrs, modal_children]);
|
|
338
386
|
$layer.appendChild($modal);
|
|
387
|
+
note_opened(shell);
|
|
339
388
|
|
|
340
389
|
if(!inner && content && typeof content.appendChild !== "undefined") {
|
|
341
390
|
let $content = dialog
|
|
@@ -404,12 +453,18 @@ export function yui_shell_show_modal(shell, content, opts)
|
|
|
404
453
|
* `false`, a rejection (said) -- is the veto, and a Back that asked
|
|
405
454
|
* gets its entry back then. Up to 7.26.41 any promise was a veto,
|
|
406
455
|
* so an `async () => true` left a modal nobody could close. A
|
|
407
|
-
* `true` that comes after the modal closed closes nothing twice.
|
|
456
|
+
* `true` that comes after the modal closed closes nothing twice.
|
|
457
|
+
*
|
|
458
|
+
* An undefined from a guard that opened nothing -- an `async`
|
|
459
|
+
* guard ending in `return;`, which closes when written without
|
|
460
|
+
* `async` -- is the veto too, but nothing on the screen says so:
|
|
461
|
+
* it is said in the log. From a guard that asked, it is its "no". */
|
|
408
462
|
let guarded_close = function(on_veto) {
|
|
409
463
|
if(closed) {
|
|
410
464
|
return;
|
|
411
465
|
}
|
|
412
466
|
let allow = true;
|
|
467
|
+
let opened_before = opened_count(shell);
|
|
413
468
|
if(opts && typeof opts.before_close === "function") {
|
|
414
469
|
try {
|
|
415
470
|
allow = opts.before_close();
|
|
@@ -429,6 +484,10 @@ export function yui_shell_show_modal(shell, content, opts)
|
|
|
429
484
|
do_close();
|
|
430
485
|
return;
|
|
431
486
|
}
|
|
487
|
+
if(answer === undefined && !closed && opened_count(shell) === opened_before) {
|
|
488
|
+
log_warning("yui_shell_show_modal: before_close settled with undefined and " +
|
|
489
|
+
"asked nothing: the modal stays open (only true closes it)");
|
|
490
|
+
}
|
|
432
491
|
vetoed();
|
|
433
492
|
}, function(e) {
|
|
434
493
|
log_warning(`yui_shell_show_modal: before_close rejected: ${e}`);
|
|
@@ -563,16 +622,18 @@ function build_dialog(shell, message, buttons, opts)
|
|
|
563
622
|
[["i", {class: icon, "aria-hidden": "true"}]]
|
|
564
623
|
]
|
|
565
624
|
];
|
|
625
|
+
let label_id = `yui-confirm-${++__dialog_seq__}`;
|
|
566
626
|
if(!empty_string(title)) {
|
|
567
627
|
$card_children.push(
|
|
568
628
|
["p", {class: "CONFIRM_TITLE yui-confirm-title has-text-centered",
|
|
569
|
-
i18n: title}, text_node(title)]
|
|
629
|
+
id: `${label_id}-title`, i18n: title}, text_node(title)]
|
|
570
630
|
);
|
|
571
631
|
}
|
|
572
632
|
$card_children.push(
|
|
573
633
|
["button", {class: "CONFIRM_CLOSE delete yui-confirm-x", title: t("close"), "data-i18n-title": "close",
|
|
574
634
|
"aria-label": t("close"), "data-i18n-aria-label": "close"}],
|
|
575
|
-
["section", {class: "CONFIRM_BODY modal-card-body has-text-centered"
|
|
635
|
+
["section", {class: "CONFIRM_BODY modal-card-body has-text-centered",
|
|
636
|
+
id: `${label_id}-body`},
|
|
576
637
|
$body_children],
|
|
577
638
|
["footer", {class: "CONFIRM_FOOT modal-card-foot"}, $footer_children]
|
|
578
639
|
);
|
|
@@ -581,9 +642,18 @@ function build_dialog(shell, message, buttons, opts)
|
|
|
581
642
|
* yui_shell_show_modal's `logical_class`. */
|
|
582
643
|
let logical = (opts && opts.logical_class) ? " " + opts.logical_class : "";
|
|
583
644
|
|
|
645
|
+
/* Named by its title and described by its message -- or, with no
|
|
646
|
+
* title, named by the message, which is then the whole of it. */
|
|
647
|
+
let confirm_attrs = {class: `CONFIRM${logical} modal yui-modal yui-confirm is-active is-${type}`,
|
|
648
|
+
role: "dialog", "aria-modal": "true"};
|
|
649
|
+
if(!empty_string(title)) {
|
|
650
|
+
confirm_attrs["aria-labelledby"] = `${label_id}-title`;
|
|
651
|
+
confirm_attrs["aria-describedby"] = `${label_id}-body`;
|
|
652
|
+
} else {
|
|
653
|
+
confirm_attrs["aria-labelledby"] = `${label_id}-body`;
|
|
654
|
+
}
|
|
584
655
|
let $modal = createElement2(
|
|
585
|
-
["div",
|
|
586
|
-
role: "dialog", "aria-modal": "true"},
|
|
656
|
+
["div", confirm_attrs,
|
|
587
657
|
[
|
|
588
658
|
["div", {class: "CONFIRM_BACKDROP modal-background"}],
|
|
589
659
|
["div", {class: "CONFIRM_CARD modal-card"}, $card_children]
|
|
@@ -591,6 +661,7 @@ function build_dialog(shell, message, buttons, opts)
|
|
|
591
661
|
]
|
|
592
662
|
);
|
|
593
663
|
$layer.appendChild($modal);
|
|
664
|
+
note_opened(shell);
|
|
594
665
|
maybe_apply_translator($modal, opts);
|
|
595
666
|
|
|
596
667
|
return new Promise(resolve => {
|
|
@@ -23,9 +23,12 @@ install_dom_double();
|
|
|
23
23
|
|
|
24
24
|
if(typeof globalThis.ResizeObserver === "undefined") {
|
|
25
25
|
globalThis.ResizeObserver = class {
|
|
26
|
-
observe() {
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
observe() {
|
|
27
|
+
}
|
|
28
|
+
unobserve() {
|
|
29
|
+
}
|
|
30
|
+
disconnect() {
|
|
31
|
+
}
|
|
29
32
|
};
|
|
30
33
|
}
|
|
31
34
|
|
|
@@ -70,8 +73,10 @@ vi.mock("vanilla-jsoneditor", () => ({
|
|
|
70
73
|
get() {
|
|
71
74
|
return {text: ""};
|
|
72
75
|
},
|
|
73
|
-
set() {
|
|
74
|
-
|
|
76
|
+
set() {
|
|
77
|
+
},
|
|
78
|
+
destroy() {
|
|
79
|
+
},
|
|
75
80
|
}),
|
|
76
81
|
}));
|
|
77
82
|
|
|
@@ -30,9 +30,12 @@ install_dom_double();
|
|
|
30
30
|
|
|
31
31
|
if(typeof globalThis.ResizeObserver === "undefined") {
|
|
32
32
|
globalThis.ResizeObserver = class {
|
|
33
|
-
observe() {
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
observe() {
|
|
34
|
+
}
|
|
35
|
+
unobserve() {
|
|
36
|
+
}
|
|
37
|
+
disconnect() {
|
|
38
|
+
}
|
|
36
39
|
};
|
|
37
40
|
}
|
|
38
41
|
|
|
@@ -59,7 +62,8 @@ vi.mock("tabulator-tables", () => {
|
|
|
59
62
|
off(ev) {
|
|
60
63
|
delete this.externalEvents.events[ev];
|
|
61
64
|
}
|
|
62
|
-
destroy() {
|
|
65
|
+
destroy() {
|
|
66
|
+
}
|
|
63
67
|
}
|
|
64
68
|
return {TabulatorFull: FakeTabulator, Tabulator: FakeTabulator};
|
|
65
69
|
});
|
|
@@ -26,9 +26,12 @@ install_dom_double();
|
|
|
26
26
|
* layout to watch. */
|
|
27
27
|
if(!globalThis.ResizeObserver) {
|
|
28
28
|
globalThis.ResizeObserver = class {
|
|
29
|
-
observe() {
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
observe() {
|
|
30
|
+
}
|
|
31
|
+
unobserve() {
|
|
32
|
+
}
|
|
33
|
+
disconnect() {
|
|
34
|
+
}
|
|
32
35
|
};
|
|
33
36
|
}
|
|
34
37
|
|
package/src/uplot_ink.test.js
CHANGED