mn-angular-lib 1.0.178 → 1.0.179

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.
Files changed (66) hide show
  1. package/fesm2022/mn-angular-lib-alert.mjs +535 -0
  2. package/fesm2022/mn-angular-lib-alert.mjs.map +1 -0
  3. package/fesm2022/mn-angular-lib-bottom-sheet.mjs +356 -0
  4. package/fesm2022/mn-angular-lib-bottom-sheet.mjs.map +1 -0
  5. package/fesm2022/mn-angular-lib-button.mjs +382 -0
  6. package/fesm2022/mn-angular-lib-button.mjs.map +1 -0
  7. package/fesm2022/mn-angular-lib-calendar-core.mjs +377 -0
  8. package/fesm2022/mn-angular-lib-calendar-core.mjs.map +1 -0
  9. package/fesm2022/mn-angular-lib-calendar.mjs +1513 -0
  10. package/fesm2022/mn-angular-lib-calendar.mjs.map +1 -0
  11. package/fesm2022/mn-angular-lib-collection.mjs +2277 -0
  12. package/fesm2022/mn-angular-lib-collection.mjs.map +1 -0
  13. package/fesm2022/mn-angular-lib-core.mjs +1232 -0
  14. package/fesm2022/mn-angular-lib-core.mjs.map +1 -0
  15. package/fesm2022/mn-angular-lib-display.mjs +728 -0
  16. package/fesm2022/mn-angular-lib-display.mjs.map +1 -0
  17. package/fesm2022/mn-angular-lib-forms.mjs +4260 -0
  18. package/fesm2022/mn-angular-lib-forms.mjs.map +1 -0
  19. package/fesm2022/mn-angular-lib-keyboard.mjs +195 -0
  20. package/fesm2022/mn-angular-lib-keyboard.mjs.map +1 -0
  21. package/fesm2022/mn-angular-lib-modal-core.mjs +945 -0
  22. package/fesm2022/mn-angular-lib-modal-core.mjs.map +1 -0
  23. package/fesm2022/mn-angular-lib-modal-ui.mjs +2016 -0
  24. package/fesm2022/mn-angular-lib-modal-ui.mjs.map +1 -0
  25. package/fesm2022/mn-angular-lib-modal.mjs +126 -0
  26. package/fesm2022/mn-angular-lib-modal.mjs.map +1 -0
  27. package/fesm2022/mn-angular-lib-rich-text-editor.mjs +275 -0
  28. package/fesm2022/mn-angular-lib-rich-text-editor.mjs.map +1 -0
  29. package/fesm2022/mn-angular-lib-segmented.mjs +246 -0
  30. package/fesm2022/mn-angular-lib-segmented.mjs.map +1 -0
  31. package/fesm2022/mn-angular-lib-tab.mjs +573 -0
  32. package/fesm2022/mn-angular-lib-tab.mjs.map +1 -0
  33. package/fesm2022/mn-angular-lib.mjs +21 -15517
  34. package/fesm2022/mn-angular-lib.mjs.map +1 -1
  35. package/package.json +66 -1
  36. package/src/lib/styles/index.css +2 -2
  37. package/types/mn-angular-lib-alert.d.ts +258 -0
  38. package/types/mn-angular-lib-bottom-sheet.d.ts +173 -0
  39. package/types/mn-angular-lib-button.d.ts +318 -0
  40. package/types/mn-angular-lib-calendar-core.d.ts +378 -0
  41. package/types/mn-angular-lib-calendar.d.ts +636 -0
  42. package/types/mn-angular-lib-collection.d.ts +1550 -0
  43. package/types/mn-angular-lib-core.d.ts +756 -0
  44. package/types/mn-angular-lib-display.d.ts +1075 -0
  45. package/types/mn-angular-lib-forms.d.ts +3235 -0
  46. package/types/mn-angular-lib-keyboard.d.ts +128 -0
  47. package/types/mn-angular-lib-modal-core.d.ts +1130 -0
  48. package/types/mn-angular-lib-modal-ui.d.ts +492 -0
  49. package/types/mn-angular-lib-modal.d.ts +27 -0
  50. package/types/mn-angular-lib-rich-text-editor.d.ts +157 -0
  51. package/types/mn-angular-lib-segmented.d.ts +395 -0
  52. package/types/mn-angular-lib-tab.d.ts +313 -0
  53. package/types/mn-angular-lib.d.ts +16 -10822
  54. /package/{src/lib/features → alert/src}/mn-alert/mn-alert-outlet/mn-alert-outlet.css +0 -0
  55. /package/{src/lib/features → bottom-sheet/src}/mn-bottom-sheet/mn-bottom-sheet.component.css +0 -0
  56. /package/{src/lib/features → button/src}/mn-skeleton/mn-skeleton.css +0 -0
  57. /package/{src/lib/features → collection/src}/mn-list/mn-list.component.css +0 -0
  58. /package/{src/lib/features → forms/src}/mn-checkbox/mn-checkbox.css +0 -0
  59. /package/{src/lib/features → forms/src}/mn-dropdown/mn-dropdown.css +0 -0
  60. /package/{src/lib/features → forms/src}/mn-multi-select/mn-multi-select.css +0 -0
  61. /package/{src/lib/features → keyboard/src}/mn-keyboard/mn-keyboard.component.css +0 -0
  62. /package/{src/lib/features → modal-ui/src}/mn-modal/components/mn-confirmation-body/mn-confirmation-body.component.css +0 -0
  63. /package/{src/lib/features → modal-ui/src}/mn-modal/components/mn-form-body/mn-form-body.component.css +0 -0
  64. /package/{src/lib/features → modal-ui/src}/mn-modal/components/mn-modal-shell/mn-modal-shell.component.css +0 -0
  65. /package/{src/lib/features → modal-ui/src}/mn-modal/components/mn-wizard-body/mn-wizard-body.component.css +0 -0
  66. /package/{src/lib/features → rich-text-editor/src}/mn-rich-text-editor/mn-rich-text-editor.component.css +0 -0
@@ -0,0 +1,195 @@
1
+ import * as i0 from '@angular/core';
2
+ import { EventEmitter, HostBinding, Output, Input, Component } from '@angular/core';
3
+ import { NgTemplateOutlet } from '@angular/common';
4
+ import { MnBottomSheet } from 'mn-angular-lib/bottom-sheet';
5
+
6
+ /** QWERTY letter rows, lower-case. Rendered upper-case when {@link MnKeyboard.uppercase} is set. */
7
+ const ALPHA_ROWS = [
8
+ ['q', 'w', 'e', 'r', 't', 'y', 'u', 'i', 'o', 'p'],
9
+ ['a', 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l'],
10
+ ['z', 'x', 'c', 'v', 'b', 'n', 'm'],
11
+ ];
12
+ /** The digit row that sits above the letters on an alphanumeric keyboard. */
13
+ const DIGIT_ROW = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '0'];
14
+ /** Phone-style pad rows for the numeric layout. */
15
+ const NUMERIC_ROWS = [
16
+ ['1', '2', '3'],
17
+ ['4', '5', '6'],
18
+ ['7', '8', '9'],
19
+ ['0'],
20
+ ];
21
+ /**
22
+ * An on-screen keyboard for touch devices that have no keyboard of their own.
23
+ *
24
+ * It exists for unattended screens — a tablet on a wall, a kiosk by a door — where
25
+ * the OS keyboard is either unavailable or unwanted, and where the same field may
26
+ * need to take a membership number *or* a name. Hence one component with a
27
+ * {@link layout} switch rather than a separate number pad and text pad.
28
+ *
29
+ * It is a controlled component: it never owns the text. The host passes {@link value}
30
+ * and reacts to {@link valueChange}, exactly like a form control, so the same value
31
+ * can also be filled by a barcode scanner or a real keyboard without this component
32
+ * fighting it.
33
+ *
34
+ * With {@link presentation} set to `sheet` it mounts inside an {@link MnBottomSheet},
35
+ * rising from the bottom of the screen and swipeable away — the shape a kiosk wants
36
+ * so the keys do not permanently occupy half the display.
37
+ *
38
+ * The library ships no user-facing English, so every named key takes its caption
39
+ * from {@link labels}.
40
+ */
41
+ class MnKeyboard {
42
+ /** The current text. This component never mutates it — see {@link valueChange}. */
43
+ value = '';
44
+ /** Which keys to render. */
45
+ layout = 'alphanumeric';
46
+ /** Whether the keys sit in the page or rise from the bottom as a sheet. */
47
+ presentation = 'inline';
48
+ /**
49
+ * Captions and accessible names for the named keys.
50
+ *
51
+ * The defaults are language-neutral glyphs rather than words, so a consumer that
52
+ * forgets to translate still ships no English (or Dutch) from the library. The
53
+ * accessible name for the keyboard as a whole has no neutral glyph, so it
54
+ * defaults to empty and the attribute is simply omitted until a host supplies one.
55
+ */
56
+ labels = {
57
+ backspace: '⌫',
58
+ clear: '⨯',
59
+ space: '␣',
60
+ submit: '⏎',
61
+ keyboard: '',
62
+ };
63
+ /** Whether letters are rendered (and typed) upper-case. */
64
+ uppercase = false;
65
+ /** Whether to offer a space key. Off for a field that can never contain one. */
66
+ allowSpace = true;
67
+ /** Whether to offer a submit key. */
68
+ showSubmit = true;
69
+ /** Whether the submit key is currently actionable. */
70
+ submitDisabled = false;
71
+ /** Hard cap on the text length, or null for none. */
72
+ maxLength = null;
73
+ /** Cap on the sheet height as a fraction of the viewport, in vh (sheet presentation only). */
74
+ sheetMaxHeightVh = 60;
75
+ /** Emits the full text after every key press, so the host can drive its own field. */
76
+ valueChange = new EventEmitter();
77
+ /** Emits when the submit key is pressed. */
78
+ submitted = new EventEmitter();
79
+ /** Emits when a sheet-presented keyboard is swiped or tapped away. */
80
+ dismissed = new EventEmitter();
81
+ get hostClasses() {
82
+ return `mn-keyboard mn-keyboard-${this.layout}`;
83
+ }
84
+ /** The character rows to render, driven by {@link layout}. */
85
+ get rows() {
86
+ if (this.layout === 'numeric') {
87
+ return NUMERIC_ROWS;
88
+ }
89
+ const letters = this.uppercase
90
+ ? ALPHA_ROWS.map((row) => row.map((key) => key.toUpperCase()))
91
+ : ALPHA_ROWS;
92
+ return this.layout === 'alpha' ? letters : [[...DIGIT_ROW], ...letters];
93
+ }
94
+ /** Whether the space key should be offered (never on a digits-only pad). */
95
+ get spaceVisible() {
96
+ return this.allowSpace && this.layout !== 'numeric';
97
+ }
98
+ /**
99
+ * Appends a character, respecting {@link maxLength}.
100
+ * @param key The character pressed.
101
+ */
102
+ press(key) {
103
+ this.emit(this.value + key);
104
+ }
105
+ /** Appends a space. */
106
+ pressSpace() {
107
+ this.emit(this.value + ' ');
108
+ }
109
+ /** Removes the last character. */
110
+ backspace() {
111
+ this.emit(this.value.slice(0, -1));
112
+ }
113
+ /** Empties the field. */
114
+ clear() {
115
+ this.emit('');
116
+ }
117
+ /** Reports a submit press. The host decides what submitting means. */
118
+ submit() {
119
+ if (this.submitDisabled) {
120
+ return;
121
+ }
122
+ this.submitted.emit(this.value);
123
+ }
124
+ /** Reports that a sheet-presented keyboard was dismissed. */
125
+ onDismiss() {
126
+ this.dismissed.emit();
127
+ }
128
+ /**
129
+ * Emits a new value, clamped to {@link maxLength}.
130
+ *
131
+ * Clamping happens here rather than in each key handler so a paste-like burst
132
+ * from a scanner and a tapped key are bounded the same way.
133
+ * @param next The candidate text.
134
+ */
135
+ emit(next) {
136
+ const clamped = this.maxLength !== null && next.length > this.maxLength
137
+ ? next.slice(0, this.maxLength)
138
+ : next;
139
+ if (clamped === this.value) {
140
+ return;
141
+ }
142
+ this.value = clamped;
143
+ this.valueChange.emit(clamped);
144
+ }
145
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: MnKeyboard, deps: [], target: i0.ɵɵFactoryTarget.Component });
146
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.3", type: MnKeyboard, isStandalone: true, selector: "mn-keyboard", inputs: { value: "value", layout: "layout", presentation: "presentation", labels: "labels", uppercase: "uppercase", allowSpace: "allowSpace", showSubmit: "showSubmit", submitDisabled: "submitDisabled", maxLength: "maxLength", sheetMaxHeightVh: "sheetMaxHeightVh" }, outputs: { valueChange: "valueChange", submitted: "submitted", dismissed: "dismissed" }, host: { properties: { "class": "this.hostClasses" } }, ngImport: i0, template: "<!-- The key block. Rendered directly for `inline`, or projected into the sheet below. -->\n<ng-template #keys>\n <div [attr.aria-label]=\"labels.keyboard || null\" class=\"mn-keyboard-keys flex flex-col gap-2 p-3\" role=\"group\">\n @for (row of rows; track $index) {\n <div class=\"flex justify-center gap-2\">\n @for (key of row; track key) {\n <button\n (click)=\"press(key)\"\n class=\"mn-keyboard-key flex-1 rounded-lg border border-base-300 bg-base-100 py-4 text-xl font-semibold text-base-content shadow-sm transition-colors hover:bg-base-200 active:bg-base-300\"\n type=\"button\"\n >\n {{ key }}\n </button>\n }\n </div>\n }\n\n <div class=\"flex justify-center gap-2\">\n <button\n (click)=\"backspace()\"\n [attr.aria-label]=\"labels.backspace\"\n class=\"mn-keyboard-key mn-keyboard-key-action flex-1 rounded-lg border border-base-300 bg-base-200 py-4 text-base font-medium text-base-content shadow-sm transition-colors hover:bg-base-300\"\n type=\"button\"\n >\n {{ labels.backspace }}\n </button>\n\n @if (spaceVisible) {\n <button\n (click)=\"pressSpace()\"\n [attr.aria-label]=\"labels.space\"\n class=\"mn-keyboard-key mn-keyboard-key-space flex-1 rounded-lg border border-base-300 bg-base-200 py-4 text-base font-medium text-base-content shadow-sm transition-colors hover:bg-base-300\"\n style=\"flex-grow: 3\"\n type=\"button\"\n >\n {{ labels.space }}\n </button>\n }\n\n <button\n (click)=\"clear()\"\n [attr.aria-label]=\"labels.clear\"\n class=\"mn-keyboard-key mn-keyboard-key-action flex-1 rounded-lg border border-base-300 bg-base-200 py-4 text-base font-medium text-base-content shadow-sm transition-colors hover:bg-base-300\"\n type=\"button\"\n >\n {{ labels.clear }}\n </button>\n\n @if (showSubmit) {\n <button\n (click)=\"submit()\"\n [attr.aria-label]=\"labels.submit\"\n [disabled]=\"submitDisabled\"\n class=\"mn-keyboard-key mn-keyboard-key-submit flex-1 rounded-lg bg-primary py-4 text-base font-semibold text-primary-content shadow-sm transition-colors hover:opacity-90 disabled:opacity-50\"\n style=\"flex-grow: 2\"\n type=\"button\"\n >\n {{ labels.submit }}\n </button>\n }\n </div>\n </div>\n</ng-template>\n\n@if (presentation === 'sheet') {\n <mn-bottom-sheet\n (dismiss)=\"onDismiss()\"\n [ariaLabel]=\"labels.keyboard || undefined\"\n [maxHeightVh]=\"sheetMaxHeightVh\"\n >\n <ng-container [ngTemplateOutlet]=\"keys\"></ng-container>\n </mn-bottom-sheet>\n} @else {\n <ng-container [ngTemplateOutlet]=\"keys\"></ng-container>\n}\n", styles: [":host{display:block}.mn-keyboard-key{-webkit-tap-highlight-color:transparent;-webkit-user-select:none;user-select:none;touch-action:manipulation}\n"], dependencies: [{ kind: "component", type: MnBottomSheet, selector: "mn-bottom-sheet", inputs: ["showBackdrop", "showGrabber", "dismissible", "minHeightPx", "maxHeightVh", "containerClass", "ariaLabel", "ariaLabelledby", "growWithKeyboard", "dismissGuard"], outputs: ["dismiss"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
147
+ }
148
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: MnKeyboard, decorators: [{
149
+ type: Component,
150
+ args: [{ selector: 'mn-keyboard', standalone: true, imports: [MnBottomSheet, NgTemplateOutlet], template: "<!-- The key block. Rendered directly for `inline`, or projected into the sheet below. -->\n<ng-template #keys>\n <div [attr.aria-label]=\"labels.keyboard || null\" class=\"mn-keyboard-keys flex flex-col gap-2 p-3\" role=\"group\">\n @for (row of rows; track $index) {\n <div class=\"flex justify-center gap-2\">\n @for (key of row; track key) {\n <button\n (click)=\"press(key)\"\n class=\"mn-keyboard-key flex-1 rounded-lg border border-base-300 bg-base-100 py-4 text-xl font-semibold text-base-content shadow-sm transition-colors hover:bg-base-200 active:bg-base-300\"\n type=\"button\"\n >\n {{ key }}\n </button>\n }\n </div>\n }\n\n <div class=\"flex justify-center gap-2\">\n <button\n (click)=\"backspace()\"\n [attr.aria-label]=\"labels.backspace\"\n class=\"mn-keyboard-key mn-keyboard-key-action flex-1 rounded-lg border border-base-300 bg-base-200 py-4 text-base font-medium text-base-content shadow-sm transition-colors hover:bg-base-300\"\n type=\"button\"\n >\n {{ labels.backspace }}\n </button>\n\n @if (spaceVisible) {\n <button\n (click)=\"pressSpace()\"\n [attr.aria-label]=\"labels.space\"\n class=\"mn-keyboard-key mn-keyboard-key-space flex-1 rounded-lg border border-base-300 bg-base-200 py-4 text-base font-medium text-base-content shadow-sm transition-colors hover:bg-base-300\"\n style=\"flex-grow: 3\"\n type=\"button\"\n >\n {{ labels.space }}\n </button>\n }\n\n <button\n (click)=\"clear()\"\n [attr.aria-label]=\"labels.clear\"\n class=\"mn-keyboard-key mn-keyboard-key-action flex-1 rounded-lg border border-base-300 bg-base-200 py-4 text-base font-medium text-base-content shadow-sm transition-colors hover:bg-base-300\"\n type=\"button\"\n >\n {{ labels.clear }}\n </button>\n\n @if (showSubmit) {\n <button\n (click)=\"submit()\"\n [attr.aria-label]=\"labels.submit\"\n [disabled]=\"submitDisabled\"\n class=\"mn-keyboard-key mn-keyboard-key-submit flex-1 rounded-lg bg-primary py-4 text-base font-semibold text-primary-content shadow-sm transition-colors hover:opacity-90 disabled:opacity-50\"\n style=\"flex-grow: 2\"\n type=\"button\"\n >\n {{ labels.submit }}\n </button>\n }\n </div>\n </div>\n</ng-template>\n\n@if (presentation === 'sheet') {\n <mn-bottom-sheet\n (dismiss)=\"onDismiss()\"\n [ariaLabel]=\"labels.keyboard || undefined\"\n [maxHeightVh]=\"sheetMaxHeightVh\"\n >\n <ng-container [ngTemplateOutlet]=\"keys\"></ng-container>\n </mn-bottom-sheet>\n} @else {\n <ng-container [ngTemplateOutlet]=\"keys\"></ng-container>\n}\n", styles: [":host{display:block}.mn-keyboard-key{-webkit-tap-highlight-color:transparent;-webkit-user-select:none;user-select:none;touch-action:manipulation}\n"] }]
151
+ }], propDecorators: { value: [{
152
+ type: Input
153
+ }], layout: [{
154
+ type: Input
155
+ }], presentation: [{
156
+ type: Input
157
+ }], labels: [{
158
+ type: Input
159
+ }], uppercase: [{
160
+ type: Input
161
+ }], allowSpace: [{
162
+ type: Input
163
+ }], showSubmit: [{
164
+ type: Input
165
+ }], submitDisabled: [{
166
+ type: Input
167
+ }], maxLength: [{
168
+ type: Input
169
+ }], sheetMaxHeightVh: [{
170
+ type: Input
171
+ }], valueChange: [{
172
+ type: Output
173
+ }], submitted: [{
174
+ type: Output
175
+ }], dismissed: [{
176
+ type: Output
177
+ }], hostClasses: [{
178
+ type: HostBinding,
179
+ args: ['class']
180
+ }] } });
181
+
182
+ /**
183
+ * Public API of the `mn-angular-lib/keyboard` entry point: the on-screen keyboard.
184
+ *
185
+ * Each entry point is its own module in the published package, so a consumer's bundler
186
+ * splits it into the chunk that uses it instead of loading the whole library at startup.
187
+ * The root `mn-angular-lib` entry re-exports every entry point.
188
+ */
189
+
190
+ /**
191
+ * Generated bundle index. Do not edit.
192
+ */
193
+
194
+ export { MnKeyboard };
195
+ //# sourceMappingURL=mn-angular-lib-keyboard.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mn-angular-lib-keyboard.mjs","sources":["../../../projects/mn-angular-lib/keyboard/src/mn-keyboard/mn-keyboard.component.ts","../../../projects/mn-angular-lib/keyboard/src/mn-keyboard/mn-keyboard.component.html","../../../projects/mn-angular-lib/keyboard/public-api.ts","../../../projects/mn-angular-lib/keyboard/mn-angular-lib-keyboard.ts"],"sourcesContent":["import {Component, EventEmitter, HostBinding, Input, Output} from '@angular/core';\nimport {NgTemplateOutlet} from '@angular/common';\nimport {MnBottomSheet} from 'mn-angular-lib/bottom-sheet';\nimport {MnKeyboardLabels, MnKeyboardLayout, MnKeyboardPresentation} from './mn-keyboard.types';\n\n/** QWERTY letter rows, lower-case. Rendered upper-case when {@link MnKeyboard.uppercase} is set. */\nconst ALPHA_ROWS: readonly string[][] = [\n ['q', 'w', 'e', 'r', 't', 'y', 'u', 'i', 'o', 'p'],\n ['a', 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l'],\n ['z', 'x', 'c', 'v', 'b', 'n', 'm'],\n];\n\n/** The digit row that sits above the letters on an alphanumeric keyboard. */\nconst DIGIT_ROW: readonly string[] = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '0'];\n\n/** Phone-style pad rows for the numeric layout. */\nconst NUMERIC_ROWS: readonly string[][] = [\n ['1', '2', '3'],\n ['4', '5', '6'],\n ['7', '8', '9'],\n ['0'],\n];\n\n/**\n * An on-screen keyboard for touch devices that have no keyboard of their own.\n *\n * It exists for unattended screens — a tablet on a wall, a kiosk by a door — where\n * the OS keyboard is either unavailable or unwanted, and where the same field may\n * need to take a membership number *or* a name. Hence one component with a\n * {@link layout} switch rather than a separate number pad and text pad.\n *\n * It is a controlled component: it never owns the text. The host passes {@link value}\n * and reacts to {@link valueChange}, exactly like a form control, so the same value\n * can also be filled by a barcode scanner or a real keyboard without this component\n * fighting it.\n *\n * With {@link presentation} set to `sheet` it mounts inside an {@link MnBottomSheet},\n * rising from the bottom of the screen and swipeable away — the shape a kiosk wants\n * so the keys do not permanently occupy half the display.\n *\n * The library ships no user-facing English, so every named key takes its caption\n * from {@link labels}.\n */\n@Component({\n selector: 'mn-keyboard',\n standalone: true,\n imports: [MnBottomSheet, NgTemplateOutlet],\n templateUrl: './mn-keyboard.component.html',\n styleUrl: './mn-keyboard.component.css',\n})\nexport class MnKeyboard {\n /** The current text. This component never mutates it — see {@link valueChange}. */\n @Input() value = '';\n /** Which keys to render. */\n @Input() layout: MnKeyboardLayout = 'alphanumeric';\n /** Whether the keys sit in the page or rise from the bottom as a sheet. */\n @Input() presentation: MnKeyboardPresentation = 'inline';\n /**\n * Captions and accessible names for the named keys.\n *\n * The defaults are language-neutral glyphs rather than words, so a consumer that\n * forgets to translate still ships no English (or Dutch) from the library. The\n * accessible name for the keyboard as a whole has no neutral glyph, so it\n * defaults to empty and the attribute is simply omitted until a host supplies one.\n */\n @Input() labels: MnKeyboardLabels = {\n backspace: '⌫',\n clear: '⨯',\n space: '␣',\n submit: '⏎',\n keyboard: '',\n };\n /** Whether letters are rendered (and typed) upper-case. */\n @Input() uppercase = false;\n /** Whether to offer a space key. Off for a field that can never contain one. */\n @Input() allowSpace = true;\n /** Whether to offer a submit key. */\n @Input() showSubmit = true;\n /** Whether the submit key is currently actionable. */\n @Input() submitDisabled = false;\n /** Hard cap on the text length, or null for none. */\n @Input() maxLength: number | null = null;\n /** Cap on the sheet height as a fraction of the viewport, in vh (sheet presentation only). */\n @Input() sheetMaxHeightVh = 60;\n\n /** Emits the full text after every key press, so the host can drive its own field. */\n @Output() valueChange = new EventEmitter<string>();\n /** Emits when the submit key is pressed. */\n @Output() submitted = new EventEmitter<string>();\n /** Emits when a sheet-presented keyboard is swiped or tapped away. */\n @Output() dismissed = new EventEmitter<void>();\n\n @HostBinding('class') get hostClasses(): string {\n return `mn-keyboard mn-keyboard-${this.layout}`;\n }\n\n /** The character rows to render, driven by {@link layout}. */\n get rows(): readonly string[][] {\n if (this.layout === 'numeric') {\n return NUMERIC_ROWS;\n }\n const letters = this.uppercase\n ? ALPHA_ROWS.map((row) => row.map((key) => key.toUpperCase()))\n : ALPHA_ROWS;\n return this.layout === 'alpha' ? letters : [[...DIGIT_ROW], ...letters];\n }\n\n /** Whether the space key should be offered (never on a digits-only pad). */\n get spaceVisible(): boolean {\n return this.allowSpace && this.layout !== 'numeric';\n }\n\n /**\n * Appends a character, respecting {@link maxLength}.\n * @param key The character pressed.\n */\n press(key: string): void {\n this.emit(this.value + key);\n }\n\n /** Appends a space. */\n pressSpace(): void {\n this.emit(this.value + ' ');\n }\n\n /** Removes the last character. */\n backspace(): void {\n this.emit(this.value.slice(0, -1));\n }\n\n /** Empties the field. */\n clear(): void {\n this.emit('');\n }\n\n /** Reports a submit press. The host decides what submitting means. */\n submit(): void {\n if (this.submitDisabled) {\n return;\n }\n this.submitted.emit(this.value);\n }\n\n /** Reports that a sheet-presented keyboard was dismissed. */\n onDismiss(): void {\n this.dismissed.emit();\n }\n\n /**\n * Emits a new value, clamped to {@link maxLength}.\n *\n * Clamping happens here rather than in each key handler so a paste-like burst\n * from a scanner and a tapped key are bounded the same way.\n * @param next The candidate text.\n */\n private emit(next: string): void {\n const clamped =\n this.maxLength !== null && next.length > this.maxLength\n ? next.slice(0, this.maxLength)\n : next;\n if (clamped === this.value) {\n return;\n }\n this.value = clamped;\n this.valueChange.emit(clamped);\n }\n}\n","<!-- The key block. Rendered directly for `inline`, or projected into the sheet below. -->\n<ng-template #keys>\n <div [attr.aria-label]=\"labels.keyboard || null\" class=\"mn-keyboard-keys flex flex-col gap-2 p-3\" role=\"group\">\n @for (row of rows; track $index) {\n <div class=\"flex justify-center gap-2\">\n @for (key of row; track key) {\n <button\n (click)=\"press(key)\"\n class=\"mn-keyboard-key flex-1 rounded-lg border border-base-300 bg-base-100 py-4 text-xl font-semibold text-base-content shadow-sm transition-colors hover:bg-base-200 active:bg-base-300\"\n type=\"button\"\n >\n {{ key }}\n </button>\n }\n </div>\n }\n\n <div class=\"flex justify-center gap-2\">\n <button\n (click)=\"backspace()\"\n [attr.aria-label]=\"labels.backspace\"\n class=\"mn-keyboard-key mn-keyboard-key-action flex-1 rounded-lg border border-base-300 bg-base-200 py-4 text-base font-medium text-base-content shadow-sm transition-colors hover:bg-base-300\"\n type=\"button\"\n >\n {{ labels.backspace }}\n </button>\n\n @if (spaceVisible) {\n <button\n (click)=\"pressSpace()\"\n [attr.aria-label]=\"labels.space\"\n class=\"mn-keyboard-key mn-keyboard-key-space flex-1 rounded-lg border border-base-300 bg-base-200 py-4 text-base font-medium text-base-content shadow-sm transition-colors hover:bg-base-300\"\n style=\"flex-grow: 3\"\n type=\"button\"\n >\n {{ labels.space }}\n </button>\n }\n\n <button\n (click)=\"clear()\"\n [attr.aria-label]=\"labels.clear\"\n class=\"mn-keyboard-key mn-keyboard-key-action flex-1 rounded-lg border border-base-300 bg-base-200 py-4 text-base font-medium text-base-content shadow-sm transition-colors hover:bg-base-300\"\n type=\"button\"\n >\n {{ labels.clear }}\n </button>\n\n @if (showSubmit) {\n <button\n (click)=\"submit()\"\n [attr.aria-label]=\"labels.submit\"\n [disabled]=\"submitDisabled\"\n class=\"mn-keyboard-key mn-keyboard-key-submit flex-1 rounded-lg bg-primary py-4 text-base font-semibold text-primary-content shadow-sm transition-colors hover:opacity-90 disabled:opacity-50\"\n style=\"flex-grow: 2\"\n type=\"button\"\n >\n {{ labels.submit }}\n </button>\n }\n </div>\n </div>\n</ng-template>\n\n@if (presentation === 'sheet') {\n <mn-bottom-sheet\n (dismiss)=\"onDismiss()\"\n [ariaLabel]=\"labels.keyboard || undefined\"\n [maxHeightVh]=\"sheetMaxHeightVh\"\n >\n <ng-container [ngTemplateOutlet]=\"keys\"></ng-container>\n </mn-bottom-sheet>\n} @else {\n <ng-container [ngTemplateOutlet]=\"keys\"></ng-container>\n}\n","/**\n * Public API of the `mn-angular-lib/keyboard` entry point: the on-screen keyboard.\n *\n * Each entry point is its own module in the published package, so a consumer's bundler\n * splits it into the chunk that uses it instead of loading the whole library at startup.\n * The root `mn-angular-lib` entry re-exports every entry point.\n */\nexport * from './src/mn-keyboard';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;AAKA;AACA,MA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