@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
|
@@ -7,8 +7,7 @@ import * as i1 from '@angular/forms';
|
|
|
7
7
|
import { FormsModule } from '@angular/forms';
|
|
8
8
|
import { LucideChevronUp, LucideChevronDown } from '@lucide/angular';
|
|
9
9
|
import { ButtonDirective } from '@nanahoshi/mona-ui/button';
|
|
10
|
-
import { rxTimeout } from '@nanahoshi/mona-ui/internal';
|
|
11
|
-
import { ThemeService } from '@nanahoshi/mona-ui/theme';
|
|
10
|
+
import { themeControlSurfaceClasses, rxTimeout } from '@nanahoshi/mona-ui/internal';
|
|
12
11
|
import { Subject, filter, switchMap, of, tap, delay, concatMap, timer, takeUntil, distinctUntilChanged, map } from 'rxjs';
|
|
13
12
|
import { twMerge } from 'tailwind-merge';
|
|
14
13
|
import { TextBoxDirective } from '@nanahoshi/mona-ui/text-box';
|
|
@@ -26,26 +25,31 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
26
25
|
}]
|
|
27
26
|
}] });
|
|
28
27
|
|
|
29
|
-
const
|
|
30
|
-
flex
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
data-[disabled='true']:
|
|
41
|
-
data-[disabled='true']:
|
|
42
|
-
data-[disabled='true']:
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
28
|
+
const numericTextboxThemeVariants = cva(`
|
|
29
|
+
flex w-full min-w-0 items-center
|
|
30
|
+
overflow-hidden p-0
|
|
31
|
+
${themeControlSurfaceClasses} text-foreground
|
|
32
|
+
border border-input-border shadow-(--shadow-control)
|
|
33
|
+
outline-none
|
|
34
|
+
selection:bg-primary selection:text-primary-foreground
|
|
35
|
+
transition-[color,box-shadow,border] duration-300 ease-in-out
|
|
36
|
+
placeholder:text-muted-foreground
|
|
37
|
+
|
|
38
|
+
data-[disabled='true']:pointer-events-none
|
|
39
|
+
data-[disabled='true']:cursor-not-allowed
|
|
40
|
+
data-[disabled='true']:border-disabled-border
|
|
41
|
+
data-[disabled='true']:bg-disabled-background
|
|
42
|
+
data-[disabled='true']:text-disabled-foreground
|
|
43
|
+
data-[disabled='true']:shadow-none
|
|
44
|
+
data-[readonly='true']:cursor-default
|
|
45
|
+
|
|
46
|
+
focus-within:border-focus-indicator
|
|
47
|
+
focus-within:ring-2 focus-within:ring-focus-indicator/35
|
|
48
|
+
|
|
49
|
+
data-[invalid='true']:border-error
|
|
50
|
+
data-[invalid='true']:ring-2 data-[invalid='true']:ring-error/35
|
|
51
|
+
data-[invalid='true']:focus-within:border-error
|
|
52
|
+
data-[invalid='true']:focus-within:ring-error/35
|
|
49
53
|
`, {
|
|
50
54
|
variants: {
|
|
51
55
|
rounded: {
|
|
@@ -62,132 +66,103 @@ const numericTextboxVariants = cva(`
|
|
|
62
66
|
}
|
|
63
67
|
}
|
|
64
68
|
});
|
|
65
|
-
const
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
rounded-none
|
|
69
|
+
const numericTextboxInputThemeVariants = cva(`
|
|
70
|
+
h-full w-full
|
|
71
|
+
bg-transparent
|
|
72
|
+
border-0 shadow-none
|
|
73
|
+
rounded-none
|
|
74
|
+
outline-none ring-0
|
|
75
|
+
focus-visible:border-transparent focus-visible:ring-0
|
|
70
76
|
`, {
|
|
71
77
|
variants: {
|
|
72
78
|
leftRounded: {
|
|
73
|
-
full: `
|
|
74
|
-
rounded-tl-full rounded-bl-full
|
|
79
|
+
full: `
|
|
80
|
+
rounded-tl-full rounded-bl-full
|
|
75
81
|
`,
|
|
76
|
-
large: `
|
|
77
|
-
rounded-tl-lg rounded-bl-lg
|
|
82
|
+
large: `
|
|
83
|
+
rounded-tl-lg rounded-bl-lg
|
|
78
84
|
`,
|
|
79
|
-
medium: `
|
|
80
|
-
rounded-tl-md rounded-bl-md
|
|
85
|
+
medium: `
|
|
86
|
+
rounded-tl-md rounded-bl-md
|
|
81
87
|
`,
|
|
82
|
-
none: `
|
|
83
|
-
rounded-tl-none rounded-bl-none
|
|
88
|
+
none: `
|
|
89
|
+
rounded-tl-none rounded-bl-none
|
|
84
90
|
`,
|
|
85
|
-
small: `
|
|
86
|
-
rounded-tl-sm rounded-bl-sm
|
|
91
|
+
small: `
|
|
92
|
+
rounded-tl-sm rounded-bl-sm
|
|
87
93
|
`
|
|
88
94
|
},
|
|
89
95
|
rightRounded: {
|
|
90
|
-
full: `
|
|
91
|
-
rounded-tr-full rounded-br-full
|
|
92
|
-
data-[spinners='true']:rounded-tr-none data-[spinners='true']:rounded-br-none
|
|
96
|
+
full: `
|
|
97
|
+
rounded-tr-full rounded-br-full
|
|
98
|
+
data-[spinners='true']:rounded-tr-none data-[spinners='true']:rounded-br-none
|
|
93
99
|
`,
|
|
94
|
-
large: `
|
|
95
|
-
rounded-tr-lg rounded-br-lg
|
|
96
|
-
data-[spinners='true']:rounded-tr-none data-[spinners='true']:rounded-br-none
|
|
100
|
+
large: `
|
|
101
|
+
rounded-tr-lg rounded-br-lg
|
|
102
|
+
data-[spinners='true']:rounded-tr-none data-[spinners='true']:rounded-br-none
|
|
97
103
|
`,
|
|
98
|
-
medium: `
|
|
99
|
-
rounded-tr-md rounded-br-md
|
|
100
|
-
data-[spinners='true']:rounded-tr-none data-[spinners='true']:rounded-br-none
|
|
104
|
+
medium: `
|
|
105
|
+
rounded-tr-md rounded-br-md
|
|
106
|
+
data-[spinners='true']:rounded-tr-none data-[spinners='true']:rounded-br-none
|
|
101
107
|
`,
|
|
102
|
-
none: `
|
|
103
|
-
rounded-tr-none rounded-br-none
|
|
104
|
-
data-[spinners='true']:rounded-tr-none data-[spinners='true']:rounded-br-none
|
|
108
|
+
none: `
|
|
109
|
+
rounded-tr-none rounded-br-none
|
|
110
|
+
data-[spinners='true']:rounded-tr-none data-[spinners='true']:rounded-br-none
|
|
105
111
|
`,
|
|
106
|
-
small: `
|
|
107
|
-
rounded-tr-sm rounded-br-sm
|
|
108
|
-
data-[spinners='true']:rounded-tr-none data-[spinners='true']:rounded-br-none
|
|
112
|
+
small: `
|
|
113
|
+
rounded-tr-sm rounded-br-sm
|
|
114
|
+
data-[spinners='true']:rounded-tr-none data-[spinners='true']:rounded-br-none
|
|
109
115
|
`
|
|
110
116
|
}
|
|
111
117
|
}
|
|
112
118
|
});
|
|
113
|
-
const
|
|
114
|
-
h-full flex
|
|
115
|
-
overflow-y-hidden
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
[&>button]:items-center
|
|
119
|
-
[&>button]:p-0
|
|
120
|
-
[&>button]:rounded-none
|
|
121
|
-
|
|
122
|
-
[&>button]:first:rounded-
|
|
123
|
-
[&>button]:first:
|
|
124
|
-
[&>button]:
|
|
125
|
-
[&>button]:
|
|
126
|
-
[&>button]:last:rounded-
|
|
127
|
-
[&>button]:last:
|
|
128
|
-
[&>button]:last:rounded-tr-none
|
|
129
|
-
[&>button]:last:h-1/2
|
|
119
|
+
const numericTextboxButtonThemeVariants = cva(`
|
|
120
|
+
flex h-full flex-col
|
|
121
|
+
overflow-y-hidden
|
|
122
|
+
border-s border-border-subtle
|
|
123
|
+
|
|
124
|
+
[&>button]:flex [&>button]:flex-1 [&>button]:items-center
|
|
125
|
+
[&>button]:rounded-none [&>button]:p-0
|
|
126
|
+
[&>button]:first:rounded-tl-none
|
|
127
|
+
[&>button]:first:rounded-bl-none
|
|
128
|
+
[&>button]:first:rounded-br-none
|
|
129
|
+
[&>button]:first:h-1/2
|
|
130
|
+
[&>button]:last:rounded-tl-none
|
|
131
|
+
[&>button]:last:rounded-bl-none
|
|
132
|
+
[&>button]:last:rounded-tr-none
|
|
133
|
+
[&>button]:last:h-1/2
|
|
130
134
|
`, {
|
|
131
135
|
variants: {
|
|
132
136
|
size: {
|
|
133
|
-
large: "
|
|
134
|
-
medium: "
|
|
135
|
-
small: "
|
|
137
|
+
large: "w-16 min-w-16",
|
|
138
|
+
medium: "w-10 min-w-10",
|
|
139
|
+
small: "w-8 min-w-8"
|
|
136
140
|
}
|
|
137
141
|
}
|
|
138
142
|
});
|
|
139
143
|
|
|
140
|
-
const numericTextboxThemeVariants = (theme) => {
|
|
141
|
-
switch (theme) {
|
|
142
|
-
case "mona":
|
|
143
|
-
return numericTextboxVariants;
|
|
144
|
-
default:
|
|
145
|
-
return numericTextboxVariants; // Default to Mona styles
|
|
146
|
-
}
|
|
147
|
-
};
|
|
148
|
-
const numericTextboxInputThemeVariants = (theme) => {
|
|
149
|
-
switch (theme) {
|
|
150
|
-
case "mona":
|
|
151
|
-
return numericTextboxInputVariants;
|
|
152
|
-
default:
|
|
153
|
-
return numericTextboxInputVariants; // Default to Mona styles
|
|
154
|
-
}
|
|
155
|
-
};
|
|
156
|
-
const numericTextboxButtonThemeVariants = (theme) => {
|
|
157
|
-
switch (theme) {
|
|
158
|
-
case "mona":
|
|
159
|
-
return numericTextboxButtonVariants;
|
|
160
|
-
default:
|
|
161
|
-
return numericTextboxButtonVariants; // Default to Mona styles
|
|
162
|
-
}
|
|
163
|
-
};
|
|
164
|
-
|
|
165
144
|
class NumericTextBoxComponent {
|
|
166
145
|
#destroyRef;
|
|
167
146
|
#focusMonitor;
|
|
168
147
|
#hostElementRef;
|
|
169
|
-
#themeService;
|
|
170
148
|
constructor() {
|
|
171
149
|
this.#destroyRef = inject(DestroyRef);
|
|
172
150
|
this.#focusMonitor = inject(FocusMonitor);
|
|
173
151
|
this.#hostElementRef = inject((ElementRef));
|
|
174
|
-
this.#themeService = inject(ThemeService);
|
|
175
152
|
this.beforeInput$ = new Subject();
|
|
176
153
|
this.classes = computed(() => {
|
|
177
|
-
const theme = this.#themeService.theme();
|
|
178
154
|
const rounded = this.rounded();
|
|
179
155
|
const size = this.size();
|
|
180
|
-
const classes = numericTextboxThemeVariants(
|
|
156
|
+
const classes = numericTextboxThemeVariants({ rounded, size });
|
|
181
157
|
const userClass = this.userClass();
|
|
182
158
|
return twMerge(classes, userClass);
|
|
183
159
|
}, /* @ts-ignore */
|
|
184
160
|
...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
|
|
185
161
|
this.inputClasses = computed(() => {
|
|
186
|
-
const theme = this.#themeService.theme();
|
|
187
162
|
const hasPrefixTemplate = this.prefixTemplateList().length > 0;
|
|
188
163
|
const leftRounded = hasPrefixTemplate ? "none" : this.rounded();
|
|
189
164
|
const rightRounded = this.spinners() ? "none" : this.rounded();
|
|
190
|
-
const inputVariants = numericTextboxInputThemeVariants(
|
|
165
|
+
const inputVariants = numericTextboxInputThemeVariants({ leftRounded, rightRounded });
|
|
191
166
|
return twMerge(inputVariants);
|
|
192
167
|
}, /* @ts-ignore */
|
|
193
168
|
...(ngDevMode ? [{ debugName: "inputClasses" }] : /* istanbul ignore next */ []));
|
|
@@ -206,9 +181,8 @@ class NumericTextBoxComponent {
|
|
|
206
181
|
this.rawInputValue = signal("", /* @ts-ignore */
|
|
207
182
|
...(ngDevMode ? [{ debugName: "rawInputValue" }] : /* istanbul ignore next */ []));
|
|
208
183
|
this.spinButtonClasses = computed(() => {
|
|
209
|
-
const theme = this.#themeService.theme();
|
|
210
184
|
const size = this.size();
|
|
211
|
-
return numericTextboxButtonThemeVariants(
|
|
185
|
+
return numericTextboxButtonThemeVariants({ size });
|
|
212
186
|
}, /* @ts-ignore */
|
|
213
187
|
...(ngDevMode ? [{ debugName: "spinButtonClasses" }] : /* istanbul ignore next */ []));
|
|
214
188
|
this.spinButtonIconSize = computed(() => {
|
|
@@ -570,7 +544,7 @@ class NumericTextBoxComponent {
|
|
|
570
544
|
return parseFloat(sanitizedValue);
|
|
571
545
|
}
|
|
572
546
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: NumericTextBoxComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
573
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: NumericTextBoxComponent, isStandalone: true, selector: "mona-numeric-text-box", inputs: { ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null }, decimals: { classPropertyName: "decimals", publicName: "decimals", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, formatter: { classPropertyName: "formatter", publicName: "formatter", isSignal: true, isRequired: false, transformFunction: null }, maxValue: { classPropertyName: "maxValue", publicName: "maxValue", isSignal: true, isRequired: false, transformFunction: null }, minValue: { classPropertyName: "minValue", publicName: "minValue", isSignal: true, isRequired: false, transformFunction: null }, nullable: { classPropertyName: "nullable", publicName: "nullable", 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 }, invalid: { classPropertyName: "invalid", publicName: "invalid", 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 }, spinners: { classPropertyName: "spinners", publicName: "spinners", isSignal: true, isRequired: false, transformFunction: null }, step: { classPropertyName: "step", publicName: "step", isSignal: true, isRequired: false, transformFunction: null }, tabindex: { classPropertyName: "tabindex", publicName: "tabindex", isSignal: true, isRequired: false, transformFunction: null }, touched: { classPropertyName: "touched", publicName: "touched", 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", inputFocusOut: "inputFocusOut", touch: "touch", value: "valueChange" }, host: { properties: { "class": "classes()", "attr.data-disabled": "disabled() || null", "attr.data-invalid": "invalidInput() || null", "attr.data-readonly": "readonly() || null", "attr.data-required": "required() || null" } }, queries: [{ propertyName: "prefixTemplateList", predicate: NumericTextBoxPrefixTemplateDirective, read: TemplateRef, isSignal: true }], viewQueries: [{ propertyName: "valueTextBoxRef", first: true, predicate: ["valueTextBox"], descendants: true, isSignal: true }], ngImport: i0, template: "@for (prefixTemplate of prefixTemplateList(); track $index) {\
|
|
547
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: NumericTextBoxComponent, isStandalone: true, selector: "mona-numeric-text-box", inputs: { ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null }, decimals: { classPropertyName: "decimals", publicName: "decimals", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, formatter: { classPropertyName: "formatter", publicName: "formatter", isSignal: true, isRequired: false, transformFunction: null }, maxValue: { classPropertyName: "maxValue", publicName: "maxValue", isSignal: true, isRequired: false, transformFunction: null }, minValue: { classPropertyName: "minValue", publicName: "minValue", isSignal: true, isRequired: false, transformFunction: null }, nullable: { classPropertyName: "nullable", publicName: "nullable", 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 }, invalid: { classPropertyName: "invalid", publicName: "invalid", 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 }, spinners: { classPropertyName: "spinners", publicName: "spinners", isSignal: true, isRequired: false, transformFunction: null }, step: { classPropertyName: "step", publicName: "step", isSignal: true, isRequired: false, transformFunction: null }, tabindex: { classPropertyName: "tabindex", publicName: "tabindex", isSignal: true, isRequired: false, transformFunction: null }, touched: { classPropertyName: "touched", publicName: "touched", 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", inputFocusOut: "inputFocusOut", touch: "touch", value: "valueChange" }, host: { properties: { "class": "classes()", "attr.data-disabled": "disabled() || null", "attr.data-invalid": "invalidInput() || null", "attr.data-readonly": "readonly() || null", "attr.data-required": "required() || null" } }, queries: [{ propertyName: "prefixTemplateList", predicate: NumericTextBoxPrefixTemplateDirective, read: TemplateRef, isSignal: true }], viewQueries: [{ propertyName: "valueTextBoxRef", first: true, predicate: ["valueTextBox"], descendants: true, isSignal: true }], ngImport: i0, template: "@for (prefixTemplate of prefixTemplateList(); track $index) {\n <span class=\"flex h-full flex-none flex-wrap items-center overflow-hidden border-none\">\n <ng-container *ngTemplateOutlet=\"prefixTemplate\"></ng-container>\n </span>\n}\n<input\n monaTextBox\n [disabled]=\"disabled()\"\n [required]=\"required()\"\n [type]=\"'text'\"\n inputmode=\"numeric\"\n [readonly]=\"readonly()\"\n [tabIndex]=\"tabindex()\"\n [ngModel]=\"formattedValue()\"\n (ngModelChange)=\"applyRawValue($event)\"\n (keydown)=\"keydown$.next($event)\"\n (focus)=\"inputFocus.emit($event)\"\n (focusout)=\"inputFocusOut.emit($event)\"\n (blur)=\"onBlur($event)\"\n (beforeinput)=\"beforeInput$.next($event)\"\n (wheel)=\"wheel$.next($event)\"\n [size]=\"size()\"\n [class]=\"inputClasses()\"\n autocomplete=\"off\"\n role=\"spinbutton\"\n [attr.aria-disabled]=\"disabled()\"\n [attr.aria-invalid]=\"invalidInput() || null\"\n [attr.aria-readonly]=\"readonly()\"\n [attr.aria-required]=\"required()\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-valuenow]=\"value()\"\n [attr.aria-valuemin]=\"minValue()\"\n [attr.aria-valuemax]=\"maxValue()\"\n [attr.aria-valuetext]=\"formattedValue()\"\n [attr.data-spinners]=\"spinners()\"\n #valueTextBox />\n@if (spinners()) {\n <div [class]=\"spinButtonClasses()\">\n <button\n monaButton\n [disabled]=\"disabled()\"\n [tabindex]=\"-1\"\n look=\"ghost\"\n [size]=\"size()\"\n (mousedown)=\"$event.preventDefault()\"\n (pointerdown)=\"spin$.next('+')\"\n (pointerup)=\"spinStop$.next()\"\n (pointerleave)=\"spinStop$.next()\"\n aria-label=\"Increase value\">\n <svg lucideChevronUp [size]=\"spinButtonIconSize()\"></svg>\n </button>\n <button\n monaButton\n [disabled]=\"disabled()\"\n [tabindex]=\"-1\"\n look=\"ghost\"\n [size]=\"size()\"\n (mousedown)=\"$event.preventDefault()\"\n (pointerdown)=\"spin$.next('-')\"\n (pointerup)=\"spinStop$.next()\"\n (pointerleave)=\"spinStop$.next()\"\n aria-label=\"Decrease value\">\n <svg lucideChevronDown [size]=\"spinButtonIconSize()\"></svg>\n </button>\n </div>\n}\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: TextBoxDirective, selector: "input[monaTextBox]", inputs: ["rounded", "size", "class"] }, { 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", "toggleable", "class"], outputs: ["disabledChange", "loadingChange", "lookChange", "selectedChange"] }, { kind: "component", type: LucideChevronUp, selector: "svg[lucideChevronUp]" }, { kind: "component", type: LucideChevronDown, selector: "svg[lucideChevronDown]" }] }); }
|
|
574
548
|
}
|
|
575
549
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: NumericTextBoxComponent, decorators: [{
|
|
576
550
|
type: Component,
|
|
@@ -580,7 +554,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
580
554
|
"[attr.data-invalid]": "invalidInput() || null",
|
|
581
555
|
"[attr.data-readonly]": "readonly() || null",
|
|
582
556
|
"[attr.data-required]": "required() || null"
|
|
583
|
-
}, template: "@for (prefixTemplate of prefixTemplateList(); track $index) {\
|
|
557
|
+
}, template: "@for (prefixTemplate of prefixTemplateList(); track $index) {\n <span class=\"flex h-full flex-none flex-wrap items-center overflow-hidden border-none\">\n <ng-container *ngTemplateOutlet=\"prefixTemplate\"></ng-container>\n </span>\n}\n<input\n monaTextBox\n [disabled]=\"disabled()\"\n [required]=\"required()\"\n [type]=\"'text'\"\n inputmode=\"numeric\"\n [readonly]=\"readonly()\"\n [tabIndex]=\"tabindex()\"\n [ngModel]=\"formattedValue()\"\n (ngModelChange)=\"applyRawValue($event)\"\n (keydown)=\"keydown$.next($event)\"\n (focus)=\"inputFocus.emit($event)\"\n (focusout)=\"inputFocusOut.emit($event)\"\n (blur)=\"onBlur($event)\"\n (beforeinput)=\"beforeInput$.next($event)\"\n (wheel)=\"wheel$.next($event)\"\n [size]=\"size()\"\n [class]=\"inputClasses()\"\n autocomplete=\"off\"\n role=\"spinbutton\"\n [attr.aria-disabled]=\"disabled()\"\n [attr.aria-invalid]=\"invalidInput() || null\"\n [attr.aria-readonly]=\"readonly()\"\n [attr.aria-required]=\"required()\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-valuenow]=\"value()\"\n [attr.aria-valuemin]=\"minValue()\"\n [attr.aria-valuemax]=\"maxValue()\"\n [attr.aria-valuetext]=\"formattedValue()\"\n [attr.data-spinners]=\"spinners()\"\n #valueTextBox />\n@if (spinners()) {\n <div [class]=\"spinButtonClasses()\">\n <button\n monaButton\n [disabled]=\"disabled()\"\n [tabindex]=\"-1\"\n look=\"ghost\"\n [size]=\"size()\"\n (mousedown)=\"$event.preventDefault()\"\n (pointerdown)=\"spin$.next('+')\"\n (pointerup)=\"spinStop$.next()\"\n (pointerleave)=\"spinStop$.next()\"\n aria-label=\"Increase value\">\n <svg lucideChevronUp [size]=\"spinButtonIconSize()\"></svg>\n </button>\n <button\n monaButton\n [disabled]=\"disabled()\"\n [tabindex]=\"-1\"\n look=\"ghost\"\n [size]=\"size()\"\n (mousedown)=\"$event.preventDefault()\"\n (pointerdown)=\"spin$.next('-')\"\n (pointerup)=\"spinStop$.next()\"\n (pointerleave)=\"spinStop$.next()\"\n aria-label=\"Decrease value\">\n <svg lucideChevronDown [size]=\"spinButtonIconSize()\"></svg>\n </button>\n </div>\n}\n" }]
|
|
584
558
|
}], ctorParameters: () => [], propDecorators: { prefixTemplateList: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => NumericTextBoxPrefixTemplateDirective), { ...{
|
|
585
559
|
read: TemplateRef
|
|
586
560
|
}, isSignal: true }] }], valueTextBoxRef: [{ type: i0.ViewChild, args: ["valueTextBox", { isSignal: true }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-label", required: false }] }], decimals: [{ type: i0.Input, args: [{ isSignal: true, alias: "decimals", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], formatter: [{ type: i0.Input, args: [{ isSignal: true, alias: "formatter", required: false }] }], inputBlur: [{ type: i0.Output, args: ["inputBlur"] }], inputFocus: [{ type: i0.Output, args: ["inputFocus"] }], inputFocusOut: [{ type: i0.Output, args: ["inputFocusOut"] }], maxValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxValue", required: false }] }], minValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "minValue", required: false }] }], nullable: [{ type: i0.Input, args: [{ isSignal: true, alias: "nullable", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], rounded: [{ type: i0.Input, args: [{ isSignal: true, alias: "rounded", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], spinners: [{ type: i0.Input, args: [{ isSignal: true, alias: "spinners", required: false }] }], step: [{ type: i0.Input, args: [{ isSignal: true, alias: "step", required: false }] }], tabindex: [{ type: i0.Input, args: [{ isSignal: true, alias: "tabindex", required: false }] }], touch: [{ type: i0.Output, args: ["touch"] }], touched: [{ type: i0.Input, args: [{ isSignal: true, alias: "touched", 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"] }] } });
|