@egov-moldova/mud-site-kit 1.0.0 → 1.0.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/README.md +5 -3
- package/mud-site-kit.esm.js +30 -21
- package/mud-site-kit.esm.js.map +1 -1
- package/mud-site-kit.iife.js +4 -3
- package/mud-site-kit.iife.js.map +1 -1
- package/package.json +1 -1
- package/types/widgets/footer/footer.styles.d.ts +1 -1
- package/types/widgets/footer/mud-footer.d.ts +5 -0
package/README.md
CHANGED
|
@@ -36,7 +36,7 @@ The language of every widget comes from the `lang` attribute of the **`<html>` e
|
|
|
36
36
|
|
|
37
37
|
## Usage
|
|
38
38
|
|
|
39
|
-
|
|
39
|
+
The examples use `@latest` on purpose. Like a micro-frontend, the shared header and footer are served from the CDN, so every site picks up a new release on its next page load without redeploying (see the [npm page](https://www.npmjs.com/package/@egov-moldova/mud-site-kit) for published versions). To lock a specific version instead, replace `latest` with it (for example `@1.0.0`).
|
|
40
40
|
|
|
41
41
|
### Usage: CDN
|
|
42
42
|
|
|
@@ -52,9 +52,9 @@ Nothing to install. Load the bundle from jsDelivr (or unpkg, same path) and use
|
|
|
52
52
|
<mud-footer variant="mpass"></mud-footer>
|
|
53
53
|
|
|
54
54
|
<!-- ES module -->
|
|
55
|
-
<script type="module" src="https://cdn.jsdelivr.net/npm/@egov-moldova/mud-site-kit@
|
|
55
|
+
<script type="module" src="https://cdn.jsdelivr.net/npm/@egov-moldova/mud-site-kit@latest/mud-site-kit.esm.js"></script>
|
|
56
56
|
<!-- or classic script (global `MudSiteKit`) -->
|
|
57
|
-
<script src="https://cdn.jsdelivr.net/npm/@egov-moldova/mud-site-kit@
|
|
57
|
+
<script src="https://cdn.jsdelivr.net/npm/@egov-moldova/mud-site-kit@latest/mud-site-kit.iife.js"></script>
|
|
58
58
|
</body>
|
|
59
59
|
</html>
|
|
60
60
|
```
|
|
@@ -113,6 +113,8 @@ Standard footer of the AGE platforms. Variants: `mconnect`, `mdate`, `mpass`, `m
|
|
|
113
113
|
| --- | --- | --- |
|
|
114
114
|
| `variant` | yes | one of the variants above; an unknown one logs an error in the console and renders nothing |
|
|
115
115
|
| `assets-base` | no | folder URL that serves the logo files (default: `./assets/footer/` next to the bundle) |
|
|
116
|
+
| `max-width` | no | max width of the footer content, a CSS length (`1100px`, `80rem`) or a plain number of pixels (default: `1270px`) |
|
|
117
|
+
| `padding-x` | no | left and right padding of the content, same format (default: `16px`) |
|
|
116
118
|
|
|
117
119
|
The language follows `<html lang>`, see above. There is no language attribute on the widget.
|
|
118
120
|
|
package/mud-site-kit.esm.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
const x = ["mud.css", "tokens/core.tokens.css"];
|
|
2
|
-
let
|
|
2
|
+
let y, h;
|
|
3
3
|
function ne(e) {
|
|
4
|
-
|
|
4
|
+
y = e.baseUrl.endsWith("/") ? e.baseUrl : `${e.baseUrl}/`;
|
|
5
5
|
}
|
|
6
6
|
function k() {
|
|
7
|
-
return
|
|
7
|
+
return y ?? new URL(
|
|
8
8
|
/* @vite-ignore */
|
|
9
9
|
"./mud/",
|
|
10
10
|
import.meta.url
|
|
@@ -88,7 +88,7 @@ function a(e) {
|
|
|
88
88
|
function T(e, o) {
|
|
89
89
|
customElements.get(e) || customElements.define(e, o);
|
|
90
90
|
}
|
|
91
|
-
const
|
|
91
|
+
const d = {
|
|
92
92
|
support: { text: "022 820 000", href: "tel:022820000" },
|
|
93
93
|
mconnect: { text: "022 820 022", href: "tel:022820022" },
|
|
94
94
|
evo: { text: "022 820 026", href: "tel:022820026" }
|
|
@@ -126,7 +126,7 @@ const m = {
|
|
|
126
126
|
logo: "mconnect",
|
|
127
127
|
logoHref: "https://mconnect.gov.md/ro/home",
|
|
128
128
|
tagline: { ro: "platforma guvernamentală de interoperabilitate", ru: "государственная платформа интероперабельности", en: "government interoperability platform" },
|
|
129
|
-
phone:
|
|
129
|
+
phone: d.mconnect,
|
|
130
130
|
emails: [s.mconnect],
|
|
131
131
|
legal: [
|
|
132
132
|
{
|
|
@@ -196,7 +196,7 @@ const m = {
|
|
|
196
196
|
logo: "mdate",
|
|
197
197
|
logoHref: "https://date.gov.md/",
|
|
198
198
|
tagline: { ro: "portalul guvernamental de date", ru: "государственный портал данных", en: "government data portal" },
|
|
199
|
-
phone:
|
|
199
|
+
phone: d.mconnect,
|
|
200
200
|
emails: [s.mconnect],
|
|
201
201
|
legal: [
|
|
202
202
|
{
|
|
@@ -243,7 +243,7 @@ const m = {
|
|
|
243
243
|
logo: "mpass",
|
|
244
244
|
logoHref: "https://mpass.gov.md/",
|
|
245
245
|
tagline: { ro: "serviciul de autentificare și control al accesului", ru: "сервис аутентификации и контроля доступа", en: "authentication and access control service" },
|
|
246
|
-
phone:
|
|
246
|
+
phone: d.support,
|
|
247
247
|
emails: [s.supportCitizens, s.services],
|
|
248
248
|
legal: [
|
|
249
249
|
{
|
|
@@ -298,7 +298,7 @@ const m = {
|
|
|
298
298
|
logo: "msign",
|
|
299
299
|
logoHref: "https://msign.gov.md/",
|
|
300
300
|
tagline: { ro: "serviciul guvernamental de semnătură electronică", ru: "государственный сервис электронной подписи", en: "government electronic signature service" },
|
|
301
|
-
phone:
|
|
301
|
+
phone: d.support,
|
|
302
302
|
emails: [s.supportCitizens, s.services],
|
|
303
303
|
legal: [
|
|
304
304
|
{
|
|
@@ -353,7 +353,7 @@ const m = {
|
|
|
353
353
|
logo: "mpower",
|
|
354
354
|
logoHref: "https://mpower.gov.md/#/ro",
|
|
355
355
|
tagline: { ro: "registrul împuternicirilor de reprezentare în baza semnăturii electronice", ru: "реестр доверенностей на представительство на основе электронной подписи", en: "register of representation authorizations based on electronic signature" },
|
|
356
|
-
phone:
|
|
356
|
+
phone: d.support,
|
|
357
357
|
emails: [s.supportCitizens, s.services],
|
|
358
358
|
legal: [
|
|
359
359
|
{
|
|
@@ -422,7 +422,7 @@ const m = {
|
|
|
422
422
|
logo: "mnotify",
|
|
423
423
|
logoHref: "https://mnotify.gov.md/#/ro/home",
|
|
424
424
|
tagline: { ro: "serviciul guvernamental de notificare", ru: "государственный сервис уведомлений", en: "government notification service" },
|
|
425
|
-
phone:
|
|
425
|
+
phone: d.support,
|
|
426
426
|
emails: [s.supportCitizens, s.services],
|
|
427
427
|
legal: [
|
|
428
428
|
{
|
|
@@ -477,7 +477,7 @@ const m = {
|
|
|
477
477
|
logo: "mdelivery",
|
|
478
478
|
logoHref: "https://mdelivery.gov.md/public",
|
|
479
479
|
tagline: { ro: "serviciul guvernamental de livrare", ru: "государственный сервис доставки", en: "government delivery service" },
|
|
480
|
-
phone:
|
|
480
|
+
phone: d.evo,
|
|
481
481
|
emails: [s.support],
|
|
482
482
|
legal: [
|
|
483
483
|
{
|
|
@@ -527,7 +527,7 @@ const m = {
|
|
|
527
527
|
logo: "mlearn",
|
|
528
528
|
logoHref: "https://mlearn.gov.md/",
|
|
529
529
|
tagline: { ro: "platforma guvernamentală de instruire la distanță", ru: "государственная платформа дистанционного обучения", en: "government distance learning platform" },
|
|
530
|
-
phone:
|
|
530
|
+
phone: d.support,
|
|
531
531
|
emails: [s.supportCitizens, s.services],
|
|
532
532
|
legal: [
|
|
533
533
|
{
|
|
@@ -575,7 +575,7 @@ const m = {
|
|
|
575
575
|
logo: "evosign",
|
|
576
576
|
logoHref: "https://evosign.gov.md/",
|
|
577
577
|
tagline: { ro: "Identitatea ta digitală direct în telefon", ru: "Ваша цифровая идентичность прямо в телефоне", en: "Your digital identity right on your phone" },
|
|
578
|
-
phone:
|
|
578
|
+
phone: d.evo,
|
|
579
579
|
emails: [s.support],
|
|
580
580
|
legal: [
|
|
581
581
|
{
|
|
@@ -821,6 +821,7 @@ const I = `<symbol id="icon-phone" viewBox="3.8 3.1 17.7 17.7">
|
|
|
821
821
|
|
|
822
822
|
/* --- layout --- */
|
|
823
823
|
--footer-max-width: 1270px;
|
|
824
|
+
--footer-padding-x: var(--mud-spacing-16);
|
|
824
825
|
}
|
|
825
826
|
|
|
826
827
|
/* ============ base resets scoped to the footer ============ */
|
|
@@ -859,7 +860,7 @@ const I = `<symbol id="icon-phone" viewBox="3.8 3.1 17.7 17.7">
|
|
|
859
860
|
margin-inline: auto;
|
|
860
861
|
padding-block: var(--mud-spacing-40);
|
|
861
862
|
/* always keep a gutter, so content never touches the screen edge below the max width */
|
|
862
|
-
padding-inline: var(--
|
|
863
|
+
padding-inline: var(--footer-padding-x);
|
|
863
864
|
}
|
|
864
865
|
|
|
865
866
|
.mud-footer__bottom .mud-footer__container {
|
|
@@ -1192,7 +1193,7 @@ const I = `<symbol id="icon-phone" viewBox="3.8 3.1 17.7 17.7">
|
|
|
1192
1193
|
align-items: flex-start;
|
|
1193
1194
|
}
|
|
1194
1195
|
}
|
|
1195
|
-
`,
|
|
1196
|
+
`, C = (e) => e.newTab ? ' target="_blank" rel="noopener noreferrer"' : "", f = (e, o = "") => `<svg class="mud-icon ${o}"><use href="#${e}"></use></svg>`, m = (e, o) => e.sections?.[o] !== !1, N = (e) => (o) => `<li class="mud-footer__nav--item"><a class="mud-footer__nav--link" href="${a(o.href)}"${C(o)}>${a(l(o.label, e))}${o.badge ? `<span class="mud-badge">${a(l(o.badge, e))}</span>` : ""}</a></li>`, v = (e, o) => `
|
|
1196
1197
|
<div class="mud-footer__nav-col">
|
|
1197
1198
|
<div class="mud-footer__heading">${e || " "}</div>
|
|
1198
1199
|
<ul class="mud-footer__nav--list">${o}</ul>
|
|
@@ -1238,7 +1239,7 @@ const K = ({ variant: e, lang: o }) => {
|
|
|
1238
1239
|
<span class="mud-brand-text">${a(o.name)}</span>
|
|
1239
1240
|
<span class="mud-brand-description">${a(l(o.tagline, r))}</span>
|
|
1240
1241
|
</div>
|
|
1241
|
-
</a>${
|
|
1242
|
+
</a>${m(o, "contact") ? K(e) : ""}
|
|
1242
1243
|
</div>`;
|
|
1243
1244
|
}, J = ({ shared: e, lang: o, assetsBase: r }) => `
|
|
1244
1245
|
<div class="mud-footer__extras">
|
|
@@ -1260,7 +1261,7 @@ const K = ({ variant: e, lang: o }) => {
|
|
|
1260
1261
|
).join(""), ee = ({ shared: e }) => e.social.map(
|
|
1261
1262
|
(o) => `<li><a class="mud-footer__social--link" href="${a(o.href)}" target="_blank" rel="noopener noreferrer" aria-label="${a(o.label)}">${f(o.icon)}</a></li>`
|
|
1262
1263
|
).join(""), oe = (e) => {
|
|
1263
|
-
const o =
|
|
1264
|
+
const o = m(e.variant, "institutions"), r = m(e.variant, "social");
|
|
1264
1265
|
return !o && !r ? "" : `
|
|
1265
1266
|
<hr class="mud-separator mud-separator--horizontal mud-separator--thin mud-separator--subtle">
|
|
1266
1267
|
|
|
@@ -1271,7 +1272,7 @@ const K = ({ variant: e, lang: o }) => {
|
|
|
1271
1272
|
</div>
|
|
1272
1273
|
`;
|
|
1273
1274
|
}, te = ({ variant: e, lang: o, shared: r }) => {
|
|
1274
|
-
const n =
|
|
1275
|
+
const n = m(e, "legal") ? (e.legal ?? []).map((i) => `<li><a href="${a(i.href)}"${C(i)}>${a(l(i.label, o))}</a></li>`).join("") : "";
|
|
1275
1276
|
return `
|
|
1276
1277
|
<div class="mud-footer__bottom">
|
|
1277
1278
|
<div class="mud-footer__container mud-footer__bottom-inner">
|
|
@@ -1281,7 +1282,7 @@ const K = ({ variant: e, lang: o }) => {
|
|
|
1281
1282
|
</div>`;
|
|
1282
1283
|
};
|
|
1283
1284
|
function re(e) {
|
|
1284
|
-
const { variant: o } = e, r = o.columns.map((i) => Y(i, e)).join(""), n =
|
|
1285
|
+
const { variant: o } = e, r = o.columns.map((i) => Y(i, e)).join(""), n = m(o, "navigation") && r ? `
|
|
1285
1286
|
<nav class="mud-footer__nav" aria-label="Footer navigation">${r}
|
|
1286
1287
|
</nav>
|
|
1287
1288
|
` : "";
|
|
@@ -1290,7 +1291,7 @@ function re(e) {
|
|
|
1290
1291
|
<div class="mud-footer__container">
|
|
1291
1292
|
<div class="mud-footer__top">
|
|
1292
1293
|
${Q(e)}
|
|
1293
|
-
${n}${
|
|
1294
|
+
${n}${m(o, "evo") ? J(e) : ""}
|
|
1294
1295
|
</div>
|
|
1295
1296
|
${oe(e)}
|
|
1296
1297
|
</div>
|
|
@@ -1299,7 +1300,15 @@ ${te(e)}
|
|
|
1299
1300
|
}
|
|
1300
1301
|
class ae extends G {
|
|
1301
1302
|
static get observedAttributes() {
|
|
1302
|
-
return ["variant", "assets-base"];
|
|
1303
|
+
return ["variant", "assets-base", "max-width", "padding-x"];
|
|
1304
|
+
}
|
|
1305
|
+
afterRender() {
|
|
1306
|
+
this.applyLength("max-width", "--footer-max-width"), this.applyLength("padding-x", "--footer-padding-x");
|
|
1307
|
+
}
|
|
1308
|
+
/** Maps an optional length attribute to a CSS custom property; without a valid value the default from the styles stays. */
|
|
1309
|
+
applyLength(o, r) {
|
|
1310
|
+
const n = this.getAttribute(o)?.trim(), i = n && /^\d+(\.\d+)?$/.test(n) ? `${n}px` : n;
|
|
1311
|
+
i && /^\d*\.?\d+(px|rem|em|%|vw|ch)$/.test(i) ? this.style.setProperty(r, i) : this.style.removeProperty(r);
|
|
1303
1312
|
}
|
|
1304
1313
|
styles() {
|
|
1305
1314
|
return O;
|