@nanahoshi/mona-ui 0.23.2 → 0.24.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/fesm2022/nanahoshi-mona-ui-auto-complete.mjs +2 -0
- package/fesm2022/nanahoshi-mona-ui-breadcrumb.mjs +2 -0
- package/fesm2022/nanahoshi-mona-ui-button-group.mjs +2 -0
- package/fesm2022/nanahoshi-mona-ui-calendar.mjs +15 -10
- package/fesm2022/nanahoshi-mona-ui-card.mjs +2 -0
- package/fesm2022/nanahoshi-mona-ui-chart.mjs +4 -2
- package/fesm2022/nanahoshi-mona-ui-chip.mjs +2 -0
- package/fesm2022/nanahoshi-mona-ui-color-gradient.mjs +8 -3
- package/fesm2022/nanahoshi-mona-ui-color-palette.mjs +2 -0
- package/fesm2022/nanahoshi-mona-ui-color-picker.mjs +2 -0
- package/fesm2022/nanahoshi-mona-ui-combo-box.mjs +2 -0
- package/fesm2022/nanahoshi-mona-ui-date-picker.mjs +2 -0
- package/fesm2022/nanahoshi-mona-ui-datetime-picker.mjs +2 -0
- package/fesm2022/nanahoshi-mona-ui-dialog.mjs +2 -0
- package/fesm2022/nanahoshi-mona-ui-dropdown-list.mjs +2 -0
- package/fesm2022/nanahoshi-mona-ui-dropdowns.mjs +8 -3
- package/fesm2022/nanahoshi-mona-ui-editor.mjs +8 -3
- package/fesm2022/nanahoshi-mona-ui-filter.mjs +3 -1
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-footer-row.component-CIMXz60d.mjs → nanahoshi-mona-ui-grid-grid-footer-row.component-CnPhVIr4.mjs} +2 -2
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-list.component-CpeheGXU.mjs → nanahoshi-mona-ui-grid-grid-list.component-DxY6bfTX.mjs} +4 -4
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-row.component-B_5ay_Nz.mjs → nanahoshi-mona-ui-grid-grid-row.component-CaO5Lae6.mjs} +3 -3
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-virtual-list.component-BzKywU5b.mjs → nanahoshi-mona-ui-grid-grid-virtual-list.component-jNYtqg5B.mjs} +4 -4
- package/fesm2022/{nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-IewqeT4m.mjs → nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-9FtfCutf.mjs} +18 -13
- package/fesm2022/nanahoshi-mona-ui-grid.mjs +1 -1
- package/fesm2022/nanahoshi-mona-ui-i18n-icu.mjs +888 -0
- package/fesm2022/nanahoshi-mona-ui-i18n.mjs +398 -116
- package/fesm2022/nanahoshi-mona-ui-internal-list.mjs +2 -0
- package/fesm2022/nanahoshi-mona-ui-internal-tree.mjs +2 -0
- package/fesm2022/nanahoshi-mona-ui-list-box.mjs +2 -0
- package/fesm2022/nanahoshi-mona-ui-locales-ar-sa.mjs +401 -0
- package/fesm2022/nanahoshi-mona-ui-locales-de-de.mjs +399 -0
- package/fesm2022/nanahoshi-mona-ui-locales-es-es.mjs +399 -0
- package/fesm2022/nanahoshi-mona-ui-locales-fr-fr.mjs +399 -0
- package/fesm2022/nanahoshi-mona-ui-locales-id-id.mjs +397 -0
- package/fesm2022/nanahoshi-mona-ui-locales-it-it.mjs +399 -0
- package/fesm2022/nanahoshi-mona-ui-locales-ja-jp.mjs +397 -0
- package/fesm2022/nanahoshi-mona-ui-locales-ko-kr.mjs +397 -0
- package/fesm2022/nanahoshi-mona-ui-locales-pt-br.mjs +399 -0
- package/fesm2022/nanahoshi-mona-ui-locales-ru-ru.mjs +401 -0
- package/fesm2022/nanahoshi-mona-ui-locales-tr-tr.mjs +397 -0
- package/fesm2022/nanahoshi-mona-ui-locales-zh-cn.mjs +397 -0
- package/fesm2022/nanahoshi-mona-ui-locales-zh-tw.mjs +397 -0
- package/fesm2022/nanahoshi-mona-ui-locales.mjs +77 -4988
- package/fesm2022/nanahoshi-mona-ui-multi-select.mjs +7 -2
- package/fesm2022/nanahoshi-mona-ui-notification.mjs +19 -2
- package/fesm2022/nanahoshi-mona-ui-numeric-text-box.mjs +299 -167
- package/fesm2022/nanahoshi-mona-ui-otp-input.mjs +2 -0
- package/fesm2022/nanahoshi-mona-ui-pager.mjs +13 -8
- package/fesm2022/nanahoshi-mona-ui-popup.mjs +15 -1
- package/fesm2022/nanahoshi-mona-ui-rating.mjs +7 -2
- package/fesm2022/nanahoshi-mona-ui-scroll-view.mjs +9 -4
- package/fesm2022/nanahoshi-mona-ui-sheet.mjs +2 -0
- package/fesm2022/nanahoshi-mona-ui-slider.mjs +2 -0
- package/fesm2022/nanahoshi-mona-ui-spinner.mjs +2 -0
- package/fesm2022/nanahoshi-mona-ui-split-button.mjs +2 -0
- package/fesm2022/nanahoshi-mona-ui-splitter.mjs +2 -0
- package/fesm2022/nanahoshi-mona-ui-stepper.mjs +2 -0
- package/fesm2022/nanahoshi-mona-ui-tabs.mjs +2 -0
- package/fesm2022/nanahoshi-mona-ui-text-box.mjs +2 -0
- package/fesm2022/nanahoshi-mona-ui-time-picker.mjs +2 -0
- package/fesm2022/nanahoshi-mona-ui-time-selector.mjs +2 -0
- package/fesm2022/nanahoshi-mona-ui-window.mjs +2 -0
- package/i18n/catalogs/en-US.messages.json +373 -0
- package/i18n/icu/package.json +4 -0
- package/locales/ar-sa/ar-sa.messages.json +373 -0
- package/locales/ar-sa/package.json +4 -0
- package/locales/de-de/de-de.messages.json +373 -0
- package/locales/de-de/package.json +4 -0
- package/locales/es-es/es-es.messages.json +373 -0
- package/locales/es-es/package.json +4 -0
- package/locales/fr-fr/fr-fr.messages.json +373 -0
- package/locales/fr-fr/package.json +4 -0
- package/locales/id-id/id-id.messages.json +373 -0
- package/locales/id-id/package.json +4 -0
- package/locales/it-it/it-it.messages.json +373 -0
- package/locales/it-it/package.json +4 -0
- package/locales/ja-jp/ja-jp.messages.json +373 -0
- package/locales/ja-jp/package.json +4 -0
- package/locales/ko-kr/ko-kr.messages.json +373 -0
- package/locales/ko-kr/package.json +4 -0
- package/locales/pt-br/package.json +4 -0
- package/locales/pt-br/pt-br.messages.json +373 -0
- package/locales/ru-ru/package.json +4 -0
- package/locales/ru-ru/ru-ru.messages.json +373 -0
- package/locales/tr-tr/package.json +4 -0
- package/locales/tr-tr/tr-tr.messages.json +373 -0
- package/locales/zh-cn/package.json +4 -0
- package/locales/zh-cn/zh-cn.messages.json +373 -0
- package/locales/zh-tw/package.json +4 -0
- package/locales/zh-tw/zh-tw.messages.json +373 -0
- package/package.json +111 -53
- package/types/nanahoshi-mona-ui-i18n-icu.d.ts +74 -0
- package/types/nanahoshi-mona-ui-i18n.d.ts +139 -9
- package/types/nanahoshi-mona-ui-locales-ar-sa.d.ts +379 -0
- package/types/nanahoshi-mona-ui-locales-de-de.d.ts +379 -0
- package/types/nanahoshi-mona-ui-locales-es-es.d.ts +379 -0
- package/types/nanahoshi-mona-ui-locales-fr-fr.d.ts +379 -0
- package/types/nanahoshi-mona-ui-locales-id-id.d.ts +379 -0
- package/types/nanahoshi-mona-ui-locales-it-it.d.ts +379 -0
- package/types/nanahoshi-mona-ui-locales-ja-jp.d.ts +379 -0
- package/types/nanahoshi-mona-ui-locales-ko-kr.d.ts +379 -0
- package/types/nanahoshi-mona-ui-locales-pt-br.d.ts +379 -0
- package/types/nanahoshi-mona-ui-locales-ru-ru.d.ts +379 -0
- package/types/nanahoshi-mona-ui-locales-tr-tr.d.ts +379 -0
- package/types/nanahoshi-mona-ui-locales-zh-cn.d.ts +379 -0
- package/types/nanahoshi-mona-ui-locales-zh-tw.d.ts +379 -0
- package/types/nanahoshi-mona-ui-locales.d.ts +30 -4915
- package/types/nanahoshi-mona-ui-notification.d.ts +1 -0
- package/types/nanahoshi-mona-ui-numeric-text-box.d.ts +113 -37
|
@@ -6,7 +6,7 @@ import { none } from '@mirei/ts-collections';
|
|
|
6
6
|
import { ChipComponent } from '@nanahoshi/mona-ui/chip';
|
|
7
7
|
import * as i1 from '@nanahoshi/mona-ui/dropdowns';
|
|
8
8
|
import { DropdownService, DropdownFooterTemplateDirective, DropdownGroupHeaderTemplateDirective, DropdownHeaderTemplateDirective, DropdownItemTemplateDirective, dropdownPopupThemeVariants, DropdownNoDataTemplateDirective, DropdownPrefixTemplateDirective, DropdownLiveRegionDirective, DropdownDataInputToken, DROPDOWN_POPUP_INPUT_TOKEN, DropdownDataHandlerDirective, DropdownListPopupHandlerDirective } from '@nanahoshi/mona-ui/dropdowns';
|
|
9
|
-
import { MonaI18nService } from '@nanahoshi/mona-ui/i18n';
|
|
9
|
+
import { formatNumber, MonaI18nService } from '@nanahoshi/mona-ui/i18n';
|
|
10
10
|
import { themeControlSurfaceClasses, createElementControlId, restoreOverlayScroll, rxFromResize } from '@nanahoshi/mona-ui/internal';
|
|
11
11
|
import { IndicatorIconComponent } from '@nanahoshi/mona-ui/internal/indicator-icon';
|
|
12
12
|
import { ListService, ListComponent, ListGroupHeaderTemplateDirective, ListItemTemplateDirective, ListFooterTemplateDirective, ListHeaderTemplateDirective, ListNoDataTemplateDirective } from '@nanahoshi/mona-ui/internal/list';
|
|
@@ -25,9 +25,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
25
25
|
}]
|
|
26
26
|
}] });
|
|
27
27
|
|
|
28
|
+
// Generated from i18n/catalogs/en-US.messages.json by scripts/generate-locale-catalogs.ts. Do not edit.
|
|
29
|
+
// Edit the JSON file and run `npm run generate:locale-catalogs`.
|
|
30
|
+
function localizeNumber(value, options) {
|
|
31
|
+
return formatNumber(value, "en-US", options);
|
|
32
|
+
}
|
|
28
33
|
const MULTI_SELECT_DEFAULT_MESSAGES = {
|
|
29
34
|
clear: "Clear",
|
|
30
|
-
itemsCount: (count) =>
|
|
35
|
+
itemsCount: (count) => count === 1 ? `+ ${localizeNumber(count)} item` : `+ ${localizeNumber(count)} items`
|
|
31
36
|
};
|
|
32
37
|
|
|
33
38
|
class MultiSelectService {
|
|
@@ -73,6 +73,8 @@ const notificationTextThemeVariants = cva(`
|
|
|
73
73
|
text-sm text-foreground
|
|
74
74
|
`);
|
|
75
75
|
|
|
76
|
+
// Generated from i18n/catalogs/en-US.messages.json by scripts/generate-locale-catalogs.ts. Do not edit.
|
|
77
|
+
// Edit the JSON file and run `npm run generate:locale-catalogs`.
|
|
76
78
|
const NOTIFICATION_DEFAULT_MESSAGES = {
|
|
77
79
|
close: "Close",
|
|
78
80
|
error: "Error",
|
|
@@ -260,9 +262,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
260
262
|
class NotificationService {
|
|
261
263
|
#appRef;
|
|
262
264
|
#document;
|
|
265
|
+
#pendingTimeouts;
|
|
263
266
|
constructor() {
|
|
264
267
|
this.#appRef = inject(ApplicationRef);
|
|
265
268
|
this.#document = inject(DOCUMENT$1);
|
|
269
|
+
this.#pendingTimeouts = new Set();
|
|
266
270
|
this.notificationContainerMap = new Map();
|
|
267
271
|
this.notificationContainerSubscriptions = {
|
|
268
272
|
bottom: null,
|
|
@@ -273,6 +277,12 @@ class NotificationService {
|
|
|
273
277
|
topright: null
|
|
274
278
|
};
|
|
275
279
|
this.initialize();
|
|
280
|
+
// The ApplicationRef is destroyed with the same injector, so a timeout firing afterwards would detach
|
|
281
|
+
// views from a destroyed ApplicationRef.
|
|
282
|
+
inject(DestroyRef).onDestroy(() => {
|
|
283
|
+
this.#pendingTimeouts.forEach(handle => window.clearTimeout(handle));
|
|
284
|
+
this.#pendingTimeouts.clear();
|
|
285
|
+
});
|
|
276
286
|
}
|
|
277
287
|
hide(id) {
|
|
278
288
|
const notificationData = this.getNotificationDataById(id);
|
|
@@ -326,7 +336,7 @@ class NotificationService {
|
|
|
326
336
|
host.appendChild(notificationContainerComponent.location.nativeElement);
|
|
327
337
|
this.#appRef.attachView(notificationContainerComponent.hostView);
|
|
328
338
|
notificationContainerComponent.changeDetectorRef.detectChanges();
|
|
329
|
-
|
|
339
|
+
this.scheduleTimeout(() => {
|
|
330
340
|
containerSubject.next(notificationContainerComponent);
|
|
331
341
|
});
|
|
332
342
|
return containerSubject;
|
|
@@ -427,7 +437,7 @@ class NotificationService {
|
|
|
427
437
|
container.componentRef = null;
|
|
428
438
|
container.subscription = undefined;
|
|
429
439
|
this.notificationContainerSubscriptions[position] = null;
|
|
430
|
-
|
|
440
|
+
this.scheduleTimeout(() => {
|
|
431
441
|
if (componentRefToDestroy) {
|
|
432
442
|
this.#appRef.detachView(componentRefToDestroy.hostView);
|
|
433
443
|
componentRefToDestroy.destroy();
|
|
@@ -435,6 +445,13 @@ class NotificationService {
|
|
|
435
445
|
}, 300);
|
|
436
446
|
}
|
|
437
447
|
}
|
|
448
|
+
scheduleTimeout(callback, delay) {
|
|
449
|
+
const handle = window.setTimeout(() => {
|
|
450
|
+
this.#pendingTimeouts.delete(handle);
|
|
451
|
+
callback();
|
|
452
|
+
}, delay);
|
|
453
|
+
this.#pendingTimeouts.add(handle);
|
|
454
|
+
}
|
|
438
455
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: NotificationService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
439
456
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: NotificationService, providedIn: "root" }); }
|
|
440
457
|
}
|