@gerege-systems/eid-mongolia-sdk 0.39.0 → 0.40.0
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 +3 -3
- package/dist/button.cjs +52 -41
- package/dist/button.d.cts +2 -0
- package/dist/button.d.ts +2 -0
- package/dist/button.js +52 -41
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -156,7 +156,7 @@ app.use("/auth/eid", express.json(), async (req, res) => {
|
|
|
156
156
|
| `theme` | `auto` \| `light` \| `dark` | `auto` |
|
|
157
157
|
| `success-url` (`successUrl`) | backend redirect өгөөгүй үед шилжих URL | — |
|
|
158
158
|
| `label` | товчны текст; `""` → зөвхөн лого | i18n: «e-ID-ээр нэвтрэх» / «Log in with e-ID» |
|
|
159
|
-
| `icon` | `eid` (
|
|
159
|
+
| `icon` | `eid` («e-ID» wordmark, inline SVG `fill: currentColor` — товч / гарчгийн текстийн өнгөөр light / dark-ийг дагана; өндөр товчинд 16px, зөвхөн-лого үед 12px, цонхны толгойд 20px; анхдагч текстэй үед лого «e-ID»-г орлоно: [e-ID] нэвтрэх, бүтэн нэр `aria-label`-д) \| `none` (логогүй, бүтэн текст) | `eid` |
|
|
160
160
|
| `variant` | `default` (лого + текст) \| `icon` (зөвхөн лого, 44×44) | `default` |
|
|
161
161
|
| `aria-label` | товчны хүртээмжийн нэр (дэлгэц уншигч) | зөвхөн-лого үед `label` эсвэл i18n текст |
|
|
162
162
|
|
|
@@ -203,13 +203,13 @@ Dark-ийн дараалал: `--eid-<нэр>-dark` → `--eid-<нэр>` → dar
|
|
|
203
203
|
}
|
|
204
204
|
eid-login-button::part(button) { width: 100%; } /* part: button, icon, label, dialog (backdrop — зөвхөн fallback-д) */
|
|
205
205
|
eid-login-button::part(label) { font-weight: 600; }
|
|
206
|
-
eid-login-button::part(icon) {
|
|
206
|
+
eid-login-button::part(icon) { height: 18px; }
|
|
207
207
|
```
|
|
208
208
|
|
|
209
209
|
| Хувьсагч (`-dark` хувилбартай) | Юунд | Light анхдагч | Dark анхдагч |
|
|
210
210
|
|---|---|---|---|
|
|
211
211
|
| `--eid-accent` | үндсэн товч | `oklch(0.534 0.2 259)` | `oklch(0.64 0.15 259)` |
|
|
212
|
-
| `--eid-logo` | **deprecated (0.38.0)** —
|
|
212
|
+
| `--eid-logo` | **deprecated (0.38.0)** — үл хэрэгжинэ; 0.40.0-оос wordmark `currentColor` (товч / гарчгийн текстийн өнгө) | — | — |
|
|
213
213
|
| `--eid-accent-fg` | үндсэн товчны текст | `#fff` | `hsl(229 50% 6%)` |
|
|
214
214
|
| `--eid-accent-subtle` | алхмын дугаарын дэвсгэр | `oklch(0.97 0.03 259)` | `oklch(0.24 0.06 259)` |
|
|
215
215
|
| `--eid-accent-subtle-fg` | алхмын дугаар | `oklch(0.474 0.19 259)` | `oklch(0.82 0.1 259)` |
|
package/dist/button.cjs
CHANGED
|
@@ -40,16 +40,9 @@ function isMobileUserAgent(nav) {
|
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
// src/logo.ts
|
|
43
|
-
var EID_LOGO_VIEWBOX = "0 0
|
|
44
|
-
var
|
|
45
|
-
|
|
46
|
-
["path", { d: "M34 4H46A14 14 0 0 1 60 18V46A14 14 0 0 1 46 60H34Z", fill: "#2457E6" }],
|
|
47
|
-
["path", { class: "m-l", d: "M14 32H50A18 18 0 0 0 14 32A18 18 0 0 0 50 32", fill: "none", "stroke-width": "4.8", "stroke-linejoin": "round" }],
|
|
48
|
-
["circle", { class: "m-l", cx: "32", cy: "32", r: "12", fill: "#1564E1", "stroke-width": "1.4" }],
|
|
49
|
-
["path", { d: "M23.5 23.5L40.5 40.5M40.5 23.5L23.5 40.5", stroke: "#FFFFFF", "stroke-width": "1.8" }],
|
|
50
|
-
["circle", { cx: "32", cy: "32", r: "4.4", fill: "#FFFFFF" }],
|
|
51
|
-
["circle", { cx: "32", cy: "32", r: "3", fill: "#1564E1" }]
|
|
52
|
-
];
|
|
43
|
+
var EID_LOGO_VIEWBOX = "0 0 3840 1372";
|
|
44
|
+
var EID_LOGO_TRANSFORM = "translate(0.016725,1765.695476) scale(1,-1)";
|
|
45
|
+
var EID_LOGO_PATH = "M331 1765 c-26 -5 -46 -23 -54 -49 l-2 -7 0 -81 0 -80 2 -9 c9 -25 28 -42 54 -47 6 -1 41 -1 219 -1 237 0 219 1 235 -7 17 -9 32 -28 36 -46 3 -11 2 -160 0 -169 -7 -25 -25 -43 -50 -50 -6 -1 -16 -1 -222 -1 -207 0 -217 0 -223 1 -20 6 -35 19 -44 37 -7 12 -6 8 -7 96 -1 81 -1 82 -3 89 -7 24 -26 42 -50 49 -6 1 -13 2 -85 2 l-78 0 -8 -3 c-25 -7 -43 -25 -49 -50 -2 -7 -2 -11 -2 -276 0 -303 -1 -275 8 -292 3 -7 7 -12 232 -237 225 -225 230 -229 237 -232 16 -8 -12 -7 292 -7 257 0 271 0 277 1 24 7 44 27 49 51 3 10 3 159 0 169 -5 23 -23 42 -47 50 l-7 3 -356 0 -356 1 -8 2 c-21 8 -38 25 -44 46 l-2 8 0 79 c0 88 0 86 6 99 10 18 24 31 45 37 5 1 22 1 361 2 l356 1 7 2 c21 8 36 23 44 44 l3 8 0 134 c0 148 0 141 -6 155 -2 3 -6 9 -8 13 -3 3 -106 106 -229 229 -240 240 -227 227 -244 233 l-8 4 -133 0 c-74 0 -135 -1 -138 -1z M2251 1765 c-26 -5 -46 -23 -54 -49 l-2 -7 0 -629 0 -628 2 -8 c7 -24 23 -40 47 -47 l8 -2 80 0 81 0 8 2 c25 9 42 28 47 54 2 11 2 1247 0 1258 -5 26 -22 45 -47 54 l-8 3 -79 0 c-43 0 -80 -1 -83 -1z M2798 1765 c-26 -6 -48 -27 -53 -52 -2 -6 -2 -58 -2 -499 l1 -491 2 -8 c8 -22 27 -39 49 -45 10 -2 160 -2 170 0 22 6 41 23 49 45 l3 8 0 355 c0 286 1 356 2 361 5 18 19 36 36 45 16 8 -2 7 240 7 l217 0 7 -3 c21 -8 38 -25 44 -46 l2 -8 0 -354 0 -354 -2 -8 c-6 -21 -23 -38 -44 -46 l-7 -2 -219 -1 -219 0 -8 -3 c-19 -7 -33 -19 -41 -35 -8 -16 -8 -14 -8 -103 l1 -78 3 -9 c6 -18 18 -32 34 -40 17 -7 9 -7 157 -7 147 1 135 0 151 8 7 3 12 7 237 232 225 225 229 230 232 237 9 17 8 0 8 209 0 209 1 192 -8 209 -3 7 -7 12 -232 237 -225 225 -230 229 -237 232 -16 8 13 7 -289 8 -218 0 -271 0 -276 -1z M1424 1215 c-24 -5 -43 -24 -50 -48 l-2 -7 0 -80 0 -79 2 -8 c6 -19 19 -35 35 -43 16 -8 -3 -7 237 -7 209 0 215 0 222 2 25 6 45 27 50 52 3 10 3 156 0 166 -5 25 -25 46 -50 52 -7 2 -13 2 -223 2 -185 0 -216 0 -221 -2z";
|
|
53
46
|
|
|
54
47
|
// src/qr.ts
|
|
55
48
|
var ECC_PER_BLOCK_M = [
|
|
@@ -408,10 +401,12 @@ function resolveEidLang(lang) {
|
|
|
408
401
|
var MN = {
|
|
409
402
|
button: "e-ID-\u044D\u044D\u0440 \u043D\u044D\u0432\u0442\u0440\u044D\u0445",
|
|
410
403
|
title: "e-ID-\u044D\u044D\u0440 \u043D\u044D\u0432\u0442\u0440\u044D\u0445",
|
|
404
|
+
// Лого «e-ID» гэж бичигддэг тул логотой үед «e-ID»-г давтахгүй: [лого] нэвтрэх.
|
|
405
|
+
withLogo: ["", "\u043D\u044D\u0432\u0442\u0440\u044D\u0445"],
|
|
411
406
|
close: "\u0425\u0430\u0430\u0445",
|
|
412
407
|
loading: "\u0410\u0447\u0430\u0430\u043B\u0436 \u0431\u0430\u0439\u043D\u0430",
|
|
413
|
-
qrAlt: "\u041D\u044D\u0432\u0442\u0440\u044D\u0445 QR \u043A\u043E\u0434 \u2014 \u0443\u0442\u0441\u0430\u043D \u0434\u044D\u044D\u0440\u0445
|
|
414
|
-
steps: ["\u0423\u0442\u0441\u0430\u043D \u0434\u044D\u044D\u0440\u0445
|
|
408
|
+
qrAlt: "\u041D\u044D\u0432\u0442\u0440\u044D\u0445 QR \u043A\u043E\u0434 \u2014 \u0443\u0442\u0441\u0430\u043D \u0434\u044D\u044D\u0440\u0445 e-ID Mongolia \u0430\u043F\u043F\u0430\u0430\u0440 \u0443\u043D\u0448\u0443\u0443\u043B\u043D\u0430",
|
|
409
|
+
steps: ["\u0423\u0442\u0441\u0430\u043D \u0434\u044D\u044D\u0440\u0445 e-ID Mongolia \u0430\u043F\u043F\u044B\u0433 \u043D\u044D\u044D\u043D\u044D", "QR \u043A\u043E\u0434\u044B\u0433 \u0443\u043D\u0448\u0443\u0443\u043B\u043D\u0430", "PIN1 \u043A\u043E\u0434\u043E\u043E \u043E\u0440\u0443\u0443\u043B\u043D\u0430"],
|
|
415
410
|
vcLabel: "\u0411\u0430\u0442\u0430\u043B\u0433\u0430\u0430\u0436\u0443\u0443\u043B\u0430\u0445 \u043A\u043E\u0434",
|
|
416
411
|
or: "\u044D\u0441\u0432\u044D\u043B",
|
|
417
412
|
usePush: "\u0420\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0439\u043D \u0434\u0443\u0433\u0430\u0430\u0440\u0430\u0430\u0440 \u043D\u044D\u0432\u0442\u0440\u044D\u0445",
|
|
@@ -449,10 +444,11 @@ var T = {
|
|
|
449
444
|
en: {
|
|
450
445
|
button: "Log in with e-ID",
|
|
451
446
|
title: "Log in with e-ID",
|
|
447
|
+
withLogo: ["Log in with ", ""],
|
|
452
448
|
close: "Close",
|
|
453
449
|
loading: "Loading",
|
|
454
|
-
qrAlt: "Login QR code \u2014 scan it with the
|
|
455
|
-
steps: ["Open the
|
|
450
|
+
qrAlt: "Login QR code \u2014 scan it with the e-ID Mongolia app on your phone",
|
|
451
|
+
steps: ["Open the e-ID Mongolia app on your phone", "Scan the QR code", "Enter your PIN1"],
|
|
456
452
|
vcLabel: "Verification code",
|
|
457
453
|
or: "or",
|
|
458
454
|
usePush: "Log in with registration number",
|
|
@@ -488,10 +484,11 @@ var T = {
|
|
|
488
484
|
ru: {
|
|
489
485
|
button: "\u0412\u043E\u0439\u0442\u0438 \u0447\u0435\u0440\u0435\u0437 e-ID",
|
|
490
486
|
title: "\u0412\u043E\u0439\u0442\u0438 \u0447\u0435\u0440\u0435\u0437 e-ID",
|
|
487
|
+
withLogo: ["\u0412\u043E\u0439\u0442\u0438 \u0447\u0435\u0440\u0435\u0437 ", ""],
|
|
491
488
|
close: "\u0417\u0430\u043A\u0440\u044B\u0442\u044C",
|
|
492
489
|
loading: "\u0417\u0430\u0433\u0440\u0443\u0437\u043A\u0430",
|
|
493
|
-
qrAlt: "QR-\u043A\u043E\u0434 \u0434\u043B\u044F \u0432\u0445\u043E\u0434\u0430 \u2014 \u043E\u0442\u0441\u043A\u0430\u043D\u0438\u0440\u0443\u0439\u0442\u0435 \u0435\u0433\u043E \u043F\u0440\u0438\u043B\u043E\u0436\u0435\u043D\u0438\u0435\u043C
|
|
494
|
-
steps: ["\u041E\u0442\u043A\u0440\u043E\u0439\u0442\u0435 \u043F\u0440\u0438\u043B\u043E\u0436\u0435\u043D\u0438\u0435
|
|
490
|
+
qrAlt: "QR-\u043A\u043E\u0434 \u0434\u043B\u044F \u0432\u0445\u043E\u0434\u0430 \u2014 \u043E\u0442\u0441\u043A\u0430\u043D\u0438\u0440\u0443\u0439\u0442\u0435 \u0435\u0433\u043E \u043F\u0440\u0438\u043B\u043E\u0436\u0435\u043D\u0438\u0435\u043C e-ID Mongolia \u043D\u0430 \u0442\u0435\u043B\u0435\u0444\u043E\u043D\u0435",
|
|
491
|
+
steps: ["\u041E\u0442\u043A\u0440\u043E\u0439\u0442\u0435 \u043F\u0440\u0438\u043B\u043E\u0436\u0435\u043D\u0438\u0435 e-ID Mongolia \u043D\u0430 \u0442\u0435\u043B\u0435\u0444\u043E\u043D\u0435", "\u041E\u0442\u0441\u043A\u0430\u043D\u0438\u0440\u0443\u0439\u0442\u0435 QR-\u043A\u043E\u0434", "\u0412\u0432\u0435\u0434\u0438\u0442\u0435 PIN1"],
|
|
495
492
|
vcLabel: "\u041A\u043E\u0434 \u043F\u043E\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043D\u0438\u044F",
|
|
496
493
|
or: "\u0438\u043B\u0438",
|
|
497
494
|
usePush: "\u0412\u043E\u0439\u0442\u0438 \u043F\u043E \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u043E\u043D\u043D\u043E\u043C\u0443 \u043D\u043E\u043C\u0435\u0440\u0443",
|
|
@@ -527,10 +524,11 @@ var T = {
|
|
|
527
524
|
zh: {
|
|
528
525
|
button: "\u4F7F\u7528 e-ID \u767B\u5F55",
|
|
529
526
|
title: "\u4F7F\u7528 e-ID \u767B\u5F55",
|
|
527
|
+
withLogo: ["\u4F7F\u7528", "\u767B\u5F55"],
|
|
530
528
|
close: "\u5173\u95ED",
|
|
531
529
|
loading: "\u52A0\u8F7D\u4E2D",
|
|
532
|
-
qrAlt: "\u767B\u5F55\u4E8C\u7EF4\u7801 \u2014 \u8BF7\u7528\u624B\u673A\u4E0A\u7684
|
|
533
|
-
steps: ["\u5728\u624B\u673A\u4E0A\u6253\u5F00
|
|
530
|
+
qrAlt: "\u767B\u5F55\u4E8C\u7EF4\u7801 \u2014 \u8BF7\u7528\u624B\u673A\u4E0A\u7684 e-ID Mongolia \u5E94\u7528\u626B\u63CF",
|
|
531
|
+
steps: ["\u5728\u624B\u673A\u4E0A\u6253\u5F00 e-ID Mongolia \u5E94\u7528", "\u626B\u63CF\u4E8C\u7EF4\u7801", "\u8F93\u5165 PIN1"],
|
|
534
532
|
vcLabel: "\u9A8C\u8BC1\u7801",
|
|
535
533
|
or: "\u6216",
|
|
536
534
|
usePush: "\u4F7F\u7528\u767B\u8BB0\u53F7\u767B\u5F55",
|
|
@@ -566,10 +564,11 @@ var T = {
|
|
|
566
564
|
fr: {
|
|
567
565
|
button: "Se connecter avec e-ID",
|
|
568
566
|
title: "Se connecter avec e-ID",
|
|
567
|
+
withLogo: ["Se connecter avec ", ""],
|
|
569
568
|
close: "Fermer",
|
|
570
569
|
loading: "Chargement",
|
|
571
|
-
qrAlt: "Code QR de connexion \u2014 scannez-le avec l'application
|
|
572
|
-
steps: ["Ouvrez l'application
|
|
570
|
+
qrAlt: "Code QR de connexion \u2014 scannez-le avec l'application e-ID Mongolia sur votre t\xE9l\xE9phone",
|
|
571
|
+
steps: ["Ouvrez l'application e-ID Mongolia sur votre t\xE9l\xE9phone", "Scannez le code QR", "Saisissez votre PIN1"],
|
|
573
572
|
vcLabel: "Code de v\xE9rification",
|
|
574
573
|
or: "ou",
|
|
575
574
|
usePush: "Se connecter avec le num\xE9ro national d'identit\xE9",
|
|
@@ -605,10 +604,11 @@ var T = {
|
|
|
605
604
|
es: {
|
|
606
605
|
button: "Iniciar sesi\xF3n con e-ID",
|
|
607
606
|
title: "Iniciar sesi\xF3n con e-ID",
|
|
607
|
+
withLogo: ["Iniciar sesi\xF3n con ", ""],
|
|
608
608
|
close: "Cerrar",
|
|
609
609
|
loading: "Cargando",
|
|
610
|
-
qrAlt: "C\xF3digo QR de inicio de sesi\xF3n: escan\xE9elo con la aplicaci\xF3n
|
|
611
|
-
steps: ["Abra la aplicaci\xF3n
|
|
610
|
+
qrAlt: "C\xF3digo QR de inicio de sesi\xF3n: escan\xE9elo con la aplicaci\xF3n e-ID Mongolia de su tel\xE9fono",
|
|
611
|
+
steps: ["Abra la aplicaci\xF3n e-ID Mongolia en su tel\xE9fono", "Escanee el c\xF3digo QR", "Introduzca su PIN1"],
|
|
612
612
|
vcLabel: "C\xF3digo de verificaci\xF3n",
|
|
613
613
|
or: "o",
|
|
614
614
|
usePush: "Iniciar sesi\xF3n con el documento nacional de identidad",
|
|
@@ -644,10 +644,11 @@ var T = {
|
|
|
644
644
|
ar: {
|
|
645
645
|
button: "\u062A\u0633\u062C\u064A\u0644 \u0627\u0644\u062F\u062E\u0648\u0644 \u0639\u0628\u0631 e-ID",
|
|
646
646
|
title: "\u062A\u0633\u062C\u064A\u0644 \u0627\u0644\u062F\u062E\u0648\u0644 \u0639\u0628\u0631 e-ID",
|
|
647
|
+
withLogo: ["\u062A\u0633\u062C\u064A\u0644 \u0627\u0644\u062F\u062E\u0648\u0644 \u0639\u0628\u0631 ", ""],
|
|
647
648
|
close: "\u0625\u063A\u0644\u0627\u0642",
|
|
648
649
|
loading: "\u062C\u0627\u0631\u064D \u0627\u0644\u062A\u062D\u0645\u064A\u0644",
|
|
649
|
-
qrAlt: "\u0631\u0645\u0632 QR \u0644\u062A\u0633\u062C\u064A\u0644 \u0627\u0644\u062F\u062E\u0648\u0644 \u2014 \u0627\u0645\u0633\u062D\u0647 \u0628\u062A\u0637\u0628\u064A\u0642
|
|
650
|
-
steps: ["\u0627\u0641\u062A\u062D \u062A\u0637\u0628\u064A\u0642
|
|
650
|
+
qrAlt: "\u0631\u0645\u0632 QR \u0644\u062A\u0633\u062C\u064A\u0644 \u0627\u0644\u062F\u062E\u0648\u0644 \u2014 \u0627\u0645\u0633\u062D\u0647 \u0628\u062A\u0637\u0628\u064A\u0642 e-ID Mongolia \u0639\u0644\u0649 \u0647\u0627\u062A\u0641\u0643",
|
|
651
|
+
steps: ["\u0627\u0641\u062A\u062D \u062A\u0637\u0628\u064A\u0642 e-ID Mongolia \u0639\u0644\u0649 \u0647\u0627\u062A\u0641\u0643", "\u0627\u0645\u0633\u062D \u0631\u0645\u0632 QR", "\u0623\u062F\u062E\u0644 PIN1"],
|
|
651
652
|
vcLabel: "\u0631\u0645\u0632 \u0627\u0644\u062A\u062D\u0642\u0642",
|
|
652
653
|
or: "\u0623\u0648",
|
|
653
654
|
usePush: "\u062A\u0633\u062C\u064A\u0644 \u0627\u0644\u062F\u062E\u0648\u0644 \u0628\u0631\u0642\u0645 \u0627\u0644\u0647\u0648\u064A\u0629 \u0627\u0644\u0648\u0637\u0646\u064A\u0629",
|
|
@@ -725,8 +726,6 @@ button, input { font-family: inherit; }
|
|
|
725
726
|
`;
|
|
726
727
|
var DARK_CSS = `:host { color-scheme: dark;
|
|
727
728
|
${darkVars} }
|
|
728
|
-
.logo .m-a { fill: #fff; }
|
|
729
|
-
.logo .m-l { stroke: #0A1631; }
|
|
730
729
|
`;
|
|
731
730
|
var CSS_REST = `
|
|
732
731
|
*, *::before, *::after { box-sizing: border-box; }
|
|
@@ -744,10 +743,9 @@ h2, p, ol { margin: 0; }
|
|
|
744
743
|
.btn-outline:hover { background: var(--_eid-bg-muted); }
|
|
745
744
|
.btn-sm { width: auto; min-height: 36px; padding: 0 14px; font-size: 0.8125rem; }
|
|
746
745
|
.trigger { width: auto; }
|
|
747
|
-
.
|
|
748
|
-
.logo
|
|
749
|
-
.
|
|
750
|
-
.trigger.icon-only .logo { width: 24px; height: 24px; }
|
|
746
|
+
.brand { display: inline-flex; align-items: center; gap: 6px; }
|
|
747
|
+
.logo { display: block; flex: none; height: 16px; width: auto; aspect-ratio: 3840 / 1372; fill: currentColor; }
|
|
748
|
+
.trigger.icon-only .logo { height: 12px; }
|
|
751
749
|
.trigger.icon-only { width: 44px; height: 44px; padding: 0; }
|
|
752
750
|
.backdrop { position: fixed; inset: 0; z-index: 2147483000; background: hsl(222 47% 11% / 0.5); display: flex; align-items: center;
|
|
753
751
|
justify-content: center; padding: 16px; overflow-y: auto; }
|
|
@@ -757,7 +755,7 @@ dialog.dialog::backdrop { background: hsl(222 47% 11% / 0.5); }
|
|
|
757
755
|
color: var(--_eid-fg); border: 1px solid var(--_eid-border); border-radius: var(--_eid-radius-lg); padding: 24px; font-size: 0.875rem; line-height: 1.5rem; }
|
|
758
756
|
@media (max-width: 639px) { .dialog { padding: 16px; } }
|
|
759
757
|
.head { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
|
|
760
|
-
.head .logo {
|
|
758
|
+
.head .logo { height: 20px; }
|
|
761
759
|
.head h2 { flex: 1; font-size: 1.125rem; line-height: 1.75rem; font-weight: 600; }
|
|
762
760
|
.x { width: 36px; height: 36px; border: 0; border-radius: var(--_eid-radius); background: transparent; color: var(--_eid-fg-muted); cursor: pointer; font-size: 1.25rem; line-height: 1; }
|
|
763
761
|
.x:hover { background: var(--_eid-bg-muted); color: var(--_eid-fg); }
|
|
@@ -833,11 +831,10 @@ function logo(attrs = {}) {
|
|
|
833
831
|
for (const [k, v] of Object.entries({ class: "logo", viewBox: EID_LOGO_VIEWBOX, "aria-hidden": "true", focusable: "false", ...attrs })) {
|
|
834
832
|
svg.setAttribute(k, v);
|
|
835
833
|
}
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
}
|
|
834
|
+
const path = document.createElementNS(NS, "path");
|
|
835
|
+
path.setAttribute("transform", EID_LOGO_TRANSFORM);
|
|
836
|
+
path.setAttribute("d", EID_LOGO_PATH);
|
|
837
|
+
svg.append(path);
|
|
841
838
|
return svg;
|
|
842
839
|
}
|
|
843
840
|
function chevron() {
|
|
@@ -931,16 +928,29 @@ var EidLoginButton = class extends Base {
|
|
|
931
928
|
console.warn('<eid-login-button>: icon="none" \u0431\u0430 \u0442\u0435\u043A\u0441\u0442\u0433\u04AF\u0439 (variant="icon" \u044D\u0441\u0432\u044D\u043B label="") \u2014 \u0430\u043D\u0445\u0434\u0430\u0433\u0447 \u0442\u0435\u043A\u0441\u0442\u0438\u0439\u0433 \u0445\u0430\u0440\u0443\u0443\u043B\u0430\u0432.');
|
|
932
929
|
}
|
|
933
930
|
}
|
|
931
|
+
const brand = hasIcon && !iconOnly && !label;
|
|
934
932
|
const nodes = [];
|
|
935
|
-
if (
|
|
936
|
-
|
|
933
|
+
if (brand) nodes.push(this.brand({ part: "icon" }, { part: "label" }));
|
|
934
|
+
else {
|
|
935
|
+
if (hasIcon) nodes.push(logo({ part: "icon" }));
|
|
936
|
+
if (!iconOnly) nodes.push(el("span", { part: "label" }, text));
|
|
937
|
+
}
|
|
937
938
|
this.trigger.replaceChildren(...nodes);
|
|
938
939
|
this.trigger.classList.toggle("icon-only", iconOnly);
|
|
939
940
|
this.trigger.setAttribute("dir", this.uiDir);
|
|
940
|
-
const aria = this.getAttribute("aria-label") || (iconOnly ? text : null);
|
|
941
|
+
const aria = this.getAttribute("aria-label") || (iconOnly || brand ? text : null);
|
|
941
942
|
if (aria) this.trigger.setAttribute("aria-label", aria);
|
|
942
943
|
else this.trigger.removeAttribute("aria-label");
|
|
943
944
|
}
|
|
945
|
+
/** Лого + i18n-ийн өмнөх/дараах текст. Лого aria-hidden — дуудагч бүтэн нэрийг aria-label-аар өгнө. */
|
|
946
|
+
brand(logoAttrs = {}, textAttrs = {}) {
|
|
947
|
+
const [pre, post] = this.t.withLogo;
|
|
948
|
+
const box = el("span", { class: "brand" });
|
|
949
|
+
if (pre) box.append(el("span", textAttrs, pre));
|
|
950
|
+
box.append(logo(logoAttrs));
|
|
951
|
+
if (post) box.append(el("span", textAttrs, post));
|
|
952
|
+
return box;
|
|
953
|
+
}
|
|
944
954
|
disconnectedCallback() {
|
|
945
955
|
this.close();
|
|
946
956
|
this.themeObs?.disconnect();
|
|
@@ -989,8 +999,9 @@ var EidLoginButton = class extends Base {
|
|
|
989
999
|
const head = el("div", { class: "head" });
|
|
990
1000
|
const x = el("button", { type: "button", class: "x", "aria-label": this.t.close }, "\xD7");
|
|
991
1001
|
x.addEventListener("click", () => this.close());
|
|
992
|
-
const h2 = el("h2", { id: "eid-title"
|
|
993
|
-
|
|
1002
|
+
const h2 = el("h2", { id: "eid-title", "aria-label": this.t.title });
|
|
1003
|
+
h2.append(this.brand());
|
|
1004
|
+
head.append(h2, x);
|
|
994
1005
|
this.body = el("div");
|
|
995
1006
|
this.live = el("p", { class: "sr-only", "aria-live": "polite" });
|
|
996
1007
|
dlg.append(head, this.body, this.live);
|
package/dist/button.d.cts
CHANGED
|
@@ -82,6 +82,8 @@ declare class EidLoginButton extends Base {
|
|
|
82
82
|
attributeChangedCallback(name: string): void;
|
|
83
83
|
/** Trigger-ийн агуулга: label / icon / variant / aria-label-аас. Хоосон товч хэзээ ч үүсгэхгүй. */
|
|
84
84
|
private renderTrigger;
|
|
85
|
+
/** Лого + i18n-ийн өмнөх/дараах текст. Лого aria-hidden — дуудагч бүтэн нэрийг aria-label-аар өгнө. */
|
|
86
|
+
private brand;
|
|
85
87
|
disconnectedCallback(): void;
|
|
86
88
|
/** Одоогийн бодит схем (`theme` + auto үед хуудас/OS). */
|
|
87
89
|
get scheme(): Scheme;
|
package/dist/button.d.ts
CHANGED
|
@@ -82,6 +82,8 @@ declare class EidLoginButton extends Base {
|
|
|
82
82
|
attributeChangedCallback(name: string): void;
|
|
83
83
|
/** Trigger-ийн агуулга: label / icon / variant / aria-label-аас. Хоосон товч хэзээ ч үүсгэхгүй. */
|
|
84
84
|
private renderTrigger;
|
|
85
|
+
/** Лого + i18n-ийн өмнөх/дараах текст. Лого aria-hidden — дуудагч бүтэн нэрийг aria-label-аар өгнө. */
|
|
86
|
+
private brand;
|
|
85
87
|
disconnectedCallback(): void;
|
|
86
88
|
/** Одоогийн бодит схем (`theme` + auto үед хуудас/OS). */
|
|
87
89
|
get scheme(): Scheme;
|
package/dist/button.js
CHANGED
|
@@ -9,16 +9,9 @@ function isMobileUserAgent(nav) {
|
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
// src/logo.ts
|
|
12
|
-
var EID_LOGO_VIEWBOX = "0 0
|
|
13
|
-
var
|
|
14
|
-
|
|
15
|
-
["path", { d: "M34 4H46A14 14 0 0 1 60 18V46A14 14 0 0 1 46 60H34Z", fill: "#2457E6" }],
|
|
16
|
-
["path", { class: "m-l", d: "M14 32H50A18 18 0 0 0 14 32A18 18 0 0 0 50 32", fill: "none", "stroke-width": "4.8", "stroke-linejoin": "round" }],
|
|
17
|
-
["circle", { class: "m-l", cx: "32", cy: "32", r: "12", fill: "#1564E1", "stroke-width": "1.4" }],
|
|
18
|
-
["path", { d: "M23.5 23.5L40.5 40.5M40.5 23.5L23.5 40.5", stroke: "#FFFFFF", "stroke-width": "1.8" }],
|
|
19
|
-
["circle", { cx: "32", cy: "32", r: "4.4", fill: "#FFFFFF" }],
|
|
20
|
-
["circle", { cx: "32", cy: "32", r: "3", fill: "#1564E1" }]
|
|
21
|
-
];
|
|
12
|
+
var EID_LOGO_VIEWBOX = "0 0 3840 1372";
|
|
13
|
+
var EID_LOGO_TRANSFORM = "translate(0.016725,1765.695476) scale(1,-1)";
|
|
14
|
+
var EID_LOGO_PATH = "M331 1765 c-26 -5 -46 -23 -54 -49 l-2 -7 0 -81 0 -80 2 -9 c9 -25 28 -42 54 -47 6 -1 41 -1 219 -1 237 0 219 1 235 -7 17 -9 32 -28 36 -46 3 -11 2 -160 0 -169 -7 -25 -25 -43 -50 -50 -6 -1 -16 -1 -222 -1 -207 0 -217 0 -223 1 -20 6 -35 19 -44 37 -7 12 -6 8 -7 96 -1 81 -1 82 -3 89 -7 24 -26 42 -50 49 -6 1 -13 2 -85 2 l-78 0 -8 -3 c-25 -7 -43 -25 -49 -50 -2 -7 -2 -11 -2 -276 0 -303 -1 -275 8 -292 3 -7 7 -12 232 -237 225 -225 230 -229 237 -232 16 -8 -12 -7 292 -7 257 0 271 0 277 1 24 7 44 27 49 51 3 10 3 159 0 169 -5 23 -23 42 -47 50 l-7 3 -356 0 -356 1 -8 2 c-21 8 -38 25 -44 46 l-2 8 0 79 c0 88 0 86 6 99 10 18 24 31 45 37 5 1 22 1 361 2 l356 1 7 2 c21 8 36 23 44 44 l3 8 0 134 c0 148 0 141 -6 155 -2 3 -6 9 -8 13 -3 3 -106 106 -229 229 -240 240 -227 227 -244 233 l-8 4 -133 0 c-74 0 -135 -1 -138 -1z M2251 1765 c-26 -5 -46 -23 -54 -49 l-2 -7 0 -629 0 -628 2 -8 c7 -24 23 -40 47 -47 l8 -2 80 0 81 0 8 2 c25 9 42 28 47 54 2 11 2 1247 0 1258 -5 26 -22 45 -47 54 l-8 3 -79 0 c-43 0 -80 -1 -83 -1z M2798 1765 c-26 -6 -48 -27 -53 -52 -2 -6 -2 -58 -2 -499 l1 -491 2 -8 c8 -22 27 -39 49 -45 10 -2 160 -2 170 0 22 6 41 23 49 45 l3 8 0 355 c0 286 1 356 2 361 5 18 19 36 36 45 16 8 -2 7 240 7 l217 0 7 -3 c21 -8 38 -25 44 -46 l2 -8 0 -354 0 -354 -2 -8 c-6 -21 -23 -38 -44 -46 l-7 -2 -219 -1 -219 0 -8 -3 c-19 -7 -33 -19 -41 -35 -8 -16 -8 -14 -8 -103 l1 -78 3 -9 c6 -18 18 -32 34 -40 17 -7 9 -7 157 -7 147 1 135 0 151 8 7 3 12 7 237 232 225 225 229 230 232 237 9 17 8 0 8 209 0 209 1 192 -8 209 -3 7 -7 12 -232 237 -225 225 -230 229 -237 232 -16 8 13 7 -289 8 -218 0 -271 0 -276 -1z M1424 1215 c-24 -5 -43 -24 -50 -48 l-2 -7 0 -80 0 -79 2 -8 c6 -19 19 -35 35 -43 16 -8 -3 -7 237 -7 209 0 215 0 222 2 25 6 45 27 50 52 3 10 3 156 0 166 -5 25 -25 46 -50 52 -7 2 -13 2 -223 2 -185 0 -216 0 -221 -2z";
|
|
22
15
|
|
|
23
16
|
// src/qr.ts
|
|
24
17
|
var ECC_PER_BLOCK_M = [
|
|
@@ -377,10 +370,12 @@ function resolveEidLang(lang) {
|
|
|
377
370
|
var MN = {
|
|
378
371
|
button: "e-ID-\u044D\u044D\u0440 \u043D\u044D\u0432\u0442\u0440\u044D\u0445",
|
|
379
372
|
title: "e-ID-\u044D\u044D\u0440 \u043D\u044D\u0432\u0442\u0440\u044D\u0445",
|
|
373
|
+
// Лого «e-ID» гэж бичигддэг тул логотой үед «e-ID»-г давтахгүй: [лого] нэвтрэх.
|
|
374
|
+
withLogo: ["", "\u043D\u044D\u0432\u0442\u0440\u044D\u0445"],
|
|
380
375
|
close: "\u0425\u0430\u0430\u0445",
|
|
381
376
|
loading: "\u0410\u0447\u0430\u0430\u043B\u0436 \u0431\u0430\u0439\u043D\u0430",
|
|
382
|
-
qrAlt: "\u041D\u044D\u0432\u0442\u0440\u044D\u0445 QR \u043A\u043E\u0434 \u2014 \u0443\u0442\u0441\u0430\u043D \u0434\u044D\u044D\u0440\u0445
|
|
383
|
-
steps: ["\u0423\u0442\u0441\u0430\u043D \u0434\u044D\u044D\u0440\u0445
|
|
377
|
+
qrAlt: "\u041D\u044D\u0432\u0442\u0440\u044D\u0445 QR \u043A\u043E\u0434 \u2014 \u0443\u0442\u0441\u0430\u043D \u0434\u044D\u044D\u0440\u0445 e-ID Mongolia \u0430\u043F\u043F\u0430\u0430\u0440 \u0443\u043D\u0448\u0443\u0443\u043B\u043D\u0430",
|
|
378
|
+
steps: ["\u0423\u0442\u0441\u0430\u043D \u0434\u044D\u044D\u0440\u0445 e-ID Mongolia \u0430\u043F\u043F\u044B\u0433 \u043D\u044D\u044D\u043D\u044D", "QR \u043A\u043E\u0434\u044B\u0433 \u0443\u043D\u0448\u0443\u0443\u043B\u043D\u0430", "PIN1 \u043A\u043E\u0434\u043E\u043E \u043E\u0440\u0443\u0443\u043B\u043D\u0430"],
|
|
384
379
|
vcLabel: "\u0411\u0430\u0442\u0430\u043B\u0433\u0430\u0430\u0436\u0443\u0443\u043B\u0430\u0445 \u043A\u043E\u0434",
|
|
385
380
|
or: "\u044D\u0441\u0432\u044D\u043B",
|
|
386
381
|
usePush: "\u0420\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0439\u043D \u0434\u0443\u0433\u0430\u0430\u0440\u0430\u0430\u0440 \u043D\u044D\u0432\u0442\u0440\u044D\u0445",
|
|
@@ -418,10 +413,11 @@ var T = {
|
|
|
418
413
|
en: {
|
|
419
414
|
button: "Log in with e-ID",
|
|
420
415
|
title: "Log in with e-ID",
|
|
416
|
+
withLogo: ["Log in with ", ""],
|
|
421
417
|
close: "Close",
|
|
422
418
|
loading: "Loading",
|
|
423
|
-
qrAlt: "Login QR code \u2014 scan it with the
|
|
424
|
-
steps: ["Open the
|
|
419
|
+
qrAlt: "Login QR code \u2014 scan it with the e-ID Mongolia app on your phone",
|
|
420
|
+
steps: ["Open the e-ID Mongolia app on your phone", "Scan the QR code", "Enter your PIN1"],
|
|
425
421
|
vcLabel: "Verification code",
|
|
426
422
|
or: "or",
|
|
427
423
|
usePush: "Log in with registration number",
|
|
@@ -457,10 +453,11 @@ var T = {
|
|
|
457
453
|
ru: {
|
|
458
454
|
button: "\u0412\u043E\u0439\u0442\u0438 \u0447\u0435\u0440\u0435\u0437 e-ID",
|
|
459
455
|
title: "\u0412\u043E\u0439\u0442\u0438 \u0447\u0435\u0440\u0435\u0437 e-ID",
|
|
456
|
+
withLogo: ["\u0412\u043E\u0439\u0442\u0438 \u0447\u0435\u0440\u0435\u0437 ", ""],
|
|
460
457
|
close: "\u0417\u0430\u043A\u0440\u044B\u0442\u044C",
|
|
461
458
|
loading: "\u0417\u0430\u0433\u0440\u0443\u0437\u043A\u0430",
|
|
462
|
-
qrAlt: "QR-\u043A\u043E\u0434 \u0434\u043B\u044F \u0432\u0445\u043E\u0434\u0430 \u2014 \u043E\u0442\u0441\u043A\u0430\u043D\u0438\u0440\u0443\u0439\u0442\u0435 \u0435\u0433\u043E \u043F\u0440\u0438\u043B\u043E\u0436\u0435\u043D\u0438\u0435\u043C
|
|
463
|
-
steps: ["\u041E\u0442\u043A\u0440\u043E\u0439\u0442\u0435 \u043F\u0440\u0438\u043B\u043E\u0436\u0435\u043D\u0438\u0435
|
|
459
|
+
qrAlt: "QR-\u043A\u043E\u0434 \u0434\u043B\u044F \u0432\u0445\u043E\u0434\u0430 \u2014 \u043E\u0442\u0441\u043A\u0430\u043D\u0438\u0440\u0443\u0439\u0442\u0435 \u0435\u0433\u043E \u043F\u0440\u0438\u043B\u043E\u0436\u0435\u043D\u0438\u0435\u043C e-ID Mongolia \u043D\u0430 \u0442\u0435\u043B\u0435\u0444\u043E\u043D\u0435",
|
|
460
|
+
steps: ["\u041E\u0442\u043A\u0440\u043E\u0439\u0442\u0435 \u043F\u0440\u0438\u043B\u043E\u0436\u0435\u043D\u0438\u0435 e-ID Mongolia \u043D\u0430 \u0442\u0435\u043B\u0435\u0444\u043E\u043D\u0435", "\u041E\u0442\u0441\u043A\u0430\u043D\u0438\u0440\u0443\u0439\u0442\u0435 QR-\u043A\u043E\u0434", "\u0412\u0432\u0435\u0434\u0438\u0442\u0435 PIN1"],
|
|
464
461
|
vcLabel: "\u041A\u043E\u0434 \u043F\u043E\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043D\u0438\u044F",
|
|
465
462
|
or: "\u0438\u043B\u0438",
|
|
466
463
|
usePush: "\u0412\u043E\u0439\u0442\u0438 \u043F\u043E \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u043E\u043D\u043D\u043E\u043C\u0443 \u043D\u043E\u043C\u0435\u0440\u0443",
|
|
@@ -496,10 +493,11 @@ var T = {
|
|
|
496
493
|
zh: {
|
|
497
494
|
button: "\u4F7F\u7528 e-ID \u767B\u5F55",
|
|
498
495
|
title: "\u4F7F\u7528 e-ID \u767B\u5F55",
|
|
496
|
+
withLogo: ["\u4F7F\u7528", "\u767B\u5F55"],
|
|
499
497
|
close: "\u5173\u95ED",
|
|
500
498
|
loading: "\u52A0\u8F7D\u4E2D",
|
|
501
|
-
qrAlt: "\u767B\u5F55\u4E8C\u7EF4\u7801 \u2014 \u8BF7\u7528\u624B\u673A\u4E0A\u7684
|
|
502
|
-
steps: ["\u5728\u624B\u673A\u4E0A\u6253\u5F00
|
|
499
|
+
qrAlt: "\u767B\u5F55\u4E8C\u7EF4\u7801 \u2014 \u8BF7\u7528\u624B\u673A\u4E0A\u7684 e-ID Mongolia \u5E94\u7528\u626B\u63CF",
|
|
500
|
+
steps: ["\u5728\u624B\u673A\u4E0A\u6253\u5F00 e-ID Mongolia \u5E94\u7528", "\u626B\u63CF\u4E8C\u7EF4\u7801", "\u8F93\u5165 PIN1"],
|
|
503
501
|
vcLabel: "\u9A8C\u8BC1\u7801",
|
|
504
502
|
or: "\u6216",
|
|
505
503
|
usePush: "\u4F7F\u7528\u767B\u8BB0\u53F7\u767B\u5F55",
|
|
@@ -535,10 +533,11 @@ var T = {
|
|
|
535
533
|
fr: {
|
|
536
534
|
button: "Se connecter avec e-ID",
|
|
537
535
|
title: "Se connecter avec e-ID",
|
|
536
|
+
withLogo: ["Se connecter avec ", ""],
|
|
538
537
|
close: "Fermer",
|
|
539
538
|
loading: "Chargement",
|
|
540
|
-
qrAlt: "Code QR de connexion \u2014 scannez-le avec l'application
|
|
541
|
-
steps: ["Ouvrez l'application
|
|
539
|
+
qrAlt: "Code QR de connexion \u2014 scannez-le avec l'application e-ID Mongolia sur votre t\xE9l\xE9phone",
|
|
540
|
+
steps: ["Ouvrez l'application e-ID Mongolia sur votre t\xE9l\xE9phone", "Scannez le code QR", "Saisissez votre PIN1"],
|
|
542
541
|
vcLabel: "Code de v\xE9rification",
|
|
543
542
|
or: "ou",
|
|
544
543
|
usePush: "Se connecter avec le num\xE9ro national d'identit\xE9",
|
|
@@ -574,10 +573,11 @@ var T = {
|
|
|
574
573
|
es: {
|
|
575
574
|
button: "Iniciar sesi\xF3n con e-ID",
|
|
576
575
|
title: "Iniciar sesi\xF3n con e-ID",
|
|
576
|
+
withLogo: ["Iniciar sesi\xF3n con ", ""],
|
|
577
577
|
close: "Cerrar",
|
|
578
578
|
loading: "Cargando",
|
|
579
|
-
qrAlt: "C\xF3digo QR de inicio de sesi\xF3n: escan\xE9elo con la aplicaci\xF3n
|
|
580
|
-
steps: ["Abra la aplicaci\xF3n
|
|
579
|
+
qrAlt: "C\xF3digo QR de inicio de sesi\xF3n: escan\xE9elo con la aplicaci\xF3n e-ID Mongolia de su tel\xE9fono",
|
|
580
|
+
steps: ["Abra la aplicaci\xF3n e-ID Mongolia en su tel\xE9fono", "Escanee el c\xF3digo QR", "Introduzca su PIN1"],
|
|
581
581
|
vcLabel: "C\xF3digo de verificaci\xF3n",
|
|
582
582
|
or: "o",
|
|
583
583
|
usePush: "Iniciar sesi\xF3n con el documento nacional de identidad",
|
|
@@ -613,10 +613,11 @@ var T = {
|
|
|
613
613
|
ar: {
|
|
614
614
|
button: "\u062A\u0633\u062C\u064A\u0644 \u0627\u0644\u062F\u062E\u0648\u0644 \u0639\u0628\u0631 e-ID",
|
|
615
615
|
title: "\u062A\u0633\u062C\u064A\u0644 \u0627\u0644\u062F\u062E\u0648\u0644 \u0639\u0628\u0631 e-ID",
|
|
616
|
+
withLogo: ["\u062A\u0633\u062C\u064A\u0644 \u0627\u0644\u062F\u062E\u0648\u0644 \u0639\u0628\u0631 ", ""],
|
|
616
617
|
close: "\u0625\u063A\u0644\u0627\u0642",
|
|
617
618
|
loading: "\u062C\u0627\u0631\u064D \u0627\u0644\u062A\u062D\u0645\u064A\u0644",
|
|
618
|
-
qrAlt: "\u0631\u0645\u0632 QR \u0644\u062A\u0633\u062C\u064A\u0644 \u0627\u0644\u062F\u062E\u0648\u0644 \u2014 \u0627\u0645\u0633\u062D\u0647 \u0628\u062A\u0637\u0628\u064A\u0642
|
|
619
|
-
steps: ["\u0627\u0641\u062A\u062D \u062A\u0637\u0628\u064A\u0642
|
|
619
|
+
qrAlt: "\u0631\u0645\u0632 QR \u0644\u062A\u0633\u062C\u064A\u0644 \u0627\u0644\u062F\u062E\u0648\u0644 \u2014 \u0627\u0645\u0633\u062D\u0647 \u0628\u062A\u0637\u0628\u064A\u0642 e-ID Mongolia \u0639\u0644\u0649 \u0647\u0627\u062A\u0641\u0643",
|
|
620
|
+
steps: ["\u0627\u0641\u062A\u062D \u062A\u0637\u0628\u064A\u0642 e-ID Mongolia \u0639\u0644\u0649 \u0647\u0627\u062A\u0641\u0643", "\u0627\u0645\u0633\u062D \u0631\u0645\u0632 QR", "\u0623\u062F\u062E\u0644 PIN1"],
|
|
620
621
|
vcLabel: "\u0631\u0645\u0632 \u0627\u0644\u062A\u062D\u0642\u0642",
|
|
621
622
|
or: "\u0623\u0648",
|
|
622
623
|
usePush: "\u062A\u0633\u062C\u064A\u0644 \u0627\u0644\u062F\u062E\u0648\u0644 \u0628\u0631\u0642\u0645 \u0627\u0644\u0647\u0648\u064A\u0629 \u0627\u0644\u0648\u0637\u0646\u064A\u0629",
|
|
@@ -694,8 +695,6 @@ button, input { font-family: inherit; }
|
|
|
694
695
|
`;
|
|
695
696
|
var DARK_CSS = `:host { color-scheme: dark;
|
|
696
697
|
${darkVars} }
|
|
697
|
-
.logo .m-a { fill: #fff; }
|
|
698
|
-
.logo .m-l { stroke: #0A1631; }
|
|
699
698
|
`;
|
|
700
699
|
var CSS_REST = `
|
|
701
700
|
*, *::before, *::after { box-sizing: border-box; }
|
|
@@ -713,10 +712,9 @@ h2, p, ol { margin: 0; }
|
|
|
713
712
|
.btn-outline:hover { background: var(--_eid-bg-muted); }
|
|
714
713
|
.btn-sm { width: auto; min-height: 36px; padding: 0 14px; font-size: 0.8125rem; }
|
|
715
714
|
.trigger { width: auto; }
|
|
716
|
-
.
|
|
717
|
-
.logo
|
|
718
|
-
.
|
|
719
|
-
.trigger.icon-only .logo { width: 24px; height: 24px; }
|
|
715
|
+
.brand { display: inline-flex; align-items: center; gap: 6px; }
|
|
716
|
+
.logo { display: block; flex: none; height: 16px; width: auto; aspect-ratio: 3840 / 1372; fill: currentColor; }
|
|
717
|
+
.trigger.icon-only .logo { height: 12px; }
|
|
720
718
|
.trigger.icon-only { width: 44px; height: 44px; padding: 0; }
|
|
721
719
|
.backdrop { position: fixed; inset: 0; z-index: 2147483000; background: hsl(222 47% 11% / 0.5); display: flex; align-items: center;
|
|
722
720
|
justify-content: center; padding: 16px; overflow-y: auto; }
|
|
@@ -726,7 +724,7 @@ dialog.dialog::backdrop { background: hsl(222 47% 11% / 0.5); }
|
|
|
726
724
|
color: var(--_eid-fg); border: 1px solid var(--_eid-border); border-radius: var(--_eid-radius-lg); padding: 24px; font-size: 0.875rem; line-height: 1.5rem; }
|
|
727
725
|
@media (max-width: 639px) { .dialog { padding: 16px; } }
|
|
728
726
|
.head { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
|
|
729
|
-
.head .logo {
|
|
727
|
+
.head .logo { height: 20px; }
|
|
730
728
|
.head h2 { flex: 1; font-size: 1.125rem; line-height: 1.75rem; font-weight: 600; }
|
|
731
729
|
.x { width: 36px; height: 36px; border: 0; border-radius: var(--_eid-radius); background: transparent; color: var(--_eid-fg-muted); cursor: pointer; font-size: 1.25rem; line-height: 1; }
|
|
732
730
|
.x:hover { background: var(--_eid-bg-muted); color: var(--_eid-fg); }
|
|
@@ -802,11 +800,10 @@ function logo(attrs = {}) {
|
|
|
802
800
|
for (const [k, v] of Object.entries({ class: "logo", viewBox: EID_LOGO_VIEWBOX, "aria-hidden": "true", focusable: "false", ...attrs })) {
|
|
803
801
|
svg.setAttribute(k, v);
|
|
804
802
|
}
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
}
|
|
803
|
+
const path = document.createElementNS(NS, "path");
|
|
804
|
+
path.setAttribute("transform", EID_LOGO_TRANSFORM);
|
|
805
|
+
path.setAttribute("d", EID_LOGO_PATH);
|
|
806
|
+
svg.append(path);
|
|
810
807
|
return svg;
|
|
811
808
|
}
|
|
812
809
|
function chevron() {
|
|
@@ -900,16 +897,29 @@ var EidLoginButton = class extends Base {
|
|
|
900
897
|
console.warn('<eid-login-button>: icon="none" \u0431\u0430 \u0442\u0435\u043A\u0441\u0442\u0433\u04AF\u0439 (variant="icon" \u044D\u0441\u0432\u044D\u043B label="") \u2014 \u0430\u043D\u0445\u0434\u0430\u0433\u0447 \u0442\u0435\u043A\u0441\u0442\u0438\u0439\u0433 \u0445\u0430\u0440\u0443\u0443\u043B\u0430\u0432.');
|
|
901
898
|
}
|
|
902
899
|
}
|
|
900
|
+
const brand = hasIcon && !iconOnly && !label;
|
|
903
901
|
const nodes = [];
|
|
904
|
-
if (
|
|
905
|
-
|
|
902
|
+
if (brand) nodes.push(this.brand({ part: "icon" }, { part: "label" }));
|
|
903
|
+
else {
|
|
904
|
+
if (hasIcon) nodes.push(logo({ part: "icon" }));
|
|
905
|
+
if (!iconOnly) nodes.push(el("span", { part: "label" }, text));
|
|
906
|
+
}
|
|
906
907
|
this.trigger.replaceChildren(...nodes);
|
|
907
908
|
this.trigger.classList.toggle("icon-only", iconOnly);
|
|
908
909
|
this.trigger.setAttribute("dir", this.uiDir);
|
|
909
|
-
const aria = this.getAttribute("aria-label") || (iconOnly ? text : null);
|
|
910
|
+
const aria = this.getAttribute("aria-label") || (iconOnly || brand ? text : null);
|
|
910
911
|
if (aria) this.trigger.setAttribute("aria-label", aria);
|
|
911
912
|
else this.trigger.removeAttribute("aria-label");
|
|
912
913
|
}
|
|
914
|
+
/** Лого + i18n-ийн өмнөх/дараах текст. Лого aria-hidden — дуудагч бүтэн нэрийг aria-label-аар өгнө. */
|
|
915
|
+
brand(logoAttrs = {}, textAttrs = {}) {
|
|
916
|
+
const [pre, post] = this.t.withLogo;
|
|
917
|
+
const box = el("span", { class: "brand" });
|
|
918
|
+
if (pre) box.append(el("span", textAttrs, pre));
|
|
919
|
+
box.append(logo(logoAttrs));
|
|
920
|
+
if (post) box.append(el("span", textAttrs, post));
|
|
921
|
+
return box;
|
|
922
|
+
}
|
|
913
923
|
disconnectedCallback() {
|
|
914
924
|
this.close();
|
|
915
925
|
this.themeObs?.disconnect();
|
|
@@ -958,8 +968,9 @@ var EidLoginButton = class extends Base {
|
|
|
958
968
|
const head = el("div", { class: "head" });
|
|
959
969
|
const x = el("button", { type: "button", class: "x", "aria-label": this.t.close }, "\xD7");
|
|
960
970
|
x.addEventListener("click", () => this.close());
|
|
961
|
-
const h2 = el("h2", { id: "eid-title"
|
|
962
|
-
|
|
971
|
+
const h2 = el("h2", { id: "eid-title", "aria-label": this.t.title });
|
|
972
|
+
h2.append(this.brand());
|
|
973
|
+
head.append(h2, x);
|
|
963
974
|
this.body = el("div");
|
|
964
975
|
this.live = el("p", { class: "sr-only", "aria-live": "polite" });
|
|
965
976
|
dlg.append(head, this.body, this.live);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gerege-systems/eid-mongolia-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.40.0",
|
|
4
4
|
"description": "e-ID Mongolia Relying Party SDK — иргэнээр утсаар нь нэвтрэлт ба хууль ёсны цахим гарын үсэг (RP-API v3, Smart-ID нийцтэй).",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|