@nanahoshi/mona-ui 0.1.0 → 0.2.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/auto-complete/package.json +4 -0
- package/avatar/package.json +4 -0
- package/breadcrumb/package.json +4 -0
- package/button/package.json +4 -0
- package/button-group/package.json +4 -0
- package/calendar/package.json +4 -0
- package/check-box/package.json +4 -0
- package/chip/package.json +4 -0
- package/circular-progress-bar/package.json +4 -0
- package/color-gradient/package.json +4 -0
- package/color-palette/package.json +4 -0
- package/color-picker/package.json +4 -0
- package/combo-box/package.json +4 -0
- package/common/package.json +4 -0
- package/contextmenu/package.json +4 -0
- package/date-input/package.json +4 -0
- package/date-picker/package.json +4 -0
- package/datetime-picker/package.json +4 -0
- package/dialog/package.json +4 -0
- package/dropdown-button/package.json +4 -0
- package/dropdown-list/package.json +4 -0
- package/dropdowns/package.json +4 -0
- package/editor/package.json +4 -0
- package/expansion-panel/package.json +4 -0
- package/fesm2022/nanahoshi-mona-ui-auto-complete.mjs +40 -55
- package/fesm2022/nanahoshi-mona-ui-breadcrumb.mjs +24 -58
- package/fesm2022/nanahoshi-mona-ui-button-group.mjs +37 -48
- package/fesm2022/nanahoshi-mona-ui-button.mjs +130 -129
- package/fesm2022/nanahoshi-mona-ui-calendar.mjs +69 -165
- package/fesm2022/nanahoshi-mona-ui-check-box.mjs +81 -128
- package/fesm2022/nanahoshi-mona-ui-chip.mjs +102 -112
- package/fesm2022/nanahoshi-mona-ui-circular-progress-bar.mjs +11 -25
- package/fesm2022/nanahoshi-mona-ui-color-gradient.mjs +41 -92
- package/fesm2022/nanahoshi-mona-ui-color-palette.mjs +27 -49
- package/fesm2022/nanahoshi-mona-ui-color-picker.mjs +64 -65
- package/fesm2022/nanahoshi-mona-ui-combo-box.mjs +39 -61
- package/fesm2022/nanahoshi-mona-ui-date-input.mjs +12 -15
- package/fesm2022/nanahoshi-mona-ui-date-picker.mjs +44 -33
- package/fesm2022/nanahoshi-mona-ui-datetime-picker.mjs +58 -60
- package/fesm2022/nanahoshi-mona-ui-dialog.mjs +52 -165
- package/fesm2022/nanahoshi-mona-ui-dropdown-list.mjs +36 -59
- package/fesm2022/nanahoshi-mona-ui-dropdowns.mjs +56 -61
- package/fesm2022/nanahoshi-mona-ui-editor.mjs +302 -81
- package/fesm2022/nanahoshi-mona-ui-expansion-panel.mjs +33 -84
- package/fesm2022/nanahoshi-mona-ui-fieldset.mjs +12 -45
- package/fesm2022/nanahoshi-mona-ui-filter.mjs +18 -48
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-footer-cell.component-B9SQH5N-.mjs → nanahoshi-mona-ui-grid-grid-footer-cell.component-B6FBLtrr.mjs} +14 -14
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-footer-table-cell.directive-DlLwcCFT.mjs → nanahoshi-mona-ui-grid-grid-footer-table-cell.directive-OJe4UYuw.mjs} +4 -8
- package/fesm2022/nanahoshi-mona-ui-grid-grid-list.component-DCd8K6ng.mjs +121 -0
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-toggle.component-DIUutx9s.mjs → nanahoshi-mona-ui-grid-grid-toggle.component-Dl8Hlkhj.mjs} +26 -55
- package/fesm2022/nanahoshi-mona-ui-grid-grid-virtual-list.component-C5FRZlvv.mjs +231 -0
- package/fesm2022/{nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-C3eZIaJK.mjs → nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-BRZUd8cE.mjs} +167 -451
- package/fesm2022/nanahoshi-mona-ui-grid.mjs +1 -1
- package/fesm2022/nanahoshi-mona-ui-internal-indicator-icon.mjs +10 -28
- package/fesm2022/nanahoshi-mona-ui-internal-list.mjs +57 -87
- package/fesm2022/nanahoshi-mona-ui-internal-tree.mjs +48 -139
- package/fesm2022/nanahoshi-mona-ui-internal.mjs +29 -1
- package/fesm2022/nanahoshi-mona-ui-list-box.mjs +10 -32
- package/fesm2022/nanahoshi-mona-ui-list-view.mjs +8 -21
- package/fesm2022/nanahoshi-mona-ui-menubar.mjs +50 -156
- package/fesm2022/nanahoshi-mona-ui-multi-select.mjs +40 -69
- package/fesm2022/nanahoshi-mona-ui-notification.mjs +32 -116
- package/fesm2022/nanahoshi-mona-ui-numeric-text-box.mjs +81 -107
- package/fesm2022/nanahoshi-mona-ui-pager.mjs +33 -85
- package/fesm2022/nanahoshi-mona-ui-placeholder.mjs +12 -34
- package/fesm2022/nanahoshi-mona-ui-popover.mjs +31 -52
- package/fesm2022/nanahoshi-mona-ui-popup-menu.mjs +38 -110
- package/fesm2022/nanahoshi-mona-ui-popup.mjs +4 -4
- package/fesm2022/nanahoshi-mona-ui-progress-bar.mjs +21 -62
- package/fesm2022/nanahoshi-mona-ui-radio-button.mjs +66 -111
- package/fesm2022/nanahoshi-mona-ui-scroll-view.mjs +60 -151
- package/fesm2022/nanahoshi-mona-ui-slider.mjs +117 -173
- package/fesm2022/nanahoshi-mona-ui-split-button.mjs +32 -45
- package/fesm2022/nanahoshi-mona-ui-splitter.mjs +29 -64
- package/fesm2022/nanahoshi-mona-ui-stepper.mjs +38 -101
- package/fesm2022/nanahoshi-mona-ui-switch.mjs +58 -79
- package/fesm2022/nanahoshi-mona-ui-tabs.mjs +42 -118
- package/fesm2022/nanahoshi-mona-ui-text-area.mjs +29 -37
- package/fesm2022/nanahoshi-mona-ui-text-box.mjs +60 -81
- package/fesm2022/nanahoshi-mona-ui-theme.mjs +1111 -269
- package/fesm2022/nanahoshi-mona-ui-time-picker.mjs +45 -39
- package/fesm2022/nanahoshi-mona-ui-time-selector.mjs +45 -109
- package/fesm2022/nanahoshi-mona-ui-tooltip.mjs +54 -82
- package/fesm2022/nanahoshi-mona-ui-tree-view.mjs +2 -2
- package/fesm2022/nanahoshi-mona-ui-window.mjs +35 -115
- package/fieldset/package.json +4 -0
- package/filter/package.json +4 -0
- package/grid/package.json +4 -0
- package/internal/filter-input/package.json +4 -0
- package/internal/indicator-icon/package.json +4 -0
- package/internal/list/package.json +4 -0
- package/internal/package.json +4 -0
- package/internal/tree/package.json +4 -0
- package/list/package.json +4 -0
- package/list-box/package.json +4 -0
- package/list-view/package.json +4 -0
- package/menubar/package.json +4 -0
- package/multi-select/package.json +4 -0
- package/notification/package.json +4 -0
- package/numeric-text-box/package.json +4 -0
- package/package.json +31 -5
- package/pager/package.json +4 -0
- package/placeholder/package.json +4 -0
- package/popover/package.json +4 -0
- package/popup/package.json +4 -0
- package/popup-menu/package.json +4 -0
- package/progress-bar/package.json +4 -0
- package/query/package.json +4 -0
- package/radio-button/package.json +4 -0
- package/scroll-view/package.json +4 -0
- package/slider/package.json +4 -0
- package/split-button/package.json +4 -0
- package/splitter/package.json +4 -0
- package/stepper/package.json +4 -0
- package/switch/package.json +4 -0
- package/tabs/package.json +4 -0
- package/text-area/package.json +4 -0
- package/text-box/package.json +4 -0
- package/theme/package.json +4 -0
- package/time-picker/package.json +4 -0
- package/time-selector/package.json +4 -0
- package/tooltip/package.json +4 -0
- package/tree-view/package.json +4 -0
- package/types/nanahoshi-mona-ui-auto-complete.d.ts +6 -7
- package/types/nanahoshi-mona-ui-breadcrumb.d.ts +4 -6
- package/types/nanahoshi-mona-ui-button-group.d.ts +2 -3
- package/types/nanahoshi-mona-ui-button.d.ts +6 -6
- package/types/nanahoshi-mona-ui-calendar.d.ts +21 -22
- package/types/nanahoshi-mona-ui-check-box.d.ts +6 -9
- package/types/nanahoshi-mona-ui-chip.d.ts +2 -3
- package/types/nanahoshi-mona-ui-circular-progress-bar.d.ts +2 -4
- package/types/nanahoshi-mona-ui-color-gradient.d.ts +10 -11
- package/types/nanahoshi-mona-ui-color-palette.d.ts +4 -5
- package/types/nanahoshi-mona-ui-color-picker.d.ts +6 -8
- package/types/nanahoshi-mona-ui-combo-box.d.ts +6 -7
- package/types/nanahoshi-mona-ui-date-input.d.ts +2 -3
- package/types/nanahoshi-mona-ui-date-picker.d.ts +2 -3
- package/types/nanahoshi-mona-ui-dialog.d.ts +7 -8
- package/types/nanahoshi-mona-ui-dropdown-list.d.ts +6 -7
- package/types/nanahoshi-mona-ui-dropdowns.d.ts +2 -3
- package/types/nanahoshi-mona-ui-editor.d.ts +17 -17
- package/types/nanahoshi-mona-ui-expansion-panel.d.ts +8 -10
- package/types/nanahoshi-mona-ui-fieldset.d.ts +6 -8
- package/types/nanahoshi-mona-ui-filter.d.ts +3 -4
- package/types/nanahoshi-mona-ui-grid.d.ts +16 -17
- package/types/nanahoshi-mona-ui-internal-indicator-icon.d.ts +0 -1
- package/types/nanahoshi-mona-ui-internal-tree.d.ts +16 -16
- package/types/nanahoshi-mona-ui-internal.d.ts +8 -1
- package/types/nanahoshi-mona-ui-list-box.d.ts +4 -5
- package/types/nanahoshi-mona-ui-list-view.d.ts +2 -3
- package/types/nanahoshi-mona-ui-menubar.d.ts +7 -8
- package/types/nanahoshi-mona-ui-multi-select.d.ts +8 -9
- package/types/nanahoshi-mona-ui-numeric-text-box.d.ts +2 -3
- package/types/nanahoshi-mona-ui-pager.d.ts +6 -7
- package/types/nanahoshi-mona-ui-placeholder.d.ts +4 -6
- package/types/nanahoshi-mona-ui-popover.d.ts +8 -9
- package/types/nanahoshi-mona-ui-popup-menu.d.ts +12 -13
- package/types/nanahoshi-mona-ui-progress-bar.d.ts +8 -9
- package/types/nanahoshi-mona-ui-radio-button.d.ts +8 -11
- package/types/nanahoshi-mona-ui-scroll-view.d.ts +18 -20
- package/types/nanahoshi-mona-ui-slider.d.ts +18 -18
- package/types/nanahoshi-mona-ui-split-button.d.ts +2 -3
- package/types/nanahoshi-mona-ui-splitter.d.ts +6 -8
- package/types/nanahoshi-mona-ui-stepper.d.ts +13 -14
- package/types/nanahoshi-mona-ui-switch.d.ts +6 -7
- package/types/nanahoshi-mona-ui-tabs.d.ts +15 -17
- package/types/nanahoshi-mona-ui-text-area.d.ts +2 -4
- package/types/nanahoshi-mona-ui-text-box.d.ts +4 -6
- package/types/nanahoshi-mona-ui-theme.d.ts +111 -12
- package/types/nanahoshi-mona-ui-time-picker.d.ts +2 -3
- package/types/nanahoshi-mona-ui-time-selector.d.ts +10 -11
- package/types/nanahoshi-mona-ui-tooltip.d.ts +4 -5
- package/types/nanahoshi-mona-ui-window.d.ts +16 -17
- package/window/package.json +4 -0
- package/fesm2022/nanahoshi-mona-ui-grid-grid-list.component-Dgea-O0X.mjs +0 -130
- package/fesm2022/nanahoshi-mona-ui-grid-grid-virtual-list.component-DRHycGIh.mjs +0 -240
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { C as CellEditEvent, w as GridAddCommandDirective, x as GridAddEvent, y as GridCancelCommandDirective, z as GridCancelEvent, A as GridCellTemplateDirective, B as GridColumnComponent, D as GridColumnTitleTemplateDirective, E as GridCommandColumnComponent, F as GridComponent, H as GridContextMenuDirective, I as GridDetailTemplateDirective, J as GridEditCommandDirective, K as GridEditEvent, L as GridEditTemplateDirective, M as GridEditableDirective, N as GridExportDirective, O as GridFilterableDirective, P as GridFooterTemplateDirective, Q as GridGroupFooterTemplateDirective, R as GridGroupableDirective, S as GridHeaderTemplateDirective, T as GridNoDataTemplateDirective, U as GridRemoveCommandDirective, V as GridRemoveEvent, W as GridReorderableDirective, X as GridResizableDirective, Y as GridSaveCommandDirective, Z as GridSaveEvent, _ as GridSelectableDirective, $ as GridSortableDirective, a0 as GridStatePersistenceDirective, a1 as GridToolbarTemplateDirective, a2 as GridVirtualScrollDirective, a3 as RowEditEvent } from './nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-
|
|
1
|
+
export { C as CellEditEvent, w as GridAddCommandDirective, x as GridAddEvent, y as GridCancelCommandDirective, z as GridCancelEvent, A as GridCellTemplateDirective, B as GridColumnComponent, D as GridColumnTitleTemplateDirective, E as GridCommandColumnComponent, F as GridComponent, H as GridContextMenuDirective, I as GridDetailTemplateDirective, J as GridEditCommandDirective, K as GridEditEvent, L as GridEditTemplateDirective, M as GridEditableDirective, N as GridExportDirective, O as GridFilterableDirective, P as GridFooterTemplateDirective, Q as GridGroupFooterTemplateDirective, R as GridGroupableDirective, S as GridHeaderTemplateDirective, T as GridNoDataTemplateDirective, U as GridRemoveCommandDirective, V as GridRemoveEvent, W as GridReorderableDirective, X as GridResizableDirective, Y as GridSaveCommandDirective, Z as GridSaveEvent, _ as GridSelectableDirective, $ as GridSortableDirective, a0 as GridStatePersistenceDirective, a1 as GridToolbarTemplateDirective, a2 as GridVirtualScrollDirective, a3 as RowEditEvent } from './nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-BRZUd8cE.mjs';
|
|
2
2
|
//# sourceMappingURL=nanahoshi-mona-ui-grid.mjs.map
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import {
|
|
2
|
+
import { computed, signal, viewChild, output, input, afterRenderEffect, untracked, Component } from '@angular/core';
|
|
3
3
|
import { LucideLoader, LucideChevronDown, LucideX, LucideDynamicIcon } from '@lucide/angular';
|
|
4
|
-
import { ThemeService } from '@nanahoshi/mona-ui/theme';
|
|
5
4
|
import { twMerge } from 'tailwind-merge';
|
|
6
5
|
import { cva } from 'class-variance-authority';
|
|
7
6
|
|
|
8
|
-
const
|
|
7
|
+
const indicatorIconHostThemeVariants = cva(`h-full aspect-square flex-none inline-flex items-center justify-center self-stretch`, {
|
|
9
8
|
variants: {
|
|
10
9
|
interactive: {
|
|
11
|
-
true:
|
|
10
|
+
true: `
|
|
11
|
+
opacity-50
|
|
12
|
+
hover:opacity-90
|
|
13
|
+
focus-visible:ring-2 focus-visible:ring-focus-indicator/35 focus-visible:outline-none
|
|
14
|
+
`,
|
|
12
15
|
false: ""
|
|
13
16
|
},
|
|
14
17
|
preset: {
|
|
@@ -21,7 +24,7 @@ const indicatorIconHostVariants = cva(`h-full aspect-square flex-none inline-fle
|
|
|
21
24
|
interactive: false
|
|
22
25
|
}
|
|
23
26
|
});
|
|
24
|
-
const
|
|
27
|
+
const indicatorIconSvgThemeVariants = cva(``, {
|
|
25
28
|
variants: {
|
|
26
29
|
loading: {
|
|
27
30
|
true: "animate-[spin_2s_linear_infinite]",
|
|
@@ -33,40 +36,19 @@ const indicatorIconSvgVariants = cva(``, {
|
|
|
33
36
|
}
|
|
34
37
|
});
|
|
35
38
|
|
|
36
|
-
const indicatorIconHostThemeVariants = (theme) => {
|
|
37
|
-
switch (theme) {
|
|
38
|
-
case "mona":
|
|
39
|
-
return indicatorIconHostVariants;
|
|
40
|
-
default:
|
|
41
|
-
return indicatorIconHostVariants;
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
const indicatorIconSvgThemeVariants = (theme) => {
|
|
45
|
-
switch (theme) {
|
|
46
|
-
case "mona":
|
|
47
|
-
return indicatorIconSvgVariants;
|
|
48
|
-
default:
|
|
49
|
-
return indicatorIconSvgVariants;
|
|
50
|
-
}
|
|
51
|
-
};
|
|
52
|
-
|
|
53
39
|
class IndicatorIconComponent {
|
|
54
|
-
#themeService;
|
|
55
40
|
constructor() {
|
|
56
|
-
this.#themeService = inject(ThemeService);
|
|
57
41
|
this.baseClass = computed(() => {
|
|
58
|
-
const theme = this.#themeService.theme();
|
|
59
42
|
const interactive = this.interactive();
|
|
60
43
|
const preset = this.preset();
|
|
61
|
-
return twMerge(indicatorIconHostThemeVariants(
|
|
44
|
+
return twMerge(indicatorIconHostThemeVariants({ interactive, preset }), this.userClass());
|
|
62
45
|
}, /* @ts-ignore */
|
|
63
46
|
...(ngDevMode ? [{ debugName: "baseClass" }] : /* istanbul ignore next */ []));
|
|
64
47
|
this.hasProjectedContent = signal(false, /* @ts-ignore */
|
|
65
48
|
...(ngDevMode ? [{ debugName: "hasProjectedContent" }] : /* istanbul ignore next */ []));
|
|
66
49
|
this.iconClass = computed(() => {
|
|
67
|
-
const theme = this.#themeService.theme();
|
|
68
50
|
const loading = this.preset() === "loading";
|
|
69
|
-
return indicatorIconSvgThemeVariants(
|
|
51
|
+
return indicatorIconSvgThemeVariants({ loading });
|
|
70
52
|
}, /* @ts-ignore */
|
|
71
53
|
...(ngDevMode ? [{ debugName: "iconClass" }] : /* istanbul ignore next */ []));
|
|
72
54
|
this.iconToRender = computed(() => {
|
|
@@ -8,9 +8,9 @@ import { FilterInputComponent } from '@nanahoshi/mona-ui/internal/filter-input';
|
|
|
8
8
|
import { PlaceholderComponent } from '@nanahoshi/mona-ui/placeholder';
|
|
9
9
|
import { Subject, ReplaySubject, fromEvent, asyncScheduler, filter, tap } from 'rxjs';
|
|
10
10
|
import { twMerge } from 'tailwind-merge';
|
|
11
|
-
import { cva } from 'class-variance-authority';
|
|
12
11
|
import { ImmutableList, from, ImmutableSet, toImmutableSet } from '@mirei/ts-collections';
|
|
13
12
|
import { v4 } from 'uuid';
|
|
13
|
+
import { cva } from 'class-variance-authority';
|
|
14
14
|
import * as i1 from '@angular/forms';
|
|
15
15
|
import { FormsModule } from '@angular/forms';
|
|
16
16
|
import { CheckboxDirective } from '@nanahoshi/mona-ui/check-box';
|
|
@@ -63,86 +63,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
63
63
|
}]
|
|
64
64
|
}] });
|
|
65
65
|
|
|
66
|
-
const listVariants = cva(`
|
|
67
|
-
h-full flex flex-col overflow-hidden outline-none
|
|
68
|
-
`);
|
|
69
|
-
const listInnerListVariants = cva(`
|
|
70
|
-
list-none p-0 m-0 overflow-x-hidden overflow-y-auto
|
|
71
|
-
h-full outline-none
|
|
72
|
-
`);
|
|
73
|
-
const listGroupHeaderVariants = cva(``, {
|
|
74
|
-
variants: {
|
|
75
|
-
hasTemplate: {
|
|
76
|
-
true: "",
|
|
77
|
-
false: "py-1 font-bold"
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
});
|
|
81
|
-
const listGroupHeaderTextVariants = cva(`select-none`, {
|
|
82
|
-
variants: {
|
|
83
|
-
hasTemplate: {
|
|
84
|
-
true: "",
|
|
85
|
-
false: "font-bold w-full px-3 py-1"
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
});
|
|
89
|
-
const listItemBaseVariants = cva(`
|
|
90
|
-
w-full h-full flex gap-2 items-center
|
|
91
|
-
`);
|
|
92
|
-
const listItemContentVariants = cva(`
|
|
93
|
-
relative flex cursor-default select-none items-center
|
|
94
|
-
outline-none px-3 py-1
|
|
95
|
-
hover:bg-accent hover:text-accent-foreground
|
|
96
|
-
focus:bg-accent focus:text-accent-foreground
|
|
97
|
-
`, {
|
|
98
|
-
variants: {
|
|
99
|
-
checkboxes: {
|
|
100
|
-
true: "gap-2",
|
|
101
|
-
false: ""
|
|
102
|
-
},
|
|
103
|
-
highlighted: {
|
|
104
|
-
true: "bg-accent text-accent-foreground rounded-none inset-ring-1 inset-ring-gray-400/70",
|
|
105
|
-
false: ""
|
|
106
|
-
},
|
|
107
|
-
selected: {
|
|
108
|
-
true: "bg-primary text-primary-foreground inset-ring-1 inset-ring-primary-foreground/40",
|
|
109
|
-
false: ""
|
|
110
|
-
},
|
|
111
|
-
disabled: {
|
|
112
|
-
true: "pointer-events-none opacity-50 cursor-default",
|
|
113
|
-
false: "cursor-pointer"
|
|
114
|
-
}
|
|
115
|
-
},
|
|
116
|
-
compoundVariants: [
|
|
117
|
-
{
|
|
118
|
-
selected: true,
|
|
119
|
-
checkboxes: false,
|
|
120
|
-
class: `
|
|
121
|
-
bg-primary text-primary-foreground rounded-none
|
|
122
|
-
inset-ring-1 inset-ring-primary-foreground/40
|
|
123
|
-
hover:bg-primary hover:text-primary-foreground
|
|
124
|
-
focus:bg-primary focus:text-primary-foreground
|
|
125
|
-
`
|
|
126
|
-
},
|
|
127
|
-
{
|
|
128
|
-
highlighted: true,
|
|
129
|
-
selected: true,
|
|
130
|
-
checkboxes: false,
|
|
131
|
-
class: `
|
|
132
|
-
bg-primary text-primary-foreground rounded-none
|
|
133
|
-
inset-ring-1 inset-ring-primary-foreground/40
|
|
134
|
-
hover:bg-primary hover:text-primary-foreground
|
|
135
|
-
focus:bg-primary focus:text-primary-foreground
|
|
136
|
-
`
|
|
137
|
-
},
|
|
138
|
-
{
|
|
139
|
-
selected: true,
|
|
140
|
-
checkboxes: true,
|
|
141
|
-
class: `bg-transparent text-foreground`
|
|
142
|
-
}
|
|
143
|
-
]
|
|
144
|
-
});
|
|
145
|
-
|
|
146
66
|
class ListItem {
|
|
147
67
|
constructor(options) {
|
|
148
68
|
this.header = "";
|
|
@@ -794,6 +714,51 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
794
714
|
type: Injectable
|
|
795
715
|
}] });
|
|
796
716
|
|
|
717
|
+
const listThemeVariants = cva(`flex h-full flex-col overflow-hidden bg-(--mona-list-background) outline-none`);
|
|
718
|
+
const listInnerListThemeVariants = cva(`m-0 h-full list-none overflow-x-hidden overflow-y-auto p-0 outline-none [scrollbar-color:var(--color-scrollbar-thumb)_var(--color-scrollbar-track)] [scrollbar-width:thin]`);
|
|
719
|
+
const listGroupHeaderThemeVariants = cva(``, {
|
|
720
|
+
variants: {
|
|
721
|
+
hasTemplate: {
|
|
722
|
+
true: "",
|
|
723
|
+
false: "border-y-[length:var(--mona-list-group-border-width)] border-border-subtle bg-(--mona-list-group-background) py-1 font-[var(--mona-list-group-font-weight)]"
|
|
724
|
+
}
|
|
725
|
+
}
|
|
726
|
+
});
|
|
727
|
+
const listGroupHeaderTextThemeVariants = cva(`select-none text-muted-foreground`, {
|
|
728
|
+
variants: {
|
|
729
|
+
hasTemplate: { true: "", false: "w-full px-3 py-1 font-[var(--mona-list-group-font-weight)]" }
|
|
730
|
+
}
|
|
731
|
+
});
|
|
732
|
+
const listItemBaseThemeVariants = cva(`flex h-full w-full items-center gap-2`);
|
|
733
|
+
const listItemContentThemeVariants = cva(`relative flex cursor-default select-none items-center px-3 py-1 text-foreground outline-none hover:bg-hover focus:bg-hover`, {
|
|
734
|
+
variants: {
|
|
735
|
+
checkboxes: { true: "gap-2", false: "" },
|
|
736
|
+
highlighted: {
|
|
737
|
+
true: "bg-hover text-foreground inset-ring-1 inset-ring-focus-indicator/35",
|
|
738
|
+
false: ""
|
|
739
|
+
},
|
|
740
|
+
selected: { true: "bg-(--color-selected) text-(--color-selected-foreground)", false: "" },
|
|
741
|
+
disabled: {
|
|
742
|
+
true: "pointer-events-none cursor-default bg-(--mona-list-disabled-background) text-disabled-foreground",
|
|
743
|
+
false: "cursor-pointer"
|
|
744
|
+
}
|
|
745
|
+
},
|
|
746
|
+
compoundVariants: [
|
|
747
|
+
{
|
|
748
|
+
selected: true,
|
|
749
|
+
checkboxes: false,
|
|
750
|
+
class: "bg-(--color-selected) text-(--color-selected-foreground) hover:bg-(--color-selected-hover) hover:text-(--color-selected-hover-foreground) focus:bg-(--color-selected-focus) focus:text-(--color-selected-focus-foreground)"
|
|
751
|
+
},
|
|
752
|
+
{
|
|
753
|
+
highlighted: true,
|
|
754
|
+
selected: true,
|
|
755
|
+
checkboxes: false,
|
|
756
|
+
class: "bg-(--color-selected) text-(--color-selected-foreground) inset-ring-1 inset-ring-focus-indicator/35 hover:bg-(--color-selected-hover) hover:text-(--color-selected-hover-foreground) focus:bg-(--color-selected-focus) focus:text-(--color-selected-focus-foreground)"
|
|
757
|
+
},
|
|
758
|
+
{ selected: true, checkboxes: true, class: "bg-transparent text-foreground" }
|
|
759
|
+
]
|
|
760
|
+
});
|
|
761
|
+
|
|
797
762
|
class ListItemDirective {
|
|
798
763
|
#listService;
|
|
799
764
|
constructor() {
|
|
@@ -821,7 +786,12 @@ class ListItemDirective {
|
|
|
821
786
|
const highlighted = this.highlighted();
|
|
822
787
|
const selected = this.selected();
|
|
823
788
|
const checkboxes = this.#listService.selectableOptions().checkboxes;
|
|
824
|
-
const classes =
|
|
789
|
+
const classes = listItemContentThemeVariants({
|
|
790
|
+
disabled,
|
|
791
|
+
highlighted,
|
|
792
|
+
selected,
|
|
793
|
+
checkboxes
|
|
794
|
+
});
|
|
825
795
|
return twMerge(classes);
|
|
826
796
|
}, /* @ts-ignore */
|
|
827
797
|
...(ngDevMode ? [{ debugName: "textClasses" }] : /* istanbul ignore next */ []));
|
|
@@ -895,7 +865,7 @@ class ListItemComponent {
|
|
|
895
865
|
if (isHeader) {
|
|
896
866
|
return ``;
|
|
897
867
|
}
|
|
898
|
-
return
|
|
868
|
+
return listItemBaseThemeVariants();
|
|
899
869
|
}, /* @ts-ignore */
|
|
900
870
|
...(ngDevMode ? [{ debugName: "baseClass" }] : /* istanbul ignore next */ []));
|
|
901
871
|
this.checkboxes = computed(() => {
|
|
@@ -924,7 +894,7 @@ class ListItemComponent {
|
|
|
924
894
|
const isHeader = this.isHeader();
|
|
925
895
|
if (isHeader) {
|
|
926
896
|
const hasTemplate = this.template() != null;
|
|
927
|
-
const classes =
|
|
897
|
+
const classes = listGroupHeaderTextThemeVariants({ hasTemplate });
|
|
928
898
|
return twMerge(classes);
|
|
929
899
|
}
|
|
930
900
|
return ``; // TODO
|
|
@@ -960,7 +930,7 @@ class ListComponent {
|
|
|
960
930
|
this.filterInput = viewChild(FilterInputComponent, /* @ts-ignore */
|
|
961
931
|
...(ngDevMode ? [{ debugName: "filterInput" }] : /* istanbul ignore next */ []));
|
|
962
932
|
this.classes = computed(() => {
|
|
963
|
-
const classes =
|
|
933
|
+
const classes = listThemeVariants();
|
|
964
934
|
return twMerge(classes);
|
|
965
935
|
}, /* @ts-ignore */
|
|
966
936
|
...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
|
|
@@ -968,7 +938,7 @@ class ListComponent {
|
|
|
968
938
|
this.groupHeaderClasses = computed(() => {
|
|
969
939
|
const listItemClass = this.listItemClass();
|
|
970
940
|
const hasTemplate = this.groupHeaderTemplate() != null;
|
|
971
|
-
const classes =
|
|
941
|
+
const classes = listGroupHeaderThemeVariants({ hasTemplate });
|
|
972
942
|
return twMerge(classes, listItemClass);
|
|
973
943
|
}, /* @ts-ignore */
|
|
974
944
|
...(ngDevMode ? [{ debugName: "groupHeaderClasses" }] : /* istanbul ignore next */ []));
|
|
@@ -978,7 +948,7 @@ class ListComponent {
|
|
|
978
948
|
...(ngDevMode ? [{ debugName: "hostTabIndex" }] : /* istanbul ignore next */ []));
|
|
979
949
|
this.itemTemplate = contentChild(ListItemTemplateDirective, { ...(ngDevMode ? { debugName: "itemTemplate" } : /* istanbul ignore next */ {}), read: TemplateRef });
|
|
980
950
|
this.innerListClasses = computed(() => {
|
|
981
|
-
const classes =
|
|
951
|
+
const classes = listInnerListThemeVariants();
|
|
982
952
|
const listClass = this.listClass();
|
|
983
953
|
return twMerge(classes, listClass);
|
|
984
954
|
}, /* @ts-ignore */
|