@mostajs/crud-ui 0.2.0 → 0.2.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/CHANGELOG.md +6 -0
- package/package.json +1 -1
- package/src/html/panel.js +4 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,12 @@
|
|
|
3
3
|
Format [Keep a Changelog](https://keepachangelog.com/fr/1.0.0/) · [SemVer](https://semver.org/lang/fr/).
|
|
4
4
|
Auteur : Dr Hamid MADANI <drmdh@msn.com>
|
|
5
5
|
|
|
6
|
+
## [0.2.1] — 2026-10-09
|
|
7
|
+
|
|
8
|
+
### Fixed
|
|
9
|
+
- `detailLink` n'accepte qu'un chemin du site (`/`, `?`, `#`) ou une adresse http(s) : `javascript:` et `data:` deviennent `#`
|
|
10
|
+
(audit du 09/10/2026). Essai T-STY-5.
|
|
11
|
+
|
|
6
12
|
## [0.2.0] — 2026-10-08
|
|
7
13
|
|
|
8
14
|
### Added
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mostajs/crud-ui",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "Panneau CRUD générique (rendu HTML-string, zéro dépendance) : spec déclaratif + lignes → formulaire de création + table (lien détail + actions POST). Compose @mostajs/app-shell-ui. Membre de mosta-ui-html-stack.",
|
|
5
5
|
"license": "AGPL-3.0-or-later",
|
|
6
6
|
"author": "Dr Hamid MADANI <drmdh@msn.com>",
|
package/src/html/panel.js
CHANGED
|
@@ -27,7 +27,11 @@ export const CU_CSS = `.cu-panel{--cu-accent:var(--brand,#1B3FA0);--cu-ink:var(-
|
|
|
27
27
|
.cu-panel form{display:inline}`;
|
|
28
28
|
|
|
29
29
|
/** Lien de détail (cellule de tête de ligne). */
|
|
30
|
+
/** 0.2.1 — un lien n'est jamais `javascript:` ni `data:` : seuls un chemin du site (/…, ?…, #…) ou http(s) passent. */
|
|
31
|
+
const lienSur = (href) => { const h = String(href ?? ''); return /^(\/(?!\/)|\?|#|https?:\/\/)/i.test(h) ? h : '#'; };
|
|
32
|
+
|
|
30
33
|
export function detailLink(href, label = LIBELLES.fiche, { style = 'inline' } = {}) {
|
|
34
|
+
href = lienSur(href);
|
|
31
35
|
return style === 'classes'
|
|
32
36
|
? `<a class="cu-fiche" href="${esc(href)}">${esc(label)}</a>`
|
|
33
37
|
: `<a href="${esc(href)}" style="color:var(--blue);font-weight:600;text-decoration:none">${esc(label)}</a>`;
|