@nanahoshi/mona-ui 0.18.6 → 0.20.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 +71 -13
- package/THIRD_PARTY_NOTICES.md +60 -0
- package/fesm2022/nanahoshi-mona-ui-auto-complete.mjs +11 -3
- package/fesm2022/nanahoshi-mona-ui-breadcrumb.mjs +17 -9
- package/fesm2022/nanahoshi-mona-ui-button-group.mjs +16 -7
- package/fesm2022/nanahoshi-mona-ui-calendar.mjs +196 -101
- package/fesm2022/nanahoshi-mona-ui-card.mjs +22 -14
- package/fesm2022/nanahoshi-mona-ui-chart.mjs +78 -18
- package/fesm2022/nanahoshi-mona-ui-check-box.mjs +1 -1
- package/fesm2022/nanahoshi-mona-ui-chip.mjs +11 -3
- package/fesm2022/nanahoshi-mona-ui-circular-progress-bar.mjs +1 -2
- package/fesm2022/nanahoshi-mona-ui-color-gradient.mjs +23 -5
- package/fesm2022/nanahoshi-mona-ui-color-palette.mjs +49 -28
- package/fesm2022/nanahoshi-mona-ui-color-picker.mjs +42 -26
- package/fesm2022/nanahoshi-mona-ui-combo-box.mjs +11 -3
- package/fesm2022/nanahoshi-mona-ui-date-picker.mjs +39 -21
- package/fesm2022/nanahoshi-mona-ui-datetime-picker.mjs +88 -55
- package/fesm2022/nanahoshi-mona-ui-dialog.mjs +57 -25
- package/fesm2022/nanahoshi-mona-ui-dropdown-list.mjs +13 -5
- package/fesm2022/nanahoshi-mona-ui-dropdowns.mjs +17 -6
- package/fesm2022/nanahoshi-mona-ui-editor.mjs +178 -59
- package/fesm2022/nanahoshi-mona-ui-filter.mjs +137 -54
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-footer-cell.component-WEDbZ5vy.mjs → nanahoshi-mona-ui-grid-grid-footer-cell.component-BuybF7tX.mjs} +2 -2
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-footer-table-cell.directive-ibH5osCg.mjs → nanahoshi-mona-ui-grid-grid-footer-table-cell.directive-Dj-SaNzk.mjs} +2 -2
- package/fesm2022/nanahoshi-mona-ui-grid-grid-list.component-CYAm4l84.mjs +145 -0
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-toggle.component-hc-LeIb0.mjs → nanahoshi-mona-ui-grid-grid-toggle.component-B_Gm--X6.mjs} +46 -31
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-virtual-list.component-DYajpOb9.mjs → nanahoshi-mona-ui-grid-grid-virtual-list.component-X0X487Rm.mjs} +5 -5
- package/fesm2022/{nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-Pm8Fbp6M.mjs → nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-CyzJFQIy.mjs} +99 -42
- package/fesm2022/nanahoshi-mona-ui-grid.mjs +1 -1
- package/fesm2022/nanahoshi-mona-ui-i18n.mjs +4874 -0
- package/fesm2022/nanahoshi-mona-ui-internal-list.mjs +12 -4
- package/fesm2022/nanahoshi-mona-ui-internal-tree.mjs +48 -21
- package/fesm2022/nanahoshi-mona-ui-list-box.mjs +33 -18
- package/fesm2022/nanahoshi-mona-ui-list-view.mjs +10 -10
- package/fesm2022/nanahoshi-mona-ui-list.mjs +2 -0
- package/fesm2022/nanahoshi-mona-ui-locales.mjs +4973 -0
- package/fesm2022/nanahoshi-mona-ui-menubar.mjs +29 -16
- package/fesm2022/nanahoshi-mona-ui-multi-select.mjs +12 -3
- package/fesm2022/nanahoshi-mona-ui-notification.mjs +23 -18
- package/fesm2022/nanahoshi-mona-ui-numeric-text-box.mjs +211 -106
- package/fesm2022/nanahoshi-mona-ui-otp-input.mjs +14 -6
- package/fesm2022/nanahoshi-mona-ui-pager.mjs +66 -29
- package/fesm2022/nanahoshi-mona-ui-popup-menu.mjs +57 -46
- package/fesm2022/nanahoshi-mona-ui-popup.mjs +35 -15
- package/fesm2022/nanahoshi-mona-ui-progress-bar.mjs +38 -17
- package/fesm2022/nanahoshi-mona-ui-rating.mjs +25 -7
- package/fesm2022/nanahoshi-mona-ui-scroll-view.mjs +431 -101
- package/fesm2022/nanahoshi-mona-ui-segmented.mjs +1 -1
- package/fesm2022/nanahoshi-mona-ui-sheet.mjs +26 -8
- package/fesm2022/nanahoshi-mona-ui-sidebar.mjs +222 -28
- package/fesm2022/nanahoshi-mona-ui-slider.mjs +91 -36
- package/fesm2022/nanahoshi-mona-ui-spinner.mjs +34 -15
- package/fesm2022/nanahoshi-mona-ui-split-button.mjs +39 -23
- package/fesm2022/nanahoshi-mona-ui-splitter.mjs +50 -25
- package/fesm2022/nanahoshi-mona-ui-stepper.mjs +41 -14
- package/fesm2022/nanahoshi-mona-ui-switch.mjs +9 -9
- package/fesm2022/nanahoshi-mona-ui-tabs.mjs +74 -56
- package/fesm2022/nanahoshi-mona-ui-text-box.mjs +16 -8
- package/fesm2022/nanahoshi-mona-ui-time-picker.mjs +47 -24
- package/fesm2022/nanahoshi-mona-ui-time-selector.mjs +66 -27
- package/fesm2022/nanahoshi-mona-ui-tree-view.mjs +23 -15
- package/fesm2022/nanahoshi-mona-ui-window.mjs +71 -40
- package/i18n/package.json +4 -0
- package/locales/package.json +4 -0
- package/package.json +9 -1
- package/types/nanahoshi-mona-ui-auto-complete.d.ts +6 -1
- package/types/nanahoshi-mona-ui-breadcrumb.d.ts +9 -3
- package/types/nanahoshi-mona-ui-button-group.d.ts +9 -3
- package/types/nanahoshi-mona-ui-calendar.d.ts +29 -15
- package/types/nanahoshi-mona-ui-card.d.ts +8 -2
- package/types/nanahoshi-mona-ui-chart.d.ts +10 -1
- package/types/nanahoshi-mona-ui-chip.d.ts +7 -1
- package/types/nanahoshi-mona-ui-color-gradient.d.ts +6 -1
- package/types/nanahoshi-mona-ui-color-palette.d.ts +21 -10
- package/types/nanahoshi-mona-ui-color-picker.d.ts +30 -20
- package/types/nanahoshi-mona-ui-combo-box.d.ts +6 -1
- package/types/nanahoshi-mona-ui-date-picker.d.ts +14 -6
- package/types/nanahoshi-mona-ui-datetime-picker.d.ts +40 -12
- package/types/nanahoshi-mona-ui-dialog.d.ts +16 -7
- package/types/nanahoshi-mona-ui-dropdown-list.d.ts +6 -1
- package/types/nanahoshi-mona-ui-dropdowns.d.ts +4 -1
- package/types/nanahoshi-mona-ui-editor.d.ts +6 -1
- package/types/nanahoshi-mona-ui-filter.d.ts +16 -10
- package/types/nanahoshi-mona-ui-grid.d.ts +50 -2
- package/types/nanahoshi-mona-ui-i18n.d.ts +680 -0
- package/types/nanahoshi-mona-ui-internal-list.d.ts +7 -2
- package/types/nanahoshi-mona-ui-internal-tree.d.ts +7 -3
- package/types/nanahoshi-mona-ui-list-box.d.ts +9 -4
- package/types/nanahoshi-mona-ui-list-view.d.ts +6 -6
- package/types/nanahoshi-mona-ui-list.d.ts +1 -1
- package/types/nanahoshi-mona-ui-locales.d.ts +4889 -0
- package/types/nanahoshi-mona-ui-menubar.d.ts +59 -58
- package/types/nanahoshi-mona-ui-multi-select.d.ts +6 -1
- package/types/nanahoshi-mona-ui-notification.d.ts +11 -5
- package/types/nanahoshi-mona-ui-numeric-text-box.d.ts +24 -15
- package/types/nanahoshi-mona-ui-otp-input.d.ts +9 -3
- package/types/nanahoshi-mona-ui-pager.d.ts +20 -6
- package/types/nanahoshi-mona-ui-popup.d.ts +2 -1
- package/types/nanahoshi-mona-ui-progress-bar.d.ts +9 -7
- package/types/nanahoshi-mona-ui-rating.d.ts +19 -12
- package/types/nanahoshi-mona-ui-scroll-view.d.ts +34 -28
- package/types/nanahoshi-mona-ui-sheet.d.ts +8 -2
- package/types/nanahoshi-mona-ui-sidebar.d.ts +3 -0
- package/types/nanahoshi-mona-ui-slider.d.ts +44 -26
- package/types/nanahoshi-mona-ui-spinner.d.ts +13 -4
- package/types/nanahoshi-mona-ui-split-button.d.ts +62 -56
- package/types/nanahoshi-mona-ui-splitter.d.ts +9 -6
- package/types/nanahoshi-mona-ui-stepper.d.ts +10 -3
- package/types/nanahoshi-mona-ui-switch.d.ts +1 -1
- package/types/nanahoshi-mona-ui-tabs.d.ts +96 -35
- package/types/nanahoshi-mona-ui-text-box.d.ts +11 -5
- package/types/nanahoshi-mona-ui-time-picker.d.ts +11 -4
- package/types/nanahoshi-mona-ui-time-selector.d.ts +16 -5
- package/types/nanahoshi-mona-ui-tree-view.d.ts +15 -10
- package/types/nanahoshi-mona-ui-window.d.ts +26 -20
- package/fesm2022/nanahoshi-mona-ui-grid-grid-list.component-ZM3CneJ0.mjs +0 -145
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PreventableEvent } from '@nanahoshi/mona-ui/common';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
|
-
import { Directive, computed, input, inject, DestroyRef, signal, viewChild, viewChildren, ElementRef, model, output, afterRenderEffect, untracked, afterNextRender, Component, contentChild, TemplateRef, ChangeDetectionStrategy,
|
|
3
|
+
import { Directive, computed, input, inject, DestroyRef, signal, viewChild, viewChildren, ElementRef, model, output, afterRenderEffect, untracked, afterNextRender, Component, contentChild, TemplateRef, ChangeDetectionStrategy, linkedSignal, contentChildren } from '@angular/core';
|
|
4
4
|
import { NgTemplateOutlet } from '@angular/common';
|
|
5
5
|
import { firstOrDefault, select } from '@mirei/ts-collections';
|
|
6
6
|
import { twMerge } from 'tailwind-merge';
|
|
@@ -8,6 +8,7 @@ import { cva } from 'class-variance-authority';
|
|
|
8
8
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
9
9
|
import { LucideChevronDown, LucideChevronLeft, LucideChevronRight, LucideChevronUp, LucideX } from '@lucide/angular';
|
|
10
10
|
import { ButtonDirective } from '@nanahoshi/mona-ui/button';
|
|
11
|
+
import { injectComponentDirection, MonaI18nService } from '@nanahoshi/mona-ui/i18n';
|
|
11
12
|
import { Subject, switchMap, EMPTY, timer, interval, tap, asapScheduler } from 'rxjs';
|
|
12
13
|
import { createElementControlId } from '@nanahoshi/mona-ui/internal';
|
|
13
14
|
|
|
@@ -69,8 +70,8 @@ const tabListBaseThemeVariants = cva(`
|
|
|
69
70
|
position: {
|
|
70
71
|
top: "flex-row border-b border-border",
|
|
71
72
|
bottom: "flex-row border-t border-border",
|
|
72
|
-
left: "flex-col max-h-full min-h-0 border-
|
|
73
|
-
right: "flex-col max-h-full min-h-0 border-
|
|
73
|
+
left: "flex-col max-h-full min-h-0 border-e border-border",
|
|
74
|
+
right: "flex-col max-h-full min-h-0 border-s border-border"
|
|
74
75
|
}
|
|
75
76
|
},
|
|
76
77
|
defaultVariants: {
|
|
@@ -115,8 +116,8 @@ const tabListListItemThemeVariants = cva(`
|
|
|
115
116
|
position: {
|
|
116
117
|
top: "items-center justify-center whitespace-nowrap after:inset-x-0 after:bottom-0 after:h-[2px]",
|
|
117
118
|
bottom: "items-center justify-center whitespace-nowrap after:inset-x-0 after:top-0 after:h-[2px]",
|
|
118
|
-
left: "w-full items-center justify-start text-start after:inset-y-0 after:
|
|
119
|
-
right: "w-full items-center justify-start text-start after:inset-y-0 after:
|
|
119
|
+
left: "w-full items-center justify-start text-start after:inset-y-0 after:end-0 after:w-[2px]",
|
|
120
|
+
right: "w-full items-center justify-start text-start after:inset-y-0 after:start-0 after:w-[2px]"
|
|
120
121
|
},
|
|
121
122
|
size: {
|
|
122
123
|
small: "h-8 px-2 text-xs",
|
|
@@ -188,6 +189,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
188
189
|
}]
|
|
189
190
|
}], propDecorators: { active: [{ type: i0.Input, args: [{ isSignal: true, alias: "active", required: true }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: true }] }], position: [{ type: i0.Input, args: [{ isSignal: true, alias: "position", required: true }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: true }] }] } });
|
|
190
191
|
|
|
192
|
+
const TABS_DEFAULT_MESSAGES = {
|
|
193
|
+
closeTab: "Close tab",
|
|
194
|
+
scrollNext: "Scroll tabs next",
|
|
195
|
+
scrollPrevious: "Scroll tabs previous"
|
|
196
|
+
};
|
|
197
|
+
|
|
191
198
|
function getTabOrientation(position) {
|
|
192
199
|
return position === "left" || position === "right"
|
|
193
200
|
? "vertical"
|
|
@@ -196,14 +203,20 @@ function getTabOrientation(position) {
|
|
|
196
203
|
|
|
197
204
|
class TabListComponent {
|
|
198
205
|
#destroyRef;
|
|
206
|
+
#direction;
|
|
207
|
+
#i18n;
|
|
199
208
|
#keydown$;
|
|
200
209
|
#scrollIntent$;
|
|
201
210
|
#resizeObserver;
|
|
202
211
|
constructor() {
|
|
203
212
|
this.#destroyRef = inject(DestroyRef);
|
|
213
|
+
this.#direction = injectComponentDirection();
|
|
214
|
+
this.#i18n = inject(MonaI18nService);
|
|
204
215
|
this.#keydown$ = new Subject();
|
|
205
216
|
this.#scrollIntent$ = new Subject();
|
|
206
217
|
this.#resizeObserver = null;
|
|
218
|
+
this.isRtl = computed(() => this.#direction() === "rtl", /* @ts-ignore */
|
|
219
|
+
...(ngDevMode ? [{ debugName: "isRtl" }] : /* istanbul ignore next */ []));
|
|
207
220
|
this.baseClass = computed(() => {
|
|
208
221
|
return tabListBaseThemeVariants({ position: this.position() });
|
|
209
222
|
}, /* @ts-ignore */
|
|
@@ -216,6 +229,7 @@ class TabListComponent {
|
|
|
216
229
|
return tabListListWrapperThemeVariants();
|
|
217
230
|
}, /* @ts-ignore */
|
|
218
231
|
...(ngDevMode ? [{ debugName: "listWrapperClass" }] : /* istanbul ignore next */ []));
|
|
232
|
+
this.messages = this.#i18n.componentMessages("tabs", TABS_DEFAULT_MESSAGES);
|
|
219
233
|
this.orientation = computed(() => {
|
|
220
234
|
return getTabOrientation(this.position() ?? "top");
|
|
221
235
|
}, /* @ts-ignore */
|
|
@@ -316,6 +330,48 @@ class TabListComponent {
|
|
|
316
330
|
stopScrolling() {
|
|
317
331
|
this.#scrollIntent$.next(null);
|
|
318
332
|
}
|
|
333
|
+
activateTab(tab, event) {
|
|
334
|
+
const prevented = this.emitTabSelect(tab, event);
|
|
335
|
+
if (!prevented) {
|
|
336
|
+
this.selectTab(tab);
|
|
337
|
+
this.focusSelectedTab();
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
emitTabClose(tabItem, event) {
|
|
341
|
+
const selected = tabItem.id === this.selectedTabId();
|
|
342
|
+
const tabCloseEvent = new TabCloseEvent(tabItem.index, selected, event);
|
|
343
|
+
this.tabClose.emit(tabCloseEvent);
|
|
344
|
+
return tabCloseEvent.isDefaultPrevented();
|
|
345
|
+
}
|
|
346
|
+
emitTabSelect(tab, event) {
|
|
347
|
+
const selectEvent = new TabSelectEvent(tab.index, event);
|
|
348
|
+
this.tabSelect.emit(selectEvent);
|
|
349
|
+
return selectEvent.isDefaultPrevented();
|
|
350
|
+
}
|
|
351
|
+
focusTab(tab) {
|
|
352
|
+
const tabListItems = this.tabListItems();
|
|
353
|
+
const tabListItem = tabListItems.find(t => t.nativeElement.getAttribute("data-tab-id") === tab.id);
|
|
354
|
+
tabListItem?.nativeElement.focus();
|
|
355
|
+
}
|
|
356
|
+
getNavigationDirection(event) {
|
|
357
|
+
if (this.orientation() === "vertical") {
|
|
358
|
+
if (event.key === "ArrowUp") {
|
|
359
|
+
return "previous";
|
|
360
|
+
}
|
|
361
|
+
if (event.key === "ArrowDown") {
|
|
362
|
+
return "next";
|
|
363
|
+
}
|
|
364
|
+
return null;
|
|
365
|
+
}
|
|
366
|
+
const isRtl = this.isRtl();
|
|
367
|
+
if (event.key === "ArrowLeft") {
|
|
368
|
+
return isRtl ? "next" : "previous";
|
|
369
|
+
}
|
|
370
|
+
if (event.key === "ArrowRight") {
|
|
371
|
+
return isRtl ? "previous" : "next";
|
|
372
|
+
}
|
|
373
|
+
return null;
|
|
374
|
+
}
|
|
319
375
|
handleKeyboardEvents(event) {
|
|
320
376
|
const tabList = this.tabList();
|
|
321
377
|
const tabs = Array.from(tabList);
|
|
@@ -362,47 +418,6 @@ class TabListComponent {
|
|
|
362
418
|
break;
|
|
363
419
|
}
|
|
364
420
|
}
|
|
365
|
-
activateTab(tab, event) {
|
|
366
|
-
const prevented = this.emitTabSelect(tab, event);
|
|
367
|
-
if (!prevented) {
|
|
368
|
-
this.selectTab(tab);
|
|
369
|
-
this.focusSelectedTab();
|
|
370
|
-
}
|
|
371
|
-
}
|
|
372
|
-
emitTabClose(tabItem, event) {
|
|
373
|
-
const selected = tabItem.id === this.selectedTabId();
|
|
374
|
-
const tabCloseEvent = new TabCloseEvent(tabItem.index, selected, event);
|
|
375
|
-
this.tabClose.emit(tabCloseEvent);
|
|
376
|
-
return tabCloseEvent.isDefaultPrevented();
|
|
377
|
-
}
|
|
378
|
-
emitTabSelect(tab, event) {
|
|
379
|
-
const selectEvent = new TabSelectEvent(tab.index, event);
|
|
380
|
-
this.tabSelect.emit(selectEvent);
|
|
381
|
-
return selectEvent.isDefaultPrevented();
|
|
382
|
-
}
|
|
383
|
-
focusTab(tab) {
|
|
384
|
-
const tabListItems = this.tabListItems();
|
|
385
|
-
const tabListItem = tabListItems.find(t => t.nativeElement.getAttribute("data-tab-id") === tab.id);
|
|
386
|
-
tabListItem?.nativeElement.focus();
|
|
387
|
-
}
|
|
388
|
-
getNavigationDirection(event) {
|
|
389
|
-
if (this.orientation() === "vertical") {
|
|
390
|
-
if (event.key === "ArrowUp") {
|
|
391
|
-
return "previous";
|
|
392
|
-
}
|
|
393
|
-
if (event.key === "ArrowDown") {
|
|
394
|
-
return "next";
|
|
395
|
-
}
|
|
396
|
-
return null;
|
|
397
|
-
}
|
|
398
|
-
if (event.key === "ArrowLeft") {
|
|
399
|
-
return "previous";
|
|
400
|
-
}
|
|
401
|
-
if (event.key === "ArrowRight") {
|
|
402
|
-
return "next";
|
|
403
|
-
}
|
|
404
|
-
return null;
|
|
405
|
-
}
|
|
406
421
|
handleTabKey(tab, event) {
|
|
407
422
|
event.preventDefault();
|
|
408
423
|
const panelId = tab.id + "-panel";
|
|
@@ -412,11 +427,14 @@ class TabListComponent {
|
|
|
412
427
|
}
|
|
413
428
|
}
|
|
414
429
|
performScroll(element, direction) {
|
|
415
|
-
|
|
430
|
+
let offset = direction === "previous" ? -100 : 100;
|
|
416
431
|
if (this.orientation() === "vertical") {
|
|
417
432
|
element.scrollBy({ top: offset, behavior: "smooth" });
|
|
418
433
|
return;
|
|
419
434
|
}
|
|
435
|
+
if (this.isRtl()) {
|
|
436
|
+
offset = -offset;
|
|
437
|
+
}
|
|
420
438
|
element.scrollBy({ left: offset, behavior: "smooth" });
|
|
421
439
|
}
|
|
422
440
|
selectTab(tab) {
|
|
@@ -456,7 +474,7 @@ class TabListComponent {
|
|
|
456
474
|
});
|
|
457
475
|
}
|
|
458
476
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: TabListComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
459
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: TabListComponent, isStandalone: true, selector: "mona-tab-list", inputs: { closable: { classPropertyName: "closable", publicName: "closable", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, position: { classPropertyName: "position", publicName: "position", isSignal: true, isRequired: true, transformFunction: null }, selectedTabId: { classPropertyName: "selectedTabId", publicName: "selectedTabId", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: true, transformFunction: null }, tabList: { classPropertyName: "tabList", publicName: "tabList", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { selectedTabId: "selectedTabIdChange", tabClose: "tabClose", tabSelect: "tabSelect" }, host: { listeners: { "keydown": "onKeydown($event)" }, properties: { "class": "baseClass()" } }, viewQueries: [{ propertyName: "tabListElement", first: true, predicate: ["tabListElement"], descendants: true, isSignal: true }, { propertyName: "tabListItems", predicate: TabListItemDirective, descendants: true, read: ElementRef, isSignal: true }], ngImport: i0, template: "@if (overflowControlsVisible()) {\n <button\n monaButton\n look=\"link\"\n size=\"small\"\n [class]=\"scrollButtonClass()\"\n (click)=\"startScrolling(tabListElement, 'previous', 'single')\"\n (pointerdown)=\"startContinuousScroll($event, tabListElement, 'previous')\"\n (pointerup)=\"stopScrolling()\"\n (pointercancel)=\"stopScrolling()\"\n [attr.aria-hidden]=\"true\"\n tabindex=\"-1\">\n @if (orientation() === 'vertical') {\n <svg lucideChevronUp [size]=\"16\"></svg>\n } @else {\n <svg lucideChevronLeft [size]=\"16\"></svg>\n }\n </button>\n}\n<div [class]=\"listWrapperClass()\">\n <ul [class]=\"listClass()\" #tabListElement role=\"tablist\" [attr.aria-orientation]=\"orientation()\">\n @for (tab of tabList(); track tab) {\n @let selected = tab.id === selectedTabId();\n @let itemDisabled = tab.disabled || disabled();\n <li\n monaTabListItem\n [id]=\"tab.id + '-tab'\"\n [active]=\"selected\"\n [disabled]=\"itemDisabled\"\n [position]=\"position()\"\n [size]=\"size()\"\n role=\"tab\"\n [tabindex]=\"selected ? 0 : -1\"\n [attr.aria-selected]=\"selected\"\n [attr.aria-disabled]=\"itemDisabled\"\n [attr.aria-controls]=\"tab.id + '-panel'\"\n [attr.data-selected]=\"selected\"\n [attr.data-tab-id]=\"tab.id\"\n (click)=\"onTabClick(tab, tabListElement, $event)\">\n <div>\n @if (tab.titleTemplate) {\n <ng-container [ngTemplateOutlet]=\"tab.titleTemplate\"></ng-container>\n } @else {\n <span>{{ tab.title }}</span>\n }\n </div>\n @if (tab.closable || closable()) {\n <button\n monaButton\n look=\"link\"\n [disabled]=\"itemDisabled\"\n (click)=\"onTabClose(tab, $event)\"\n class=\"px-0 h-fit
|
|
477
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: TabListComponent, isStandalone: true, selector: "mona-tab-list", inputs: { closable: { classPropertyName: "closable", publicName: "closable", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, position: { classPropertyName: "position", publicName: "position", isSignal: true, isRequired: true, transformFunction: null }, selectedTabId: { classPropertyName: "selectedTabId", publicName: "selectedTabId", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: true, transformFunction: null }, tabList: { classPropertyName: "tabList", publicName: "tabList", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { selectedTabId: "selectedTabIdChange", tabClose: "tabClose", tabSelect: "tabSelect" }, host: { listeners: { "keydown": "onKeydown($event)" }, properties: { "class": "baseClass()" } }, viewQueries: [{ propertyName: "tabListElement", first: true, predicate: ["tabListElement"], descendants: true, isSignal: true }, { propertyName: "tabListItems", predicate: TabListItemDirective, descendants: true, read: ElementRef, isSignal: true }], ngImport: i0, template: "@if (overflowControlsVisible()) {\n <button\n monaButton\n look=\"link\"\n size=\"small\"\n [class]=\"scrollButtonClass()\"\n [attr.aria-label]=\"messages().scrollPrevious\"\n (click)=\"startScrolling(tabListElement, 'previous', 'single')\"\n (pointerdown)=\"startContinuousScroll($event, tabListElement, 'previous')\"\n (pointerup)=\"stopScrolling()\"\n (pointercancel)=\"stopScrolling()\"\n [attr.aria-hidden]=\"true\"\n tabindex=\"-1\">\n @if (orientation() === 'vertical') {\n <svg lucideChevronUp [size]=\"16\"></svg>\n } @else {\n <svg lucideChevronLeft [size]=\"16\" class=\"rtl:rotate-180\"></svg>\n }\n </button>\n}\n<div [class]=\"listWrapperClass()\">\n <ul [class]=\"listClass()\" #tabListElement role=\"tablist\" [attr.aria-orientation]=\"orientation()\">\n @for (tab of tabList(); track tab) {\n @let selected = tab.id === selectedTabId();\n @let itemDisabled = tab.disabled || disabled();\n <li\n monaTabListItem\n [id]=\"tab.id + '-tab'\"\n [active]=\"selected\"\n [disabled]=\"itemDisabled\"\n [position]=\"position()\"\n [size]=\"size()\"\n role=\"tab\"\n [tabindex]=\"selected ? 0 : -1\"\n [attr.aria-selected]=\"selected\"\n [attr.aria-disabled]=\"itemDisabled\"\n [attr.aria-controls]=\"tab.id + '-panel'\"\n [attr.data-selected]=\"selected\"\n [attr.data-tab-id]=\"tab.id\"\n (click)=\"onTabClick(tab, tabListElement, $event)\">\n <div>\n @if (tab.titleTemplate) {\n <ng-container [ngTemplateOutlet]=\"tab.titleTemplate\"></ng-container>\n } @else {\n <span>{{ tab.title }}</span>\n }\n </div>\n @if (tab.closable || closable()) {\n <button\n monaButton\n look=\"link\"\n [disabled]=\"itemDisabled\"\n [attr.aria-label]=\"messages().closeTab\"\n (click)=\"onTabClose(tab, $event)\"\n class=\"px-0 h-fit ms-1 w-min\"\n tabindex=\"-1\">\n <svg lucideX [size]=\"16\"></svg>\n </button>\n }\n </li>\n }\n </ul>\n</div>\n@if (overflowControlsVisible()) {\n <button\n monaButton\n look=\"link\"\n size=\"small\"\n [class]=\"scrollButtonClass()\"\n [attr.aria-label]=\"messages().scrollNext\"\n (click)=\"startScrolling(tabListElement, 'next', 'single')\"\n (pointerdown)=\"startContinuousScroll($event, tabListElement, 'next')\"\n (pointerup)=\"stopScrolling()\"\n (pointercancel)=\"stopScrolling()\"\n [attr.aria-hidden]=\"true\"\n tabindex=\"-1\">\n @if (orientation() === 'vertical') {\n <svg lucideChevronDown [size]=\"16\"></svg>\n } @else {\n <svg lucideChevronRight [size]=\"16\" class=\"rtl:rotate-180\"></svg>\n }\n </button>\n}\n", dependencies: [{ kind: "directive", type: ButtonDirective, selector: "button[monaButton]", inputs: ["aria-haspopup", "disabled", "iconOnly", "loading", "look", "rounded", "selected", "size", "tabindex", "type", "toggleable", "class"], outputs: ["disabledChange", "loadingChange", "lookChange", "selectedChange"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: TabListItemDirective, selector: "li[monaTabListItem]", inputs: ["active", "disabled", "position", "size"] }, { kind: "component", type: LucideChevronDown, selector: "svg[lucideChevronDown]" }, { kind: "component", type: LucideChevronLeft, selector: "svg[lucideChevronLeft]" }, { kind: "component", type: LucideChevronRight, selector: "svg[lucideChevronRight]" }, { kind: "component", type: LucideChevronUp, selector: "svg[lucideChevronUp]" }, { kind: "component", type: LucideX, selector: "svg[lucideX]" }] }); }
|
|
460
478
|
}
|
|
461
479
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: TabListComponent, decorators: [{
|
|
462
480
|
type: Component,
|
|
@@ -472,7 +490,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
472
490
|
], host: {
|
|
473
491
|
"[class]": "baseClass()",
|
|
474
492
|
"(keydown)": "onKeydown($event)"
|
|
475
|
-
}, template: "@if (overflowControlsVisible()) {\n <button\n monaButton\n look=\"link\"\n size=\"small\"\n [class]=\"scrollButtonClass()\"\n (click)=\"startScrolling(tabListElement, 'previous', 'single')\"\n (pointerdown)=\"startContinuousScroll($event, tabListElement, 'previous')\"\n (pointerup)=\"stopScrolling()\"\n (pointercancel)=\"stopScrolling()\"\n [attr.aria-hidden]=\"true\"\n tabindex=\"-1\">\n @if (orientation() === 'vertical') {\n <svg lucideChevronUp [size]=\"16\"></svg>\n } @else {\n <svg lucideChevronLeft [size]=\"16\"></svg>\n }\n </button>\n}\n<div [class]=\"listWrapperClass()\">\n <ul [class]=\"listClass()\" #tabListElement role=\"tablist\" [attr.aria-orientation]=\"orientation()\">\n @for (tab of tabList(); track tab) {\n @let selected = tab.id === selectedTabId();\n @let itemDisabled = tab.disabled || disabled();\n <li\n monaTabListItem\n [id]=\"tab.id + '-tab'\"\n [active]=\"selected\"\n [disabled]=\"itemDisabled\"\n [position]=\"position()\"\n [size]=\"size()\"\n role=\"tab\"\n [tabindex]=\"selected ? 0 : -1\"\n [attr.aria-selected]=\"selected\"\n [attr.aria-disabled]=\"itemDisabled\"\n [attr.aria-controls]=\"tab.id + '-panel'\"\n [attr.data-selected]=\"selected\"\n [attr.data-tab-id]=\"tab.id\"\n (click)=\"onTabClick(tab, tabListElement, $event)\">\n <div>\n @if (tab.titleTemplate) {\n <ng-container [ngTemplateOutlet]=\"tab.titleTemplate\"></ng-container>\n } @else {\n <span>{{ tab.title }}</span>\n }\n </div>\n @if (tab.closable || closable()) {\n <button\n monaButton\n look=\"link\"\n [disabled]=\"itemDisabled\"\n (click)=\"onTabClose(tab, $event)\"\n class=\"px-0 h-fit
|
|
493
|
+
}, template: "@if (overflowControlsVisible()) {\n <button\n monaButton\n look=\"link\"\n size=\"small\"\n [class]=\"scrollButtonClass()\"\n [attr.aria-label]=\"messages().scrollPrevious\"\n (click)=\"startScrolling(tabListElement, 'previous', 'single')\"\n (pointerdown)=\"startContinuousScroll($event, tabListElement, 'previous')\"\n (pointerup)=\"stopScrolling()\"\n (pointercancel)=\"stopScrolling()\"\n [attr.aria-hidden]=\"true\"\n tabindex=\"-1\">\n @if (orientation() === 'vertical') {\n <svg lucideChevronUp [size]=\"16\"></svg>\n } @else {\n <svg lucideChevronLeft [size]=\"16\" class=\"rtl:rotate-180\"></svg>\n }\n </button>\n}\n<div [class]=\"listWrapperClass()\">\n <ul [class]=\"listClass()\" #tabListElement role=\"tablist\" [attr.aria-orientation]=\"orientation()\">\n @for (tab of tabList(); track tab) {\n @let selected = tab.id === selectedTabId();\n @let itemDisabled = tab.disabled || disabled();\n <li\n monaTabListItem\n [id]=\"tab.id + '-tab'\"\n [active]=\"selected\"\n [disabled]=\"itemDisabled\"\n [position]=\"position()\"\n [size]=\"size()\"\n role=\"tab\"\n [tabindex]=\"selected ? 0 : -1\"\n [attr.aria-selected]=\"selected\"\n [attr.aria-disabled]=\"itemDisabled\"\n [attr.aria-controls]=\"tab.id + '-panel'\"\n [attr.data-selected]=\"selected\"\n [attr.data-tab-id]=\"tab.id\"\n (click)=\"onTabClick(tab, tabListElement, $event)\">\n <div>\n @if (tab.titleTemplate) {\n <ng-container [ngTemplateOutlet]=\"tab.titleTemplate\"></ng-container>\n } @else {\n <span>{{ tab.title }}</span>\n }\n </div>\n @if (tab.closable || closable()) {\n <button\n monaButton\n look=\"link\"\n [disabled]=\"itemDisabled\"\n [attr.aria-label]=\"messages().closeTab\"\n (click)=\"onTabClose(tab, $event)\"\n class=\"px-0 h-fit ms-1 w-min\"\n tabindex=\"-1\">\n <svg lucideX [size]=\"16\"></svg>\n </button>\n }\n </li>\n }\n </ul>\n</div>\n@if (overflowControlsVisible()) {\n <button\n monaButton\n look=\"link\"\n size=\"small\"\n [class]=\"scrollButtonClass()\"\n [attr.aria-label]=\"messages().scrollNext\"\n (click)=\"startScrolling(tabListElement, 'next', 'single')\"\n (pointerdown)=\"startContinuousScroll($event, tabListElement, 'next')\"\n (pointerup)=\"stopScrolling()\"\n (pointercancel)=\"stopScrolling()\"\n [attr.aria-hidden]=\"true\"\n tabindex=\"-1\">\n @if (orientation() === 'vertical') {\n <svg lucideChevronDown [size]=\"16\"></svg>\n } @else {\n <svg lucideChevronRight [size]=\"16\" class=\"rtl:rotate-180\"></svg>\n }\n </button>\n}\n" }]
|
|
476
494
|
}], ctorParameters: () => [], propDecorators: { tabListElement: [{ type: i0.ViewChild, args: ["tabListElement", { isSignal: true }] }], tabListItems: [{ type: i0.ViewChildren, args: [i0.forwardRef(() => TabListItemDirective), { ...{ read: ElementRef }, isSignal: true }] }], closable: [{ type: i0.Input, args: [{ isSignal: true, alias: "closable", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], position: [{ type: i0.Input, args: [{ isSignal: true, alias: "position", required: true }] }], selectedTabId: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectedTabId", required: false }] }, { type: i0.Output, args: ["selectedTabIdChange"] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: true }] }], tabClose: [{ type: i0.Output, args: ["tabClose"] }], tabList: [{ type: i0.Input, args: [{ isSignal: true, alias: "tabList", required: true }] }], tabSelect: [{ type: i0.Output, args: ["tabSelect"] }] } });
|
|
477
495
|
|
|
478
496
|
class TabComponent {
|
|
@@ -546,10 +564,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
546
564
|
|
|
547
565
|
class TabsComponent {
|
|
548
566
|
constructor() {
|
|
549
|
-
this.tabListComponent = viewChild.required(TabListComponent, /* @ts-ignore */
|
|
550
|
-
...(ngDevMode ? [{ debugName: "tabListComponent" }] : /* istanbul ignore next */ []));
|
|
551
|
-
this.tabs = contentChildren(TabComponent, /* @ts-ignore */
|
|
552
|
-
...(ngDevMode ? [{ debugName: "tabs" }] : /* istanbul ignore next */ []));
|
|
553
567
|
this.baseClass = computed(() => {
|
|
554
568
|
const variantClass = tabsBaseThemeVariants({ position: this.position() });
|
|
555
569
|
const userClass = this.userClass();
|
|
@@ -575,6 +589,10 @@ class TabsComponent {
|
|
|
575
589
|
.toImmutableSet();
|
|
576
590
|
}, /* @ts-ignore */
|
|
577
591
|
...(ngDevMode ? [{ debugName: "tabList" }] : /* istanbul ignore next */ []));
|
|
592
|
+
this.tabListComponent = viewChild.required(TabListComponent, /* @ts-ignore */
|
|
593
|
+
...(ngDevMode ? [{ debugName: "tabListComponent" }] : /* istanbul ignore next */ []));
|
|
594
|
+
this.tabs = contentChildren(TabComponent, /* @ts-ignore */
|
|
595
|
+
...(ngDevMode ? [{ debugName: "tabs" }] : /* istanbul ignore next */ []));
|
|
578
596
|
/**
|
|
579
597
|
* @description Displays a close button on each tab, unless overridden per tab.
|
|
580
598
|
* @default false
|
|
@@ -629,11 +647,11 @@ class TabsComponent {
|
|
|
629
647
|
}
|
|
630
648
|
}
|
|
631
649
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: TabsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
632
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: TabsComponent, isStandalone: true, selector: "mona-tabs", inputs: { closable: { classPropertyName: "closable", publicName: "closable", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, keepTabContent: { classPropertyName: "keepTabContent", publicName: "keepTabContent", isSignal: true, isRequired: false, transformFunction: null }, position: { classPropertyName: "position", publicName: "position", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { tabClose: "tabClose", tabSelect: "tabSelect" }, host: { properties: { "class": "baseClass()" } }, queries: [{ propertyName: "tabs", predicate: TabComponent, isSignal: true }], viewQueries: [{ propertyName: "tabListComponent", first: true, predicate: TabListComponent, descendants: true, isSignal: true }], ngImport: i0, template: "<mona-tab-list\n [closable]=\"closable()\"\n [disabled]=\"disabled()\"\n [position]=\"position()\"\n [size]=\"size()\"\n [tabList]=\"tabList()\"\n [selectedTabId]=\"selectedTabId()\"\n (selectedTabIdChange)=\"selectedTabId.set($event)\"\n (tabClose)=\"tabClose.emit($event)\"\n (tabSelect)=\"tabSelect.emit($event)\"></mona-tab-list>\n<div [class]=\"contentClass()\">\n @for (tab of tabList(); track tab) {\n @let selected = tab.id === selectedTabId();\n @let tabLoaded = keepTabContent() || selected;\n @let tabHidden = keepTabContent() && !selected;\n @if (tabLoaded) {\n <div\n class=\"w-full h-full outline-none rounded-sm focus-visible:outline-2 focus-visible:outline-focus-indicator focus-visible:outline-offset-2\"\n [class.hidden]=\"tabHidden\"\n role=\"tabpanel\"\n [id]=\"tab.id + '-panel'\"\n tabindex=\"0\"\n (keydown)=\"handlePanelKeyDown($event)\"\n [attr.aria-hidden]=\"tabHidden\"\n [attr.aria-labelledby]=\"tab.id + '-tab'\">\n <ng-container [ngTemplateOutlet]=\"tab.contentTemplate\"></ng-container>\n </div>\n }\n }\n</div>\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: TabListComponent, selector: "mona-tab-list", inputs: ["closable", "disabled", "position", "selectedTabId", "size", "tabList"], outputs: ["selectedTabIdChange", "tabClose", "tabSelect"] }]
|
|
650
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: TabsComponent, isStandalone: true, selector: "mona-tabs", inputs: { closable: { classPropertyName: "closable", publicName: "closable", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, keepTabContent: { classPropertyName: "keepTabContent", publicName: "keepTabContent", isSignal: true, isRequired: false, transformFunction: null }, position: { classPropertyName: "position", publicName: "position", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { tabClose: "tabClose", tabSelect: "tabSelect" }, host: { properties: { "class": "baseClass()" } }, queries: [{ propertyName: "tabs", predicate: TabComponent, isSignal: true }], viewQueries: [{ propertyName: "tabListComponent", first: true, predicate: TabListComponent, descendants: true, isSignal: true }], ngImport: i0, template: "<mona-tab-list\n [closable]=\"closable()\"\n [disabled]=\"disabled()\"\n [position]=\"position()\"\n [size]=\"size()\"\n [tabList]=\"tabList()\"\n [selectedTabId]=\"selectedTabId()\"\n (selectedTabIdChange)=\"selectedTabId.set($event)\"\n (tabClose)=\"tabClose.emit($event)\"\n (tabSelect)=\"tabSelect.emit($event)\"></mona-tab-list>\n<div [class]=\"contentClass()\">\n @for (tab of tabList(); track tab) {\n @let selected = tab.id === selectedTabId();\n @let tabLoaded = keepTabContent() || selected;\n @let tabHidden = keepTabContent() && !selected;\n @if (tabLoaded) {\n <div\n class=\"w-full h-full outline-none rounded-sm focus-visible:outline-2 focus-visible:outline-focus-indicator focus-visible:outline-offset-2\"\n [class.hidden]=\"tabHidden\"\n role=\"tabpanel\"\n [id]=\"tab.id + '-panel'\"\n tabindex=\"0\"\n (keydown)=\"handlePanelKeyDown($event)\"\n [attr.aria-hidden]=\"tabHidden\"\n [attr.aria-labelledby]=\"tab.id + '-tab'\">\n <ng-container [ngTemplateOutlet]=\"tab.contentTemplate\"></ng-container>\n </div>\n }\n }\n</div>\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: TabListComponent, selector: "mona-tab-list", inputs: ["closable", "disabled", "position", "selectedTabId", "size", "tabList"], outputs: ["selectedTabIdChange", "tabClose", "tabSelect"] }] }); }
|
|
633
651
|
}
|
|
634
652
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: TabsComponent, decorators: [{
|
|
635
653
|
type: Component,
|
|
636
|
-
args: [{ selector: "mona-tabs",
|
|
654
|
+
args: [{ selector: "mona-tabs", imports: [NgTemplateOutlet, TabListComponent], host: {
|
|
637
655
|
"[class]": "baseClass()"
|
|
638
656
|
}, template: "<mona-tab-list\n [closable]=\"closable()\"\n [disabled]=\"disabled()\"\n [position]=\"position()\"\n [size]=\"size()\"\n [tabList]=\"tabList()\"\n [selectedTabId]=\"selectedTabId()\"\n (selectedTabIdChange)=\"selectedTabId.set($event)\"\n (tabClose)=\"tabClose.emit($event)\"\n (tabSelect)=\"tabSelect.emit($event)\"></mona-tab-list>\n<div [class]=\"contentClass()\">\n @for (tab of tabList(); track tab) {\n @let selected = tab.id === selectedTabId();\n @let tabLoaded = keepTabContent() || selected;\n @let tabHidden = keepTabContent() && !selected;\n @if (tabLoaded) {\n <div\n class=\"w-full h-full outline-none rounded-sm focus-visible:outline-2 focus-visible:outline-focus-indicator focus-visible:outline-offset-2\"\n [class.hidden]=\"tabHidden\"\n role=\"tabpanel\"\n [id]=\"tab.id + '-panel'\"\n tabindex=\"0\"\n (keydown)=\"handlePanelKeyDown($event)\"\n [attr.aria-hidden]=\"tabHidden\"\n [attr.aria-labelledby]=\"tab.id + '-tab'\">\n <ng-container [ngTemplateOutlet]=\"tab.contentTemplate\"></ng-container>\n </div>\n }\n }\n</div>\n" }]
|
|
639
657
|
}], propDecorators: { tabListComponent: [{ type: i0.ViewChild, args: [i0.forwardRef(() => TabListComponent), { isSignal: true }] }], tabs: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => TabComponent), { isSignal: true }] }], closable: [{ type: i0.Input, args: [{ isSignal: true, alias: "closable", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], keepTabContent: [{ type: i0.Input, args: [{ isSignal: true, alias: "keepTabContent", required: false }] }], position: [{ type: i0.Input, args: [{ isSignal: true, alias: "position", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], tabClose: [{ type: i0.Output, args: ["tabClose"] }], tabSelect: [{ type: i0.Output, args: ["tabSelect"] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
@@ -646,5 +664,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
646
664
|
* Generated bundle index. Do not edit.
|
|
647
665
|
*/
|
|
648
666
|
|
|
649
|
-
export { TabCloseEvent, TabComponent, TabContentTemplateDirective, TabSelectEvent, TabTitleTemplateDirective, TabsComponent };
|
|
667
|
+
export { TABS_DEFAULT_MESSAGES, TabCloseEvent, TabComponent, TabContentTemplateDirective, TabSelectEvent, TabTitleTemplateDirective, TabsComponent };
|
|
650
668
|
//# sourceMappingURL=nanahoshi-mona-ui-tabs.mjs.map
|
|
@@ -5,6 +5,7 @@ import * as i1 from '@angular/forms';
|
|
|
5
5
|
import { FormsModule } from '@angular/forms';
|
|
6
6
|
import { LucideX } from '@lucide/angular';
|
|
7
7
|
import { ButtonDirective } from '@nanahoshi/mona-ui/button';
|
|
8
|
+
import { MonaI18nService } from '@nanahoshi/mona-ui/i18n';
|
|
8
9
|
import { themeControlSurfaceClasses, rxTimeout, AttributeBinderDirective } from '@nanahoshi/mona-ui/internal';
|
|
9
10
|
import { twMerge } from 'tailwind-merge';
|
|
10
11
|
import { cva } from 'class-variance-authority';
|
|
@@ -31,6 +32,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
31
32
|
}]
|
|
32
33
|
}] });
|
|
33
34
|
|
|
35
|
+
const TEXT_BOX_DEFAULT_MESSAGES = {
|
|
36
|
+
clear: "Clear"
|
|
37
|
+
};
|
|
38
|
+
|
|
34
39
|
const textBoxThemeVariants = cva(`
|
|
35
40
|
flex w-full min-w-0 items-center
|
|
36
41
|
overflow-hidden
|
|
@@ -139,6 +144,7 @@ const inputThemeVariants = cva(`
|
|
|
139
144
|
class TextBoxComponent {
|
|
140
145
|
constructor() {
|
|
141
146
|
this.#destroyRef = inject(DestroyRef);
|
|
147
|
+
this.#i18n = inject(MonaI18nService);
|
|
142
148
|
this.classes = computed(() => {
|
|
143
149
|
const rounded = this.rounded();
|
|
144
150
|
const size = this.size();
|
|
@@ -151,6 +157,7 @@ class TextBoxComponent {
|
|
|
151
157
|
...(ngDevMode ? [{ debugName: "inputRef" }] : /* istanbul ignore next */ []));
|
|
152
158
|
this.invalidInput = computed(() => this.touched() && (this.invalid() || (this.required() && !this.value())), /* @ts-ignore */
|
|
153
159
|
...(ngDevMode ? [{ debugName: "invalidInput" }] : /* istanbul ignore next */ []));
|
|
160
|
+
this.messages = this.#i18n.componentMessages("textBox", TEXT_BOX_DEFAULT_MESSAGES);
|
|
154
161
|
this.prefixTemplateList = contentChildren(TextBoxPrefixTemplateDirective, { ...(ngDevMode ? { debugName: "prefixTemplateList" } : /* istanbul ignore next */ {}), read: TemplateRef });
|
|
155
162
|
this.suffixTemplateList = contentChildren(TextBoxSuffixTemplateDirective, { ...(ngDevMode ? { debugName: "suffixTemplateList" } : /* istanbul ignore next */ {}), read: TemplateRef });
|
|
156
163
|
/**
|
|
@@ -175,16 +182,16 @@ class TextBoxComponent {
|
|
|
175
182
|
* @description Emitted when the inner input loses focus.
|
|
176
183
|
*/
|
|
177
184
|
this.inputBlur = output();
|
|
178
|
-
/**
|
|
179
|
-
* @description Emitted when the inner input gains focus.
|
|
180
|
-
*/
|
|
181
|
-
this.inputFocus = output();
|
|
182
185
|
/**
|
|
183
186
|
* @description Additional CSS classes applied to the inner `<input>` element.
|
|
184
187
|
* @default ""
|
|
185
188
|
*/
|
|
186
189
|
this.inputClass = input("", /* @ts-ignore */
|
|
187
190
|
...(ngDevMode ? [{ debugName: "inputClass" }] : /* istanbul ignore next */ []));
|
|
191
|
+
/**
|
|
192
|
+
* @description Emitted when the inner input gains focus.
|
|
193
|
+
*/
|
|
194
|
+
this.inputFocus = output();
|
|
188
195
|
/**
|
|
189
196
|
* @description Inline styles applied to the inner `<input>` element.
|
|
190
197
|
* Accepts a style string or a `CSSStyleDeclaration` partial.
|
|
@@ -261,6 +268,7 @@ class TextBoxComponent {
|
|
|
261
268
|
...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
262
269
|
}
|
|
263
270
|
#destroyRef;
|
|
271
|
+
#i18n;
|
|
264
272
|
focus() {
|
|
265
273
|
const el = this.inputRef().nativeElement;
|
|
266
274
|
el.focus();
|
|
@@ -282,7 +290,7 @@ class TextBoxComponent {
|
|
|
282
290
|
this.touch.emit();
|
|
283
291
|
}
|
|
284
292
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: TextBoxComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
285
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: TextBoxComponent, isStandalone: true, selector: "mona-text-box", inputs: { clearButton: { classPropertyName: "clearButton", publicName: "clearButton", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, inputAttributes: { classPropertyName: "inputAttributes", publicName: "inputAttributes", isSignal: true, isRequired: false, transformFunction: null }, inputClass: { classPropertyName: "inputClass", publicName: "inputClass", isSignal: true, isRequired: false, transformFunction: null }, inputStyle: { classPropertyName: "inputStyle", publicName: "inputStyle", isSignal: true, isRequired: false, transformFunction: null }, invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, rounded: { classPropertyName: "rounded", publicName: "rounded", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, touched: { classPropertyName: "touched", publicName: "touched", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { inputBlur: "inputBlur", inputFocus: "inputFocus", touch: "touch", value: "valueChange" }, host: { properties: { "attr.data-disabled": "disabled() || null", "attr.data-readonly": "readonly() || null", "attr.data-required": "required() || null", "attr.data-invalid": "invalidInput() || null", "class": "classes()" } }, queries: [{ propertyName: "prefixTemplateList", predicate: TextBoxPrefixTemplateDirective, read: TemplateRef, isSignal: true }, { propertyName: "suffixTemplateList", predicate: TextBoxSuffixTemplateDirective, read: TemplateRef, isSignal: true }], viewQueries: [{ propertyName: "inputRef", first: true, predicate: ["input"], descendants: true, isSignal: true }], ngImport: i0, template: "@for (prefixTemplate of prefixTemplateList(); track $index) {\n <span class=\"flex h-full flex-wrap items-center\">\n <ng-container *ngTemplateOutlet=\"prefixTemplate\"></ng-container>\n </span>\n}\n<input\n [disabled]=\"disabled()\"\n [readonly]=\"readonly()\"\n [required]=\"required()\"\n [placeholder]=\"placeholder()\"\n [type]=\"type()\"\n [class]=\"inputClass()\"\n [style]=\"inputStyle()\"\n [attr.aria-invalid]=\"invalidInput() ? 'true' : null\"\n [monaAttributeBinder]=\"inputAttributes()\"\n [ngModel]=\"value()\"\n (ngModelChange)=\"onValueChange($event)\"\n (blur)=\"onInputBlur($event)\"\n (focus)=\"inputFocus.emit($event)\"\n #input />\n\n@let textBoxValue = value();\n@if (clearButton() && textBoxValue && textBoxValue.length !== 0) {\n <button monaButton look=\"link\" size=\"small\" class=\"me-2 p-0\" aria-label=\"
|
|
293
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: TextBoxComponent, isStandalone: true, selector: "mona-text-box", inputs: { clearButton: { classPropertyName: "clearButton", publicName: "clearButton", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, inputAttributes: { classPropertyName: "inputAttributes", publicName: "inputAttributes", isSignal: true, isRequired: false, transformFunction: null }, inputClass: { classPropertyName: "inputClass", publicName: "inputClass", isSignal: true, isRequired: false, transformFunction: null }, inputStyle: { classPropertyName: "inputStyle", publicName: "inputStyle", isSignal: true, isRequired: false, transformFunction: null }, invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, rounded: { classPropertyName: "rounded", publicName: "rounded", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, touched: { classPropertyName: "touched", publicName: "touched", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { inputBlur: "inputBlur", inputFocus: "inputFocus", touch: "touch", value: "valueChange" }, host: { properties: { "attr.data-disabled": "disabled() || null", "attr.data-readonly": "readonly() || null", "attr.data-required": "required() || null", "attr.data-invalid": "invalidInput() || null", "class": "classes()" } }, queries: [{ propertyName: "prefixTemplateList", predicate: TextBoxPrefixTemplateDirective, read: TemplateRef, isSignal: true }, { propertyName: "suffixTemplateList", predicate: TextBoxSuffixTemplateDirective, read: TemplateRef, isSignal: true }], viewQueries: [{ propertyName: "inputRef", first: true, predicate: ["input"], descendants: true, isSignal: true }], ngImport: i0, template: "@for (prefixTemplate of prefixTemplateList(); track $index) {\n <span class=\"flex h-full flex-wrap items-center\">\n <ng-container *ngTemplateOutlet=\"prefixTemplate\"></ng-container>\n </span>\n}\n<input\n [disabled]=\"disabled()\"\n [readonly]=\"readonly()\"\n [required]=\"required()\"\n [placeholder]=\"placeholder()\"\n [type]=\"type()\"\n [class]=\"inputClass()\"\n [style]=\"inputStyle()\"\n [attr.aria-invalid]=\"invalidInput() ? 'true' : null\"\n [monaAttributeBinder]=\"inputAttributes()\"\n [ngModel]=\"value()\"\n (ngModelChange)=\"onValueChange($event)\"\n (blur)=\"onInputBlur($event)\"\n (focus)=\"inputFocus.emit($event)\"\n #input />\n\n@let textBoxValue = value();\n@if (clearButton() && textBoxValue && textBoxValue.length !== 0) {\n <button monaButton look=\"link\" size=\"small\" class=\"me-2 p-0\" [attr.aria-label]=\"messages().clear\" (click)=\"onClearClick()\">\n <svg lucideX class=\"size-4 opacity-50 hover:opacity-90\"></svg>\n </button>\n}\n\n@for (suffixTemplate of suffixTemplateList(); track $index) {\n <span class=\"flex h-full flex-wrap items-center\">\n <ng-container *ngTemplateOutlet=\"suffixTemplate\"></ng-container>\n </span>\n}\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: ButtonDirective, selector: "button[monaButton]", inputs: ["aria-haspopup", "disabled", "iconOnly", "loading", "look", "rounded", "selected", "size", "tabindex", "type", "toggleable", "class"], outputs: ["disabledChange", "loadingChange", "lookChange", "selectedChange"] }, { kind: "directive", type: AttributeBinderDirective, selector: "[monaAttributeBinder]", inputs: ["monaAttributeBinder"] }, { kind: "component", type: LucideX, selector: "svg[lucideX]" }] }); }
|
|
286
294
|
}
|
|
287
295
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: TextBoxComponent, decorators: [{
|
|
288
296
|
type: Component,
|
|
@@ -292,8 +300,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
292
300
|
"[attr.data-required]": "required() || null",
|
|
293
301
|
"[attr.data-invalid]": "invalidInput() || null",
|
|
294
302
|
"[class]": "classes()"
|
|
295
|
-
}, template: "@for (prefixTemplate of prefixTemplateList(); track $index) {\n <span class=\"flex h-full flex-wrap items-center\">\n <ng-container *ngTemplateOutlet=\"prefixTemplate\"></ng-container>\n </span>\n}\n<input\n [disabled]=\"disabled()\"\n [readonly]=\"readonly()\"\n [required]=\"required()\"\n [placeholder]=\"placeholder()\"\n [type]=\"type()\"\n [class]=\"inputClass()\"\n [style]=\"inputStyle()\"\n [attr.aria-invalid]=\"invalidInput() ? 'true' : null\"\n [monaAttributeBinder]=\"inputAttributes()\"\n [ngModel]=\"value()\"\n (ngModelChange)=\"onValueChange($event)\"\n (blur)=\"onInputBlur($event)\"\n (focus)=\"inputFocus.emit($event)\"\n #input />\n\n@let textBoxValue = value();\n@if (clearButton() && textBoxValue && textBoxValue.length !== 0) {\n <button monaButton look=\"link\" size=\"small\" class=\"me-2 p-0\" aria-label=\"
|
|
296
|
-
}], propDecorators: { inputRef: [{ type: i0.ViewChild, args: ["input", { isSignal: true }] }], prefixTemplateList: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => TextBoxPrefixTemplateDirective), { ...{ read: TemplateRef }, isSignal: true }] }], suffixTemplateList: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => TextBoxSuffixTemplateDirective), { ...{ read: TemplateRef }, isSignal: true }] }], clearButton: [{ type: i0.Input, args: [{ isSignal: true, alias: "clearButton", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], inputAttributes: [{ type: i0.Input, args: [{ isSignal: true, alias: "inputAttributes", required: false }] }], inputBlur: [{ type: i0.Output, args: ["inputBlur"] }],
|
|
303
|
+
}, template: "@for (prefixTemplate of prefixTemplateList(); track $index) {\n <span class=\"flex h-full flex-wrap items-center\">\n <ng-container *ngTemplateOutlet=\"prefixTemplate\"></ng-container>\n </span>\n}\n<input\n [disabled]=\"disabled()\"\n [readonly]=\"readonly()\"\n [required]=\"required()\"\n [placeholder]=\"placeholder()\"\n [type]=\"type()\"\n [class]=\"inputClass()\"\n [style]=\"inputStyle()\"\n [attr.aria-invalid]=\"invalidInput() ? 'true' : null\"\n [monaAttributeBinder]=\"inputAttributes()\"\n [ngModel]=\"value()\"\n (ngModelChange)=\"onValueChange($event)\"\n (blur)=\"onInputBlur($event)\"\n (focus)=\"inputFocus.emit($event)\"\n #input />\n\n@let textBoxValue = value();\n@if (clearButton() && textBoxValue && textBoxValue.length !== 0) {\n <button monaButton look=\"link\" size=\"small\" class=\"me-2 p-0\" [attr.aria-label]=\"messages().clear\" (click)=\"onClearClick()\">\n <svg lucideX class=\"size-4 opacity-50 hover:opacity-90\"></svg>\n </button>\n}\n\n@for (suffixTemplate of suffixTemplateList(); track $index) {\n <span class=\"flex h-full flex-wrap items-center\">\n <ng-container *ngTemplateOutlet=\"suffixTemplate\"></ng-container>\n </span>\n}\n" }]
|
|
304
|
+
}], propDecorators: { inputRef: [{ type: i0.ViewChild, args: ["input", { isSignal: true }] }], prefixTemplateList: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => TextBoxPrefixTemplateDirective), { ...{ read: TemplateRef }, isSignal: true }] }], suffixTemplateList: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => TextBoxSuffixTemplateDirective), { ...{ read: TemplateRef }, isSignal: true }] }], clearButton: [{ type: i0.Input, args: [{ isSignal: true, alias: "clearButton", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], inputAttributes: [{ type: i0.Input, args: [{ isSignal: true, alias: "inputAttributes", required: false }] }], inputBlur: [{ type: i0.Output, args: ["inputBlur"] }], inputClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "inputClass", required: false }] }], inputFocus: [{ type: i0.Output, args: ["inputFocus"] }], inputStyle: [{ type: i0.Input, args: [{ isSignal: true, alias: "inputStyle", required: false }] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], rounded: [{ type: i0.Input, args: [{ isSignal: true, alias: "rounded", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], touch: [{ type: i0.Output, args: ["touch"] }], touched: [{ type: i0.Input, args: [{ isSignal: true, alias: "touched", required: false }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }] } });
|
|
297
305
|
|
|
298
306
|
class TextBoxDirective {
|
|
299
307
|
constructor() {
|
|
@@ -360,5 +368,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
360
368
|
* Generated bundle index. Do not edit.
|
|
361
369
|
*/
|
|
362
370
|
|
|
363
|
-
export { TextBoxComponent, TextBoxDirective, TextBoxPrefixTemplateDirective, TextBoxSuffixTemplateDirective };
|
|
371
|
+
export { TEXT_BOX_DEFAULT_MESSAGES, TextBoxComponent, TextBoxDirective, TextBoxPrefixTemplateDirective, TextBoxSuffixTemplateDirective };
|
|
364
372
|
//# sourceMappingURL=nanahoshi-mona-ui-text-box.mjs.map
|