@smartbit4all/ng-client 7.3.0 → 7.3.1
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/HTML-WIDGET.md
CHANGED
|
@@ -461,6 +461,7 @@ megy le, és egy újra-feloldás már a leküldött erőforrások közül válas
|
|
|
461
461
|
```html
|
|
462
462
|
<div class="card" data-sb4-action="OPEN_ENTRY">…</div>
|
|
463
463
|
<li data-sb4-action="REMOVE_MEMBER" data-sb4-action-identifier="{{id}}">…</li>
|
|
464
|
+
<div data-sb4-action="OPEN_MEMBER" data-sb4-action-identifier="{{id}}" data-sb4-action-direct>…</div>
|
|
464
465
|
```
|
|
465
466
|
|
|
466
467
|
Bármely elem hordozhat triggert: a kattintás (vagy Enter / Space) azt az akciót futtatja, amelynek
|
|
@@ -487,6 +488,11 @@ függetlenül**. Hiányzó `data-sb4-action-identifier` = identifier nélküli a
|
|
|
487
488
|
állapot a lista változását a html újraírása nélkül követi.
|
|
488
489
|
- **Nem kínált akció** (a sor / nézet nem adja): az elem nem interaktív, `sb4-action-inert` osztályt
|
|
489
490
|
kap, a kliens egyszer warn-ol, a kattintás a körülötte lévő triggerre vagy a kártyára jut.
|
|
491
|
+
- **Direkt trigger** (`data-sb4-action-direct`): akkor is lő, ha a lista nem kínálja az akciót —
|
|
492
|
+
ilyenkor a kliens maga rakja össze a `{ code, identifier }` akciót az attribútumokból. Ha a lista
|
|
493
|
+
kínál egyező akciót, az nyer (letiltás, descriptor a listából jön). Nem inert és nem warn-ol.
|
|
494
|
+
Mivel a kínált-akció lista már nem kapuzza, **a szerver handlere maga ellenőrizze a
|
|
495
|
+
jogosultságot**. Java: `Tag.directAction(code)` / `Tag.directAction(code, identifier)`.
|
|
490
496
|
- Paraméter-attribútum nincs: az identifier és a sor-scope (`params.model` = a sor) fedi az
|
|
491
497
|
eseteket.
|
|
492
498
|
|
|
@@ -10448,7 +10448,8 @@ const NATIVE = 'button, a[href], input, select, textarea';
|
|
|
10448
10448
|
/**
|
|
10449
10449
|
* The action triggers of a container: any element carrying `data-sb4-action` (and optionally
|
|
10450
10450
|
* `data-sb4-action-identifier`) fires the action of that address from the nearest action list,
|
|
10451
|
-
* whichever toolbar it is addressed to
|
|
10451
|
+
* whichever toolbar it is addressed to; with `data-sb4-action-direct` it fires the bare address
|
|
10452
|
+
* when the list does not offer it. One delegated listener per event on the container, so it
|
|
10452
10453
|
* survives the html being rewritten; the action is looked up when the click happens.
|
|
10453
10454
|
*/
|
|
10454
10455
|
function attachActionTriggers(container, execution, warn) {
|
|
@@ -10461,6 +10462,12 @@ function attachActionTriggers(container, execution, warn) {
|
|
|
10461
10462
|
const hits = (execution.entries() ?? []).filter(
|
|
10462
10463
|
// using equality is a must here, undefined and null should be equal
|
|
10463
10464
|
(entry) => entry.uiAction.code === code && entry.uiAction.identifier == identifier);
|
|
10465
|
+
// A direct trigger addresses an action the list does not gate (e.g. one per list item that
|
|
10466
|
+
// the page does not offer one by one), so the server handler checks the permission itself.
|
|
10467
|
+
// An offered entry still wins, so that its disabled state and descriptor apply.
|
|
10468
|
+
if (!hits.length && element.hasAttribute('data-sb4-action-direct')) {
|
|
10469
|
+
return { uiAction: { code: code, identifier } };
|
|
10470
|
+
}
|
|
10464
10471
|
if (hits.length !== 1 && !warned.has(element)) {
|
|
10465
10472
|
warned.add(element);
|
|
10466
10473
|
const address = `'${code}'${identifier ? ` (identifier '${identifier}')` : ''}`;
|