@nanahoshi/mona-ui 0.33.0 → 0.35.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/alert/package.json +4 -0
- package/badge/package.json +4 -0
- package/docs/alert.md +219 -0
- package/docs/api/alert.md +78 -0
- package/docs/api/avatar.md +25 -0
- package/docs/api/badge.md +24 -0
- package/docs/api/common.md +2 -2
- package/docs/api/grid.md +46 -13
- package/docs/api/i18n.md +45 -0
- package/docs/api/locales.md +14 -14
- package/docs/api/multi-select.md +2 -0
- package/docs/api/separator.md +23 -0
- package/docs/api/toolbar.md +81 -0
- package/docs/avatar.md +108 -6
- package/docs/badge.md +181 -0
- package/docs/grid-columns.md +121 -17
- package/docs/grid-state-export.md +24 -7
- package/docs/grid.md +1 -1
- package/docs/multi-select.md +54 -0
- package/docs/separator.md +147 -0
- package/docs/sidebar-menus.md +1 -1
- package/docs/toolbar.md +327 -0
- package/fesm2022/nanahoshi-mona-ui-alert.mjs +422 -0
- package/fesm2022/nanahoshi-mona-ui-avatar.mjs +182 -3
- package/fesm2022/nanahoshi-mona-ui-badge.mjs +273 -0
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-colgroup.component-C62HvK-w.mjs → nanahoshi-mona-ui-grid-grid-colgroup.component-Lv3GunpV.mjs} +2 -2
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-footer-row.component-BpsJwMkQ.mjs → nanahoshi-mona-ui-grid-grid-footer-row.component-BYH9XbCV.mjs} +8 -3
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-list.component-BVpGUjA7.mjs → nanahoshi-mona-ui-grid-grid-list.component-S2iCn8TV.mjs} +10 -6
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-row.component-D0T8kfdm.mjs → nanahoshi-mona-ui-grid-grid-row.component-BUJvgihp.mjs} +21 -6
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-virtual-list.component-5D2BjGx4.mjs → nanahoshi-mona-ui-grid-grid-virtual-list.component-Wndy-_Bt.mjs} +5 -5
- package/fesm2022/{nanahoshi-mona-ui-grid-grid.styles-62LTuPhD.mjs → nanahoshi-mona-ui-grid-grid.styles-aPD3c2A6.mjs} +228 -16
- package/fesm2022/nanahoshi-mona-ui-grid.mjs +422 -29
- package/fesm2022/nanahoshi-mona-ui-i18n-icu.mjs +10 -0
- package/fesm2022/nanahoshi-mona-ui-locales-ar-sa.mjs +3 -0
- package/fesm2022/nanahoshi-mona-ui-locales-de-de.mjs +3 -0
- package/fesm2022/nanahoshi-mona-ui-locales-es-es.mjs +3 -0
- package/fesm2022/nanahoshi-mona-ui-locales-fr-fr.mjs +3 -0
- package/fesm2022/nanahoshi-mona-ui-locales-id-id.mjs +3 -0
- package/fesm2022/nanahoshi-mona-ui-locales-it-it.mjs +3 -0
- package/fesm2022/nanahoshi-mona-ui-locales-ja-jp.mjs +3 -0
- package/fesm2022/nanahoshi-mona-ui-locales-ko-kr.mjs +3 -0
- package/fesm2022/nanahoshi-mona-ui-locales-pl-pl.mjs +3 -0
- package/fesm2022/nanahoshi-mona-ui-locales-pt-br.mjs +3 -0
- package/fesm2022/nanahoshi-mona-ui-locales-ru-ru.mjs +3 -0
- package/fesm2022/nanahoshi-mona-ui-locales-tr-tr.mjs +3 -0
- package/fesm2022/nanahoshi-mona-ui-locales-zh-cn.mjs +3 -0
- package/fesm2022/nanahoshi-mona-ui-locales-zh-tw.mjs +3 -0
- package/fesm2022/nanahoshi-mona-ui-multi-select.mjs +83 -2
- package/fesm2022/nanahoshi-mona-ui-separator.mjs +165 -0
- package/fesm2022/nanahoshi-mona-ui-sidebar.mjs +3 -3
- package/fesm2022/nanahoshi-mona-ui-toolbar.mjs +536 -0
- package/i18n/catalogs/en-US.messages.json +9 -0
- package/llms.txt +14 -6
- package/locales/ar-sa/ar-sa.messages.json +9 -0
- package/locales/de-de/de-de.messages.json +9 -0
- package/locales/es-es/es-es.messages.json +9 -0
- package/locales/fr-fr/fr-fr.messages.json +9 -0
- package/locales/id-id/id-id.messages.json +9 -0
- package/locales/it-it/it-it.messages.json +9 -0
- package/locales/ja-jp/ja-jp.messages.json +9 -0
- package/locales/ko-kr/ko-kr.messages.json +9 -0
- package/locales/pl-pl/pl-pl.messages.json +9 -0
- package/locales/pt-br/pt-br.messages.json +9 -0
- package/locales/ru-ru/ru-ru.messages.json +9 -0
- package/locales/tr-tr/tr-tr.messages.json +9 -0
- package/locales/zh-cn/zh-cn.messages.json +9 -0
- package/locales/zh-tw/zh-tw.messages.json +9 -0
- package/package.json +17 -1
- package/separator/package.json +4 -0
- package/toolbar/package.json +4 -0
- package/types/nanahoshi-mona-ui-alert.d.ts +144 -0
- package/types/nanahoshi-mona-ui-avatar.d.ts +66 -0
- package/types/nanahoshi-mona-ui-badge.d.ts +82 -0
- package/types/nanahoshi-mona-ui-grid.d.ts +142 -64
- package/types/nanahoshi-mona-ui-i18n.d.ts +24 -0
- package/types/nanahoshi-mona-ui-locales-ar-sa.d.ts +9 -0
- package/types/nanahoshi-mona-ui-locales-de-de.d.ts +9 -0
- package/types/nanahoshi-mona-ui-locales-es-es.d.ts +9 -0
- package/types/nanahoshi-mona-ui-locales-fr-fr.d.ts +9 -0
- package/types/nanahoshi-mona-ui-locales-id-id.d.ts +9 -0
- package/types/nanahoshi-mona-ui-locales-it-it.d.ts +9 -0
- package/types/nanahoshi-mona-ui-locales-ja-jp.d.ts +9 -0
- package/types/nanahoshi-mona-ui-locales-ko-kr.d.ts +9 -0
- package/types/nanahoshi-mona-ui-locales-pl-pl.d.ts +9 -0
- package/types/nanahoshi-mona-ui-locales-pt-br.d.ts +9 -0
- package/types/nanahoshi-mona-ui-locales-ru-ru.d.ts +9 -0
- package/types/nanahoshi-mona-ui-locales-tr-tr.d.ts +9 -0
- package/types/nanahoshi-mona-ui-locales-zh-cn.d.ts +9 -0
- package/types/nanahoshi-mona-ui-locales-zh-tw.d.ts +9 -0
- package/types/nanahoshi-mona-ui-multi-select.d.ts +27 -0
- package/types/nanahoshi-mona-ui-separator.d.ts +66 -0
- package/types/nanahoshi-mona-ui-toolbar.d.ts +183 -0
|
@@ -1,7 +1,16 @@
|
|
|
1
1
|
import { isDevMode } from "@angular/core";
|
|
2
2
|
import { MONA_FALLBACK_LOCALE_ID, canonicalizeLocaleId, formatNumber, tryCanonicalizeLocaleId } from "@nanahoshi/mona-ui/i18n";
|
|
3
3
|
const MONA_MESSAGE_PARAMETERS = {
|
|
4
|
+
alert: { dismissLabel: [{
|
|
5
|
+
name: "title",
|
|
6
|
+
optional: true,
|
|
7
|
+
type: "string"
|
|
8
|
+
}] },
|
|
4
9
|
autoComplete: { clear: null },
|
|
10
|
+
avatar: { moreLabel: [{
|
|
11
|
+
name: "count",
|
|
12
|
+
type: "number"
|
|
13
|
+
}] },
|
|
5
14
|
breadcrumb: {
|
|
6
15
|
breadcrumb: null,
|
|
7
16
|
showFullPath: null
|
|
@@ -1088,6 +1097,7 @@ const MONA_MESSAGE_PARAMETERS = {
|
|
|
1088
1097
|
set: null,
|
|
1089
1098
|
timeSelector: null
|
|
1090
1099
|
},
|
|
1100
|
+
toolbar: { moreLabel: null },
|
|
1091
1101
|
treeView: {
|
|
1092
1102
|
collapse: null,
|
|
1093
1103
|
expand: null,
|
|
@@ -10,7 +10,9 @@ const MONA_AR_SA_LOCALE = {
|
|
|
10
10
|
direction: "rtl",
|
|
11
11
|
id: "ar-SA",
|
|
12
12
|
messages: {
|
|
13
|
+
alert: { dismissLabel: (title) => title ? `إغلاق ${title}` : "إغلاق التنبيه" },
|
|
13
14
|
autoComplete: { clear: "مسح" },
|
|
15
|
+
avatar: { moreLabel: (count) => `و${localizeNumber(count)} آخرون` },
|
|
14
16
|
breadcrumb: {
|
|
15
17
|
breadcrumb: "مسار التنقل",
|
|
16
18
|
showFullPath: "إظهار المسار الكامل"
|
|
@@ -624,6 +626,7 @@ const MONA_AR_SA_LOCALE = {
|
|
|
624
626
|
set: "تعيين",
|
|
625
627
|
timeSelector: "منتقي الوقت"
|
|
626
628
|
},
|
|
629
|
+
toolbar: { moreLabel: "المزيد" },
|
|
627
630
|
treeView: {
|
|
628
631
|
collapse: "طي",
|
|
629
632
|
expand: "توسيع",
|
|
@@ -10,7 +10,9 @@ const MONA_DE_DE_LOCALE = {
|
|
|
10
10
|
direction: "ltr",
|
|
11
11
|
id: "de-DE",
|
|
12
12
|
messages: {
|
|
13
|
+
alert: { dismissLabel: (title) => title ? `${title} schließen` : "Hinweis schließen" },
|
|
13
14
|
autoComplete: { clear: "Leeren" },
|
|
15
|
+
avatar: { moreLabel: (count) => `${localizeNumber(count)} weitere` },
|
|
14
16
|
breadcrumb: {
|
|
15
17
|
breadcrumb: "Breadcrumb-Navigation",
|
|
16
18
|
showFullPath: "Vollständigen Pfad anzeigen"
|
|
@@ -568,6 +570,7 @@ const MONA_DE_DE_LOCALE = {
|
|
|
568
570
|
set: "Übernehmen",
|
|
569
571
|
timeSelector: "Zeitauswahl"
|
|
570
572
|
},
|
|
573
|
+
toolbar: { moreLabel: "Mehr" },
|
|
571
574
|
treeView: {
|
|
572
575
|
collapse: "Einklappen",
|
|
573
576
|
expand: "Erweitern",
|
|
@@ -10,7 +10,9 @@ const MONA_ES_ES_LOCALE = {
|
|
|
10
10
|
direction: "ltr",
|
|
11
11
|
id: "es-ES",
|
|
12
12
|
messages: {
|
|
13
|
+
alert: { dismissLabel: (title) => title ? `Descartar ${title}` : "Descartar aviso" },
|
|
13
14
|
autoComplete: { clear: "Limpiar" },
|
|
15
|
+
avatar: { moreLabel: (count) => `${localizeNumber(count)} más` },
|
|
14
16
|
breadcrumb: {
|
|
15
17
|
breadcrumb: "Ruta de navegación",
|
|
16
18
|
showFullPath: "Mostrar la ruta completa"
|
|
@@ -574,6 +576,7 @@ const MONA_ES_ES_LOCALE = {
|
|
|
574
576
|
set: "Establecer",
|
|
575
577
|
timeSelector: "Selector de hora"
|
|
576
578
|
},
|
|
579
|
+
toolbar: { moreLabel: "Más" },
|
|
577
580
|
treeView: {
|
|
578
581
|
collapse: "Contraer",
|
|
579
582
|
expand: "Expandir",
|
|
@@ -10,7 +10,9 @@ const MONA_FR_FR_LOCALE = {
|
|
|
10
10
|
direction: "ltr",
|
|
11
11
|
id: "fr-FR",
|
|
12
12
|
messages: {
|
|
13
|
+
alert: { dismissLabel: (title) => title ? `Fermer ${title}` : "Fermer l’alerte" },
|
|
13
14
|
autoComplete: { clear: "Effacer" },
|
|
15
|
+
avatar: { moreLabel: (count) => count === 1 ? `${localizeNumber(count)} autre` : `${localizeNumber(count)} autres` },
|
|
14
16
|
breadcrumb: {
|
|
15
17
|
breadcrumb: "Fil d’Ariane",
|
|
16
18
|
showFullPath: "Afficher le chemin complet"
|
|
@@ -574,6 +576,7 @@ const MONA_FR_FR_LOCALE = {
|
|
|
574
576
|
set: "Valider",
|
|
575
577
|
timeSelector: "Sélecteur d’heure"
|
|
576
578
|
},
|
|
579
|
+
toolbar: { moreLabel: "Plus" },
|
|
577
580
|
treeView: {
|
|
578
581
|
collapse: "Réduire",
|
|
579
582
|
expand: "Développer",
|
|
@@ -6,7 +6,9 @@ const MONA_ID_ID_LOCALE = {
|
|
|
6
6
|
direction: "ltr",
|
|
7
7
|
id: "id-ID",
|
|
8
8
|
messages: {
|
|
9
|
+
alert: { dismissLabel: (title) => title ? `Tutup ${title}` : "Tutup peringatan" },
|
|
9
10
|
autoComplete: { clear: "Bersihkan" },
|
|
11
|
+
avatar: { moreLabel: (count) => `${localizeNumber(count)} lainnya` },
|
|
10
12
|
breadcrumb: {
|
|
11
13
|
breadcrumb: "Navigasi remah roti",
|
|
12
14
|
showFullPath: "Tampilkan jalur lengkap"
|
|
@@ -543,6 +545,7 @@ const MONA_ID_ID_LOCALE = {
|
|
|
543
545
|
set: "Atur",
|
|
544
546
|
timeSelector: "Pemilih waktu"
|
|
545
547
|
},
|
|
548
|
+
toolbar: { moreLabel: "Lainnya" },
|
|
546
549
|
treeView: {
|
|
547
550
|
collapse: "Ciutkan",
|
|
548
551
|
expand: "Perluas",
|
|
@@ -10,7 +10,9 @@ const MONA_IT_IT_LOCALE = {
|
|
|
10
10
|
direction: "ltr",
|
|
11
11
|
id: "it-IT",
|
|
12
12
|
messages: {
|
|
13
|
+
alert: { dismissLabel: (title) => title ? `Chiudi ${title}` : "Chiudi avviso" },
|
|
13
14
|
autoComplete: { clear: "Cancella" },
|
|
15
|
+
avatar: { moreLabel: (count) => count === 1 ? "un altro" : `altri ${localizeNumber(count)}` },
|
|
14
16
|
breadcrumb: {
|
|
15
17
|
breadcrumb: "Percorso di navigazione",
|
|
16
18
|
showFullPath: "Mostra il percorso completo"
|
|
@@ -574,6 +576,7 @@ const MONA_IT_IT_LOCALE = {
|
|
|
574
576
|
set: "Imposta",
|
|
575
577
|
timeSelector: "Selettore ora"
|
|
576
578
|
},
|
|
579
|
+
toolbar: { moreLabel: "Altro" },
|
|
577
580
|
treeView: {
|
|
578
581
|
collapse: "Comprimi",
|
|
579
582
|
expand: "Espandi",
|
|
@@ -6,7 +6,9 @@ const MONA_JA_JP_LOCALE = {
|
|
|
6
6
|
direction: "ltr",
|
|
7
7
|
id: "ja-JP",
|
|
8
8
|
messages: {
|
|
9
|
+
alert: { dismissLabel: (title) => title ? `${title}を閉じる` : "閉じる" },
|
|
9
10
|
autoComplete: { clear: "クリア" },
|
|
11
|
+
avatar: { moreLabel: (count) => `ほか${localizeNumber(count)}` },
|
|
10
12
|
breadcrumb: {
|
|
11
13
|
breadcrumb: "パンくずリスト",
|
|
12
14
|
showFullPath: "パス全体を表示"
|
|
@@ -543,6 +545,7 @@ const MONA_JA_JP_LOCALE = {
|
|
|
543
545
|
set: "設定",
|
|
544
546
|
timeSelector: "時刻選択"
|
|
545
547
|
},
|
|
548
|
+
toolbar: { moreLabel: "その他" },
|
|
546
549
|
treeView: {
|
|
547
550
|
collapse: "折りたたむ",
|
|
548
551
|
expand: "展開",
|
|
@@ -6,7 +6,9 @@ const MONA_KO_KR_LOCALE = {
|
|
|
6
6
|
direction: "ltr",
|
|
7
7
|
id: "ko-KR",
|
|
8
8
|
messages: {
|
|
9
|
+
alert: { dismissLabel: (title) => title ? `${title} 닫기` : "닫기" },
|
|
9
10
|
autoComplete: { clear: "지우기" },
|
|
11
|
+
avatar: { moreLabel: (count) => `외 ${localizeNumber(count)}` },
|
|
10
12
|
breadcrumb: {
|
|
11
13
|
breadcrumb: "이동 경로",
|
|
12
14
|
showFullPath: "전체 경로 표시"
|
|
@@ -543,6 +545,7 @@ const MONA_KO_KR_LOCALE = {
|
|
|
543
545
|
set: "설정",
|
|
544
546
|
timeSelector: "시간 선택기"
|
|
545
547
|
},
|
|
548
|
+
toolbar: { moreLabel: "더 보기" },
|
|
546
549
|
treeView: {
|
|
547
550
|
collapse: "축소",
|
|
548
551
|
expand: "확장",
|
|
@@ -10,7 +10,9 @@ const MONA_PL_PL_LOCALE = {
|
|
|
10
10
|
direction: "ltr",
|
|
11
11
|
id: "pl-PL",
|
|
12
12
|
messages: {
|
|
13
|
+
alert: { dismissLabel: (title) => title ? `Zamknij: ${title}` : "Zamknij alert" },
|
|
13
14
|
autoComplete: { clear: "Wyczyść" },
|
|
15
|
+
avatar: { moreLabel: (count) => `jeszcze ${localizeNumber(count)}` },
|
|
14
16
|
breadcrumb: {
|
|
15
17
|
breadcrumb: "Ścieżka nawigacyjna",
|
|
16
18
|
showFullPath: "Pokaż pełną ścieżkę"
|
|
@@ -642,6 +644,7 @@ const MONA_PL_PL_LOCALE = {
|
|
|
642
644
|
set: "Ustaw",
|
|
643
645
|
timeSelector: "Selektor godziny"
|
|
644
646
|
},
|
|
647
|
+
toolbar: { moreLabel: "Więcej" },
|
|
645
648
|
treeView: {
|
|
646
649
|
collapse: "Zwiń",
|
|
647
650
|
expand: "Rozwiń",
|
|
@@ -10,7 +10,9 @@ const MONA_PT_BR_LOCALE = {
|
|
|
10
10
|
direction: "ltr",
|
|
11
11
|
id: "pt-BR",
|
|
12
12
|
messages: {
|
|
13
|
+
alert: { dismissLabel: (title) => title ? `Fechar ${title}` : "Fechar alerta" },
|
|
13
14
|
autoComplete: { clear: "Limpar" },
|
|
15
|
+
avatar: { moreLabel: (count) => `mais ${localizeNumber(count)}` },
|
|
14
16
|
breadcrumb: {
|
|
15
17
|
breadcrumb: "Trilha de navegação",
|
|
16
18
|
showFullPath: "Mostrar caminho completo"
|
|
@@ -574,6 +576,7 @@ const MONA_PT_BR_LOCALE = {
|
|
|
574
576
|
set: "Definir",
|
|
575
577
|
timeSelector: "Seletor de hora"
|
|
576
578
|
},
|
|
579
|
+
toolbar: { moreLabel: "Mais" },
|
|
577
580
|
treeView: {
|
|
578
581
|
collapse: "Recolher",
|
|
579
582
|
expand: "Expandir",
|
|
@@ -10,7 +10,9 @@ const MONA_RU_RU_LOCALE = {
|
|
|
10
10
|
direction: "ltr",
|
|
11
11
|
id: "ru-RU",
|
|
12
12
|
messages: {
|
|
13
|
+
alert: { dismissLabel: (title) => title ? `Закрыть: ${title}` : "Закрыть уведомление" },
|
|
13
14
|
autoComplete: { clear: "Очистить" },
|
|
15
|
+
avatar: { moreLabel: (count) => `ещё ${localizeNumber(count)}` },
|
|
14
16
|
breadcrumb: {
|
|
15
17
|
breadcrumb: "Навигационная цепочка",
|
|
16
18
|
showFullPath: "Показать полный путь"
|
|
@@ -627,6 +629,7 @@ const MONA_RU_RU_LOCALE = {
|
|
|
627
629
|
set: "Установить",
|
|
628
630
|
timeSelector: "Выбор времени"
|
|
629
631
|
},
|
|
632
|
+
toolbar: { moreLabel: "Ещё" },
|
|
630
633
|
treeView: {
|
|
631
634
|
collapse: "Свернуть",
|
|
632
635
|
expand: "Развернуть",
|
|
@@ -10,7 +10,9 @@ const MONA_TR_TR_LOCALE = {
|
|
|
10
10
|
direction: "ltr",
|
|
11
11
|
id: "tr-TR",
|
|
12
12
|
messages: {
|
|
13
|
+
alert: { dismissLabel: (title) => title ? `Kapat: ${title}` : "Uyarıyı kapat" },
|
|
13
14
|
autoComplete: { clear: "Temizle" },
|
|
15
|
+
avatar: { moreLabel: (count) => `${localizeNumber(count)} daha` },
|
|
14
16
|
breadcrumb: {
|
|
15
17
|
breadcrumb: "İçerik haritası",
|
|
16
18
|
showFullPath: "Tam yolu göster"
|
|
@@ -559,6 +561,7 @@ const MONA_TR_TR_LOCALE = {
|
|
|
559
561
|
set: "Ayarla",
|
|
560
562
|
timeSelector: "Saat seçici"
|
|
561
563
|
},
|
|
564
|
+
toolbar: { moreLabel: "Diğer" },
|
|
562
565
|
treeView: {
|
|
563
566
|
collapse: "Daralt",
|
|
564
567
|
expand: "Genişlet",
|
|
@@ -6,7 +6,9 @@ const MONA_ZH_CN_LOCALE = {
|
|
|
6
6
|
direction: "ltr",
|
|
7
7
|
id: "zh-CN",
|
|
8
8
|
messages: {
|
|
9
|
+
alert: { dismissLabel: (title) => title ? `关闭${title}` : "关闭提示" },
|
|
9
10
|
autoComplete: { clear: "清除" },
|
|
11
|
+
avatar: { moreLabel: (count) => `还有 ${localizeNumber(count)} 个` },
|
|
10
12
|
breadcrumb: {
|
|
11
13
|
breadcrumb: "面包屑导航",
|
|
12
14
|
showFullPath: "显示完整路径"
|
|
@@ -543,6 +545,7 @@ const MONA_ZH_CN_LOCALE = {
|
|
|
543
545
|
set: "设置",
|
|
544
546
|
timeSelector: "时间选择器"
|
|
545
547
|
},
|
|
548
|
+
toolbar: { moreLabel: "更多" },
|
|
546
549
|
treeView: {
|
|
547
550
|
collapse: "折叠",
|
|
548
551
|
expand: "展开",
|
|
@@ -6,7 +6,9 @@ const MONA_ZH_TW_LOCALE = {
|
|
|
6
6
|
direction: "ltr",
|
|
7
7
|
id: "zh-TW",
|
|
8
8
|
messages: {
|
|
9
|
+
alert: { dismissLabel: (title) => title ? `關閉${title}` : "關閉提示" },
|
|
9
10
|
autoComplete: { clear: "清除" },
|
|
11
|
+
avatar: { moreLabel: (count) => `還有 ${localizeNumber(count)} 個` },
|
|
10
12
|
breadcrumb: {
|
|
11
13
|
breadcrumb: "階層連結導航",
|
|
12
14
|
showFullPath: "顯示完整路徑"
|
|
@@ -543,6 +545,7 @@ const MONA_ZH_TW_LOCALE = {
|
|
|
543
545
|
set: "設定",
|
|
544
546
|
timeSelector: "時間選取器"
|
|
545
547
|
},
|
|
548
|
+
toolbar: { moreLabel: "更多" },
|
|
546
549
|
treeView: {
|
|
547
550
|
collapse: "摺疊",
|
|
548
551
|
expand: "展開",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { NgTemplateOutlet } from "@angular/common";
|
|
2
2
|
import * as i0 from "@angular/core";
|
|
3
|
-
import { Component, DestroyRef, Directive, ElementRef, Injectable, TemplateRef, afterNextRender, booleanAttribute, computed, contentChild, effect, forwardRef, inject, input, model, output, signal, untracked, viewChild } from "@angular/core";
|
|
3
|
+
import { Component, DestroyRef, Directive, ElementRef, Injectable, TemplateRef, afterNextRender, booleanAttribute, computed, contentChild, effect, forwardRef, inject, input, isDevMode, model, output, signal, untracked, viewChild } from "@angular/core";
|
|
4
4
|
import { takeUntilDestroyed } from "@angular/core/rxjs-interop";
|
|
5
5
|
import { none } from "@mirei/ts-collections";
|
|
6
6
|
import { CHIP_DEFAULT_MESSAGES, ChipComponent } from "@nanahoshi/mona-ui/chip";
|
|
@@ -147,6 +147,7 @@ var MultiSelectComponent = class MultiSelectComponent {
|
|
|
147
147
|
#listService;
|
|
148
148
|
#multiSelectService;
|
|
149
149
|
#popupRef;
|
|
150
|
+
#navigatedByArrows;
|
|
150
151
|
constructor() {
|
|
151
152
|
this.#destroyRef = inject(DestroyRef);
|
|
152
153
|
this.#dropdownService = inject(DropdownService);
|
|
@@ -162,6 +163,7 @@ var MultiSelectComponent = class MultiSelectComponent {
|
|
|
162
163
|
this.#listService = inject(ListService);
|
|
163
164
|
this.#multiSelectService = inject(MultiSelectService);
|
|
164
165
|
this.#popupRef = this.#dropdownService.popupRef;
|
|
166
|
+
this.#navigatedByArrows = false;
|
|
165
167
|
this.activeDescendant = computed(() => {
|
|
166
168
|
const highlightedItem = this.#listService.highlightedItem();
|
|
167
169
|
return highlightedItem ? highlightedItem.uid : null;
|
|
@@ -261,6 +263,10 @@ var MultiSelectComponent = class MultiSelectComponent {
|
|
|
261
263
|
if (tagCount < 0) return itemCount;
|
|
262
264
|
return tagCount;
|
|
263
265
|
}, ...ngDevMode ? [{ debugName: "visibleTagCount" }] : /* istanbul ignore next */ []);
|
|
266
|
+
this.allowCustomValue = input(false, {
|
|
267
|
+
...ngDevMode ? { debugName: "allowCustomValue" } : /* istanbul ignore next */ {},
|
|
268
|
+
transform: booleanAttribute
|
|
269
|
+
});
|
|
264
270
|
this.ariaDescribedBy = input("", {
|
|
265
271
|
...ngDevMode ? { debugName: "ariaDescribedBy" } : /* istanbul ignore next */ {},
|
|
266
272
|
alias: "aria-describedby"
|
|
@@ -328,6 +334,7 @@ var MultiSelectComponent = class MultiSelectComponent {
|
|
|
328
334
|
alias: "class"
|
|
329
335
|
});
|
|
330
336
|
this.value = model([], ...ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []);
|
|
337
|
+
this.valueAdd = output();
|
|
331
338
|
this.valueField = input(...ngDevMode ? [void 0, { debugName: "valueField" }] : /* istanbul ignore next */ []);
|
|
332
339
|
this.valuePrimitive = input(false, {
|
|
333
340
|
...ngDevMode ? { debugName: "valuePrimitive" } : /* istanbul ignore next */ {},
|
|
@@ -337,6 +344,7 @@ var MultiSelectComponent = class MultiSelectComponent {
|
|
|
337
344
|
this.initialize();
|
|
338
345
|
this.setEventListeners();
|
|
339
346
|
this.setSubscriptions();
|
|
347
|
+
this.warnIfCustomValueHasNoFilter();
|
|
340
348
|
} });
|
|
341
349
|
effect(() => {
|
|
342
350
|
const popupTemplate = this.popupTemplate();
|
|
@@ -355,6 +363,21 @@ var MultiSelectComponent = class MultiSelectComponent {
|
|
|
355
363
|
const checkboxVisible = this.checkboxes();
|
|
356
364
|
untracked(() => this.#listService.setSelectableOptions({ checkboxes: checkboxVisible }));
|
|
357
365
|
});
|
|
366
|
+
effect((onCleanup) => {
|
|
367
|
+
const popupElement = this.#popupRef()?.overlayRef.overlayElement;
|
|
368
|
+
if (popupElement == null) return;
|
|
369
|
+
this.#navigatedByArrows = false;
|
|
370
|
+
const onKeydown = (event) => this.handlePopupKeydown(event);
|
|
371
|
+
const onInput = () => {
|
|
372
|
+
this.#navigatedByArrows = false;
|
|
373
|
+
};
|
|
374
|
+
popupElement.addEventListener("keydown", onKeydown, true);
|
|
375
|
+
popupElement.addEventListener("input", onInput, true);
|
|
376
|
+
onCleanup(() => {
|
|
377
|
+
popupElement.removeEventListener("keydown", onKeydown, true);
|
|
378
|
+
popupElement.removeEventListener("input", onInput, true);
|
|
379
|
+
});
|
|
380
|
+
});
|
|
358
381
|
}
|
|
359
382
|
focus(options) {
|
|
360
383
|
this.#hostElementRef.nativeElement.focus(options);
|
|
@@ -399,6 +422,21 @@ var MultiSelectComponent = class MultiSelectComponent {
|
|
|
399
422
|
this.#listService.clearSelections();
|
|
400
423
|
this.focus();
|
|
401
424
|
}
|
|
425
|
+
addCustomValue(input, text) {
|
|
426
|
+
const caseSensitive = this.#listService.filterableOptions().caseSensitive;
|
|
427
|
+
const match = this.#listService.getMatchingFilteredItem(text);
|
|
428
|
+
const matchText = match ? this.#listService.getItemText(match) : null;
|
|
429
|
+
const exact = matchText != null && (caseSensitive ? matchText === text : matchText.toLowerCase() === text.toLowerCase());
|
|
430
|
+
if (match && exact) {
|
|
431
|
+
if (!this.#listService.isSelected(match)) {
|
|
432
|
+
this.#listService.selectItem(match);
|
|
433
|
+
this.updateValue(this.getSelectedControlValues());
|
|
434
|
+
}
|
|
435
|
+
} else this.valueAdd.emit(text);
|
|
436
|
+
input.value = "";
|
|
437
|
+
input.dispatchEvent(new Event("input", { bubbles: true }));
|
|
438
|
+
if (this.autoClose()) this.#popupRef()?.close();
|
|
439
|
+
}
|
|
402
440
|
getSelectedControlValues() {
|
|
403
441
|
return this.selectedListItems().select((item) => {
|
|
404
442
|
return this.valuePrimitive() ? this.#listService.getDataItemValue(item.data) : item.data;
|
|
@@ -411,6 +449,26 @@ var MultiSelectComponent = class MultiSelectComponent {
|
|
|
411
449
|
}
|
|
412
450
|
this.toggleHighlightedItem();
|
|
413
451
|
}
|
|
452
|
+
handlePopupKeydown(event) {
|
|
453
|
+
if (event.key === "ArrowDown" || event.key === "ArrowUp") {
|
|
454
|
+
this.#navigatedByArrows = true;
|
|
455
|
+
return;
|
|
456
|
+
}
|
|
457
|
+
const input = event.target;
|
|
458
|
+
if (event.key !== "Enter" || event.isComposing || event.keyCode === 229 || !(input instanceof HTMLInputElement)) return;
|
|
459
|
+
const text = input.value.trim();
|
|
460
|
+
const highlightedItem = this.#listService.highlightedItem();
|
|
461
|
+
if (this.allowCustomValue() && text !== "" && !(this.#navigatedByArrows && highlightedItem != null)) {
|
|
462
|
+
event.preventDefault();
|
|
463
|
+
event.stopPropagation();
|
|
464
|
+
this.addCustomValue(input, text);
|
|
465
|
+
return;
|
|
466
|
+
}
|
|
467
|
+
if (highlightedItem == null) {
|
|
468
|
+
event.preventDefault();
|
|
469
|
+
event.stopPropagation();
|
|
470
|
+
}
|
|
471
|
+
}
|
|
414
472
|
handlePopupPositionUpdate() {
|
|
415
473
|
const popupRef = this.#popupRef();
|
|
416
474
|
if (!popupRef) return;
|
|
@@ -475,6 +533,9 @@ var MultiSelectComponent = class MultiSelectComponent {
|
|
|
475
533
|
updateValue(value) {
|
|
476
534
|
this.value.set(value);
|
|
477
535
|
}
|
|
536
|
+
warnIfCustomValueHasNoFilter() {
|
|
537
|
+
if (isDevMode() && this.allowCustomValue() && !this.#listService.filterableOptions().enabled) console.warn("[Mona MultiSelect] allowCustomValue needs monaDropDownFilterable: custom values are typed in its filter box.", this.#hostElementRef.nativeElement);
|
|
538
|
+
}
|
|
478
539
|
static {
|
|
479
540
|
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
480
541
|
minVersion: "12.0.0",
|
|
@@ -493,6 +554,13 @@ var MultiSelectComponent = class MultiSelectComponent {
|
|
|
493
554
|
isStandalone: true,
|
|
494
555
|
selector: "mona-multi-select",
|
|
495
556
|
inputs: {
|
|
557
|
+
allowCustomValue: {
|
|
558
|
+
classPropertyName: "allowCustomValue",
|
|
559
|
+
publicName: "allowCustomValue",
|
|
560
|
+
isSignal: true,
|
|
561
|
+
isRequired: false,
|
|
562
|
+
transformFunction: null
|
|
563
|
+
},
|
|
496
564
|
ariaDescribedBy: {
|
|
497
565
|
classPropertyName: "ariaDescribedBy",
|
|
498
566
|
publicName: "aria-describedby",
|
|
@@ -675,7 +743,8 @@ var MultiSelectComponent = class MultiSelectComponent {
|
|
|
675
743
|
open: "open",
|
|
676
744
|
opened: "opened",
|
|
677
745
|
touch: "touch",
|
|
678
|
-
value: "valueChange"
|
|
746
|
+
value: "valueChange",
|
|
747
|
+
valueAdd: "valueAdd"
|
|
679
748
|
},
|
|
680
749
|
host: {
|
|
681
750
|
listeners: { "focusout": "onFocusOut($event)" },
|
|
@@ -1013,6 +1082,14 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
1013
1082
|
isSignal: true
|
|
1014
1083
|
}]
|
|
1015
1084
|
}],
|
|
1085
|
+
allowCustomValue: [{
|
|
1086
|
+
type: i0.Input,
|
|
1087
|
+
args: [{
|
|
1088
|
+
isSignal: true,
|
|
1089
|
+
alias: "allowCustomValue",
|
|
1090
|
+
required: false
|
|
1091
|
+
}]
|
|
1092
|
+
}],
|
|
1016
1093
|
ariaDescribedBy: [{
|
|
1017
1094
|
type: i0.Input,
|
|
1018
1095
|
args: [{
|
|
@@ -1220,6 +1297,10 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
1220
1297
|
type: i0.Output,
|
|
1221
1298
|
args: ["valueChange"]
|
|
1222
1299
|
}],
|
|
1300
|
+
valueAdd: [{
|
|
1301
|
+
type: i0.Output,
|
|
1302
|
+
args: ["valueAdd"]
|
|
1303
|
+
}],
|
|
1223
1304
|
valueField: [{
|
|
1224
1305
|
type: i0.Input,
|
|
1225
1306
|
args: [{
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { Component, booleanAttribute, computed, input } from "@angular/core";
|
|
3
|
+
import { classInputToClass } from "@nanahoshi/mona-ui/common";
|
|
4
|
+
import { twMerge } from "tailwind-merge";
|
|
5
|
+
import { cva } from "class-variance-authority";
|
|
6
|
+
const LINE_CLASSES = "bg-border forced-colors:bg-[CanvasText]";
|
|
7
|
+
const separatorThemeVariants = cva("shrink-0", {
|
|
8
|
+
variants: {
|
|
9
|
+
labelled: {
|
|
10
|
+
false: LINE_CLASSES,
|
|
11
|
+
true: "flex w-full items-center gap-3 text-xs text-muted-foreground"
|
|
12
|
+
},
|
|
13
|
+
orientation: {
|
|
14
|
+
horizontal: "",
|
|
15
|
+
vertical: ""
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
compoundVariants: [{
|
|
19
|
+
labelled: false,
|
|
20
|
+
orientation: "horizontal",
|
|
21
|
+
class: "block h-px w-full"
|
|
22
|
+
}, {
|
|
23
|
+
labelled: false,
|
|
24
|
+
orientation: "vertical",
|
|
25
|
+
class: "inline-block w-px self-stretch"
|
|
26
|
+
}],
|
|
27
|
+
defaultVariants: {
|
|
28
|
+
labelled: false,
|
|
29
|
+
orientation: "horizontal"
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
const SEPARATOR_LABEL_LINE_CLASSES = `h-px flex-1 ${LINE_CLASSES}`;
|
|
33
|
+
var SeparatorComponent = class SeparatorComponent {
|
|
34
|
+
constructor() {
|
|
35
|
+
this.baseClass = computed(() => twMerge(separatorThemeVariants({
|
|
36
|
+
labelled: this.labelled(),
|
|
37
|
+
orientation: this.labelled() ? "horizontal" : this.orientation()
|
|
38
|
+
}), this.userClass()), ...ngDevMode ? [{ debugName: "baseClass" }] : /* istanbul ignore next */ []);
|
|
39
|
+
this.labelled = computed(() => this.label() !== "", ...ngDevMode ? [{ debugName: "labelled" }] : /* istanbul ignore next */ []);
|
|
40
|
+
this.lineClass = SEPARATOR_LABEL_LINE_CLASSES;
|
|
41
|
+
this.role = computed(() => this.decorative() || this.labelled() ? null : "separator", ...ngDevMode ? [{ debugName: "role" }] : /* istanbul ignore next */ []);
|
|
42
|
+
this.decorative = input(false, {
|
|
43
|
+
...ngDevMode ? { debugName: "decorative" } : /* istanbul ignore next */ {},
|
|
44
|
+
transform: booleanAttribute
|
|
45
|
+
});
|
|
46
|
+
this.label = input("", ...ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []);
|
|
47
|
+
this.orientation = input("horizontal", ...ngDevMode ? [{ debugName: "orientation" }] : /* istanbul ignore next */ []);
|
|
48
|
+
this.userClass = input("", {
|
|
49
|
+
...ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {},
|
|
50
|
+
alias: "class",
|
|
51
|
+
transform: (value) => classInputToClass(value)
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
static {
|
|
55
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
56
|
+
minVersion: "12.0.0",
|
|
57
|
+
version: "22.2.6",
|
|
58
|
+
ngImport: i0,
|
|
59
|
+
type: SeparatorComponent,
|
|
60
|
+
deps: [],
|
|
61
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
static {
|
|
65
|
+
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
66
|
+
minVersion: "17.0.0",
|
|
67
|
+
version: "22.2.6",
|
|
68
|
+
type: SeparatorComponent,
|
|
69
|
+
isStandalone: true,
|
|
70
|
+
selector: "mona-separator",
|
|
71
|
+
inputs: {
|
|
72
|
+
decorative: {
|
|
73
|
+
classPropertyName: "decorative",
|
|
74
|
+
publicName: "decorative",
|
|
75
|
+
isSignal: true,
|
|
76
|
+
isRequired: false,
|
|
77
|
+
transformFunction: null
|
|
78
|
+
},
|
|
79
|
+
label: {
|
|
80
|
+
classPropertyName: "label",
|
|
81
|
+
publicName: "label",
|
|
82
|
+
isSignal: true,
|
|
83
|
+
isRequired: false,
|
|
84
|
+
transformFunction: null
|
|
85
|
+
},
|
|
86
|
+
orientation: {
|
|
87
|
+
classPropertyName: "orientation",
|
|
88
|
+
publicName: "orientation",
|
|
89
|
+
isSignal: true,
|
|
90
|
+
isRequired: false,
|
|
91
|
+
transformFunction: null
|
|
92
|
+
},
|
|
93
|
+
userClass: {
|
|
94
|
+
classPropertyName: "userClass",
|
|
95
|
+
publicName: "class",
|
|
96
|
+
isSignal: true,
|
|
97
|
+
isRequired: false,
|
|
98
|
+
transformFunction: null
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
host: { properties: {
|
|
102
|
+
"attr.aria-orientation": "role() === 'separator' && orientation() === 'vertical' ? 'vertical' : null",
|
|
103
|
+
"attr.role": "role()",
|
|
104
|
+
"class": "baseClass()"
|
|
105
|
+
} },
|
|
106
|
+
ngImport: i0,
|
|
107
|
+
template: "@if (labelled()) {\n <span [class]=\"lineClass\" aria-hidden=\"true\"></span>\n <span>{{ label() }}</span>\n <span [class]=\"lineClass\" aria-hidden=\"true\"></span>\n}\n"
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
112
|
+
minVersion: "12.0.0",
|
|
113
|
+
version: "22.2.6",
|
|
114
|
+
ngImport: i0,
|
|
115
|
+
type: SeparatorComponent,
|
|
116
|
+
decorators: [{
|
|
117
|
+
type: Component,
|
|
118
|
+
args: [{
|
|
119
|
+
selector: "mona-separator",
|
|
120
|
+
host: {
|
|
121
|
+
"[attr.aria-orientation]": "role() === 'separator' && orientation() === 'vertical' ? 'vertical' : null",
|
|
122
|
+
"[attr.role]": "role()",
|
|
123
|
+
"[class]": "baseClass()"
|
|
124
|
+
},
|
|
125
|
+
template: "@if (labelled()) {\n <span [class]=\"lineClass\" aria-hidden=\"true\"></span>\n <span>{{ label() }}</span>\n <span [class]=\"lineClass\" aria-hidden=\"true\"></span>\n}\n"
|
|
126
|
+
}]
|
|
127
|
+
}],
|
|
128
|
+
propDecorators: {
|
|
129
|
+
decorative: [{
|
|
130
|
+
type: i0.Input,
|
|
131
|
+
args: [{
|
|
132
|
+
isSignal: true,
|
|
133
|
+
alias: "decorative",
|
|
134
|
+
required: false
|
|
135
|
+
}]
|
|
136
|
+
}],
|
|
137
|
+
label: [{
|
|
138
|
+
type: i0.Input,
|
|
139
|
+
args: [{
|
|
140
|
+
isSignal: true,
|
|
141
|
+
alias: "label",
|
|
142
|
+
required: false
|
|
143
|
+
}]
|
|
144
|
+
}],
|
|
145
|
+
orientation: [{
|
|
146
|
+
type: i0.Input,
|
|
147
|
+
args: [{
|
|
148
|
+
isSignal: true,
|
|
149
|
+
alias: "orientation",
|
|
150
|
+
required: false
|
|
151
|
+
}]
|
|
152
|
+
}],
|
|
153
|
+
userClass: [{
|
|
154
|
+
type: i0.Input,
|
|
155
|
+
args: [{
|
|
156
|
+
isSignal: true,
|
|
157
|
+
alias: "class",
|
|
158
|
+
required: false
|
|
159
|
+
}]
|
|
160
|
+
}]
|
|
161
|
+
}
|
|
162
|
+
});
|
|
163
|
+
export { SeparatorComponent };
|
|
164
|
+
|
|
165
|
+
//# sourceMappingURL=nanahoshi-mona-ui-separator.mjs.map
|
|
@@ -10,6 +10,7 @@ import { TooltipDirective } from "@nanahoshi/mona-ui/tooltip";
|
|
|
10
10
|
import { twMerge } from "tailwind-merge";
|
|
11
11
|
import { isPlatformBrowser } from "@angular/common";
|
|
12
12
|
import { cva } from "class-variance-authority";
|
|
13
|
+
import { BADGE_BASE_CLASSES } from "@nanahoshi/mona-ui/badge";
|
|
13
14
|
import { SkeletonComponent } from "@nanahoshi/mona-ui/skeleton";
|
|
14
15
|
import * as i1$1 from "@nanahoshi/mona-ui/text-box";
|
|
15
16
|
import { TextBoxDirective } from "@nanahoshi/mona-ui/text-box";
|
|
@@ -613,9 +614,8 @@ const sidebarBackdropThemeVariants = cva(`
|
|
|
613
614
|
false: "opacity-0 pointer-events-none"
|
|
614
615
|
} } });
|
|
615
616
|
const sidebarMenuBadgeThemeVariants = cva(`
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
rounded-md text-xs font-medium tabular-nums
|
|
617
|
+
${BADGE_BASE_CLASSES}
|
|
618
|
+
ms-auto h-5 min-w-5 px-1.5 rounded-md text-xs
|
|
619
619
|
bg-(--color-sidebar-accent) text-(--color-sidebar-accent-foreground)
|
|
620
620
|
pointer-events-none select-none
|
|
621
621
|
`, { variants: { hidden: {
|