mn-angular-lib 1.0.178 → 1.0.180

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 +763 -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 +1147 -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,275 @@
1
+ import * as i0 from '@angular/core';
2
+ import { input, output, inject, ElementRef, viewChild, signal, afterNextRender, effect, untracked, ChangeDetectionStrategy, ViewEncapsulation, Component } from '@angular/core';
3
+ import { MnLanguageService } from 'mn-angular-lib/core';
4
+
5
+ /**
6
+ * Toolbar the editor renders when the consumer does not supply one. Deliberately
7
+ * small: it covers written prose, so there is no colour picker, no font picker
8
+ * and no image embedding (an image needs an upload and storage path the editor
9
+ * knows nothing about).
10
+ */
11
+ const DEFAULT_TOOLBAR = [
12
+ [{ header: [2, 3, false] }],
13
+ ['bold', 'italic', 'underline', 'strike'],
14
+ [{ list: 'ordered' }, { list: 'bullet' }],
15
+ ['blockquote', 'code-block'],
16
+ ['link'],
17
+ ['clean'],
18
+ ];
19
+ /** Where each control sits in the toolbar Quill builds. */
20
+ const CONTROL_SELECTORS = {
21
+ textStyle: '.ql-header .ql-picker-label',
22
+ bold: 'button.ql-bold',
23
+ italic: 'button.ql-italic',
24
+ underline: 'button.ql-underline',
25
+ strike: 'button.ql-strike',
26
+ orderedList: 'button.ql-list[value="ordered"]',
27
+ bulletList: 'button.ql-list[value="bullet"]',
28
+ blockquote: 'button.ql-blockquote',
29
+ codeBlock: 'button.ql-code-block',
30
+ link: 'button.ql-link',
31
+ clean: 'button.ql-clean',
32
+ };
33
+ /** Hover labels used when the consumer supplies neither a label nor a key. */
34
+ const DEFAULT_LABELS = {
35
+ textStyle: 'Text style',
36
+ bold: 'Bold',
37
+ italic: 'Italic',
38
+ underline: 'Underline',
39
+ strike: 'Strikethrough',
40
+ orderedList: 'Numbered list',
41
+ bulletList: 'Bulleted list',
42
+ blockquote: 'Quote',
43
+ codeBlock: 'Code block',
44
+ link: 'Link',
45
+ clean: 'Clear formatting',
46
+ };
47
+ /** Quill's document when it holds no text; treated as an empty value. */
48
+ const EMPTY_DOCUMENT = '<p><br></p>';
49
+ /**
50
+ * Thin wrapper around the {@link Quill} rich-text editor.
51
+ *
52
+ * Quill is used **directly** rather than through an Angular wrapper package: the
53
+ * wrapper libraries carry peer-dependency ranges that lag behind Angular's
54
+ * release train, and none of them add anything this component needs.
55
+ *
56
+ * Consumers must install `quill` themselves (it is an optional peer dependency)
57
+ * and load its snow theme, e.g. `node_modules/quill/dist/quill.snow.css` in the
58
+ * `styles` array of `angular.json`. Only the chrome around that theme — radius,
59
+ * borders, height limits and the toolbar tooltips — belongs to this component;
60
+ * recolouring Quill's own palette to an app theme stays with the app, because
61
+ * the same `.ql-snow` markup is normally reused to render stored HTML in places
62
+ * where no editor is mounted.
63
+ *
64
+ * Quill itself is pulled in with a dynamic `import()` when the editor mounts.
65
+ * This component sits in the library's single entry point, which apps import
66
+ * eagerly, so a static import would put the whole editor engine in every app's
67
+ * initial bundle — including the pages that never open one.
68
+ *
69
+ * Zoneless notes: nothing here relies on an implicit change-detection tick. The
70
+ * editor is created inside {@link afterNextRender} (the host element only exists
71
+ * after the first render pass) and every value that flows back out is written to
72
+ * a signal or emitted through an `output`, both of which schedule change
73
+ * detection themselves. No `setTimeout`, no manual `detectChanges`.
74
+ *
75
+ * The produced HTML is **not** trusted: sanitise it before rendering it anywhere.
76
+ *
77
+ * @example
78
+ * ```html
79
+ * <mn-rich-text-editor
80
+ * [content]="draft()"
81
+ * [placeholder]="'minutes.placeholder' | mnTranslate"
82
+ * [labelKeys]="{ bold: 'editor.bold', italic: 'editor.italic' }"
83
+ * (contentChange)="draft.set($event)">
84
+ * </mn-rich-text-editor>
85
+ * ```
86
+ */
87
+ class MnRichTextEditor {
88
+ /**
89
+ * The initial HTML content. Later changes are applied only when they differ
90
+ * from what the editor currently holds, so a parent echoing the emitted value
91
+ * back never moves the caret.
92
+ */
93
+ content = input('', ...(ngDevMode ? [{ debugName: "content" }] : []));
94
+ /** Placeholder shown while the editor is empty. */
95
+ placeholder = input('', ...(ngDevMode ? [{ debugName: "placeholder" }] : []));
96
+ /** Accessible label for the editing surface. */
97
+ ariaLabel = input('', ...(ngDevMode ? [{ debugName: "ariaLabel" }] : []));
98
+ /** Toolbar layout, in Quill's own format. Defaults to a prose-oriented set. */
99
+ toolbar = input(DEFAULT_TOOLBAR, ...(ngDevMode ? [{ debugName: "toolbar" }] : []));
100
+ /** Literal hover labels per toolbar control. */
101
+ labels = input({}, ...(ngDevMode ? [{ debugName: "labels" }] : []));
102
+ /** Translation keys per toolbar control; takes precedence over `labels`. */
103
+ labelKeys = input({}, ...(ngDevMode ? [{ debugName: "labelKeys" }] : []));
104
+ /**
105
+ * Utilities applied to the wrapper, for sizing the writing surface. Overriding
106
+ * this replaces the default height limits, so pass both bounds when you do.
107
+ */
108
+ editorClass = input('[&_.ql-editor]:max-h-104 [&_.ql-editor]:min-h-72 [&_.ql-editor]:overflow-y-auto', ...(ngDevMode ? [{ debugName: "editorClass" }] : []));
109
+ /** Emits the editor's HTML on every user edit. */
110
+ contentChange = output();
111
+ /**
112
+ * Chrome around Quill's snow theme: the field's radius, border and surface.
113
+ *
114
+ * Descendant variants rather than a stylesheet — the utilities come from the
115
+ * consuming app's Tailwind build (which scans this bundle), so they follow the
116
+ * app's theme tokens the same way the rest of the library does.
117
+ */
118
+ chromeClass = '[&_.ql-container.ql-snow]:rounded-b-xl [&_.ql-container.ql-snow]:border-base-300 ' +
119
+ '[&_.ql-container.ql-snow]:bg-base-100 [&_.ql-container.ql-snow]:text-base ' +
120
+ '[&_.ql-toolbar.ql-snow]:rounded-t-xl [&_.ql-toolbar.ql-snow]:border-base-300 ' +
121
+ '[&_.ql-toolbar.ql-snow]:bg-base-100';
122
+ /** Host element, used to keep DOM queries inside this component. */
123
+ host = inject(ElementRef);
124
+ /** Language service, used to resolve the toolbar labels from keys. */
125
+ lang = inject(MnLanguageService);
126
+ /** The container Quill mounts into. */
127
+ editorHost = viewChild.required('editorHost');
128
+ /** The live editor instance, or null before Quill has loaded. */
129
+ quill = null;
130
+ /** Whether the component is gone, so a late Quill load knows to stop. */
131
+ destroyed = false;
132
+ /** The last HTML this component emitted, used to skip redundant writes. */
133
+ lastEmitted = signal('', ...(ngDevMode ? [{ debugName: "lastEmitted" }] : []));
134
+ constructor() {
135
+ afterNextRender(() => void this.createEditor());
136
+ // Push a changed `content` input into a live editor. `lastEmitted` is read
137
+ // `untracked` on purpose: it must gate the write (skip when the incoming HTML
138
+ // already matches what we hold) WITHOUT making the effect depend on it. If it
139
+ // were tracked, every keystroke (which updates `lastEmitted`) would re-run the
140
+ // effect and re-paste the now-stale `content` seed — wiping the user's typing
141
+ // and resetting the caret after any wholesale reseed.
142
+ effect(() => {
143
+ const incoming = this.content();
144
+ if (!this.quill || incoming === untracked(this.lastEmitted))
145
+ return;
146
+ this.setEditorHtml(incoming);
147
+ });
148
+ }
149
+ /** Drops the editor reference so the instance can be garbage collected. */
150
+ ngOnDestroy() {
151
+ this.destroyed = true;
152
+ this.quill = null;
153
+ }
154
+ /** Moves focus into the editing surface. */
155
+ focusEditor() {
156
+ this.quill?.focus();
157
+ if (!this.quill) {
158
+ this.host.nativeElement.querySelector('.ql-editor')?.focus();
159
+ }
160
+ }
161
+ /**
162
+ * Loads Quill, builds the instance and wires its change handler.
163
+ *
164
+ * Nothing awaits this beyond the component itself: the surface appears once
165
+ * the engine has loaded, and until then the `content` effect is a no-op that
166
+ * the seeding below makes good.
167
+ */
168
+ async createEditor() {
169
+ const { default: QuillEditor } = await import('quill');
170
+ if (this.destroyed)
171
+ return;
172
+ const container = this.editorHost().nativeElement;
173
+ this.quill = new QuillEditor(container, {
174
+ theme: 'snow',
175
+ placeholder: this.placeholder(),
176
+ modules: { toolbar: this.toolbar() },
177
+ });
178
+ const label = this.ariaLabel();
179
+ if (label) {
180
+ this.quill.root.setAttribute('aria-label', label);
181
+ }
182
+ this.applyToolbarLabels();
183
+ this.setEditorHtml(this.content());
184
+ this.quill.on('text-change', () => this.emitCurrentHtml());
185
+ }
186
+ /**
187
+ * Gives each toolbar control a hover label, so hovering explains what the
188
+ * style does. Set on the Quill-generated DOM after init; a control the current
189
+ * toolbar does not render is simply skipped.
190
+ */
191
+ applyToolbarLabels() {
192
+ const toolbar = this.host.nativeElement.querySelector('.ql-toolbar');
193
+ if (!toolbar)
194
+ return;
195
+ const labels = this.labels();
196
+ const keys = this.labelKeys();
197
+ for (const [control, selector] of Object.entries(CONTROL_SELECTORS)) {
198
+ const element = toolbar.querySelector(selector);
199
+ if (!element)
200
+ continue;
201
+ element.classList.add('mn-rte-tooltip');
202
+ element.setAttribute('data-tip', this.resolveLabel(control, labels, keys));
203
+ }
204
+ }
205
+ /**
206
+ * Picks the hover label for one control.
207
+ * @param control The control being labelled.
208
+ * @param labels Literal labels supplied by the consumer.
209
+ * @param keys Translation keys supplied by the consumer.
210
+ * @returns The translated key, the literal label, or the built-in default.
211
+ */
212
+ resolveLabel(control, labels, keys) {
213
+ const key = keys[control];
214
+ if (key) {
215
+ // `t()` echoes the key back when the consumer has no translation for it;
216
+ // that is a miss, not a label, so fall through to the remaining sources.
217
+ const translated = this.lang.t(key);
218
+ if (translated !== key)
219
+ return translated;
220
+ }
221
+ return labels[control] ?? DEFAULT_LABELS[control];
222
+ }
223
+ /**
224
+ * Replaces the editor content with stored HTML. Quill parses it into its own
225
+ * document model, which silently drops anything it has no format for — a
226
+ * useful extra filter on top of the consumer's sanitiser.
227
+ * @param html The HTML to load into the editor.
228
+ */
229
+ setEditorHtml(html) {
230
+ if (!this.quill)
231
+ return;
232
+ // `dangerouslyPasteHTML` is Quill's documented name for "parse this HTML".
233
+ this.quill.clipboard.dangerouslyPasteHTML(html ?? '', 'silent');
234
+ this.lastEmitted.set(this.readHtml());
235
+ }
236
+ /** Emits the editor's current HTML, normalising Quill's "empty" document. */
237
+ emitCurrentHtml() {
238
+ const html = this.readHtml();
239
+ this.lastEmitted.set(html);
240
+ this.contentChange.emit(html);
241
+ }
242
+ /**
243
+ * Reads the editor's HTML.
244
+ * @returns The current HTML, or an empty string when the editor is blank.
245
+ */
246
+ readHtml() {
247
+ if (!this.quill)
248
+ return '';
249
+ // Quill leaves an empty paragraph behind after a clear; treat that as empty
250
+ // so an untouched editor does not count as authored content.
251
+ const html = this.quill.root.innerHTML;
252
+ return html === EMPTY_DOCUMENT ? '' : html;
253
+ }
254
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: MnRichTextEditor, deps: [], target: i0.ɵɵFactoryTarget.Component });
255
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.1.3", type: MnRichTextEditor, isStandalone: true, selector: "mn-rich-text-editor", inputs: { content: { classPropertyName: "content", publicName: "content", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, toolbar: { classPropertyName: "toolbar", publicName: "toolbar", isSignal: true, isRequired: false, transformFunction: null }, labels: { classPropertyName: "labels", publicName: "labels", isSignal: true, isRequired: false, transformFunction: null }, labelKeys: { classPropertyName: "labelKeys", publicName: "labelKeys", isSignal: true, isRequired: false, transformFunction: null }, editorClass: { classPropertyName: "editorClass", publicName: "editorClass", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { contentChange: "contentChange" }, viewQueries: [{ propertyName: "editorHost", first: true, predicate: ["editorHost"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"mn-rich-text-editor {{ chromeClass }} {{ editorClass() }}\">\n <div #editorHost></div>\n</div>\n", styles: [".mn-rich-text-editor .mn-rte-tooltip{position:relative}.mn-rich-text-editor .mn-rte-tooltip[data-tip]:after{content:attr(data-tip);position:absolute;bottom:100%;left:50%;translate:-50% -.375rem;padding:.25rem .5rem;border-radius:.375rem;background-color:var(--color-secondary);color:var(--color-secondary-content);font-size:.75rem;line-height:1rem;white-space:nowrap;pointer-events:none;opacity:0;transition:opacity .15s;z-index:50}.mn-rich-text-editor .mn-rte-tooltip[data-tip]:hover:after,.mn-rich-text-editor .mn-rte-tooltip[data-tip]:focus-visible:after{opacity:1}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
256
+ }
257
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: MnRichTextEditor, decorators: [{
258
+ type: Component,
259
+ args: [{ selector: 'mn-rich-text-editor', standalone: true, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"mn-rich-text-editor {{ chromeClass }} {{ editorClass() }}\">\n <div #editorHost></div>\n</div>\n", styles: [".mn-rich-text-editor .mn-rte-tooltip{position:relative}.mn-rich-text-editor .mn-rte-tooltip[data-tip]:after{content:attr(data-tip);position:absolute;bottom:100%;left:50%;translate:-50% -.375rem;padding:.25rem .5rem;border-radius:.375rem;background-color:var(--color-secondary);color:var(--color-secondary-content);font-size:.75rem;line-height:1rem;white-space:nowrap;pointer-events:none;opacity:0;transition:opacity .15s;z-index:50}.mn-rich-text-editor .mn-rte-tooltip[data-tip]:hover:after,.mn-rich-text-editor .mn-rte-tooltip[data-tip]:focus-visible:after{opacity:1}\n"] }]
260
+ }], ctorParameters: () => [], propDecorators: { content: [{ type: i0.Input, args: [{ isSignal: true, alias: "content", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], toolbar: [{ type: i0.Input, args: [{ isSignal: true, alias: "toolbar", required: false }] }], labels: [{ type: i0.Input, args: [{ isSignal: true, alias: "labels", required: false }] }], labelKeys: [{ type: i0.Input, args: [{ isSignal: true, alias: "labelKeys", required: false }] }], editorClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "editorClass", required: false }] }], contentChange: [{ type: i0.Output, args: ["contentChange"] }], editorHost: [{ type: i0.ViewChild, args: ['editorHost', { isSignal: true }] }] } });
261
+
262
+ /**
263
+ * Public API of the `mn-angular-lib/rich-text-editor` entry point: the rich-text editor.
264
+ *
265
+ * Each entry point is its own module in the published package, so a consumer's bundler
266
+ * splits it into the chunk that uses it instead of loading the whole library at startup.
267
+ * The root `mn-angular-lib` entry re-exports every entry point.
268
+ */
269
+
270
+ /**
271
+ * Generated bundle index. Do not edit.
272
+ */
273
+
274
+ export { MnRichTextEditor };
275
+ //# sourceMappingURL=mn-angular-lib-rich-text-editor.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mn-angular-lib-rich-text-editor.mjs","sources":["../../../projects/mn-angular-lib/rich-text-editor/src/mn-rich-text-editor/mn-rich-text-editor.component.ts","../../../projects/mn-angular-lib/rich-text-editor/src/mn-rich-text-editor/mn-rich-text-editor.component.html","../../../projects/mn-angular-lib/rich-text-editor/public-api.ts","../../../projects/mn-angular-lib/rich-text-editor/mn-angular-lib-rich-text-editor.ts"],"sourcesContent":["import {\n afterNextRender,\n ChangeDetectionStrategy,\n Component,\n effect,\n ElementRef,\n inject,\n input,\n OnDestroy,\n output,\n signal,\n untracked,\n viewChild,\n ViewEncapsulation,\n} from '@angular/core';\nimport type Quill from 'quill';\nimport {MnLanguageService} from 'mn-angular-lib/core';\nimport {MnRichTextEditorControl, MnRichTextEditorLabels, MnRichTextEditorToolbar,} from './mn-rich-text-editor.types';\n\n/**\n * Toolbar the editor renders when the consumer does not supply one. Deliberately\n * small: it covers written prose, so there is no colour picker, no font picker\n * and no image embedding (an image needs an upload and storage path the editor\n * knows nothing about).\n */\nconst DEFAULT_TOOLBAR: MnRichTextEditorToolbar = [\n [{header: [2, 3, false]}],\n ['bold', 'italic', 'underline', 'strike'],\n [{list: 'ordered'}, {list: 'bullet'}],\n ['blockquote', 'code-block'],\n ['link'],\n ['clean'],\n];\n\n/** Where each control sits in the toolbar Quill builds. */\nconst CONTROL_SELECTORS: Record<MnRichTextEditorControl, string> = {\n textStyle: '.ql-header .ql-picker-label',\n bold: 'button.ql-bold',\n italic: 'button.ql-italic',\n underline: 'button.ql-underline',\n strike: 'button.ql-strike',\n orderedList: 'button.ql-list[value=\"ordered\"]',\n bulletList: 'button.ql-list[value=\"bullet\"]',\n blockquote: 'button.ql-blockquote',\n codeBlock: 'button.ql-code-block',\n link: 'button.ql-link',\n clean: 'button.ql-clean',\n};\n\n/** Hover labels used when the consumer supplies neither a label nor a key. */\nconst DEFAULT_LABELS: Record<MnRichTextEditorControl, string> = {\n textStyle: 'Text style',\n bold: 'Bold',\n italic: 'Italic',\n underline: 'Underline',\n strike: 'Strikethrough',\n orderedList: 'Numbered list',\n bulletList: 'Bulleted list',\n blockquote: 'Quote',\n codeBlock: 'Code block',\n link: 'Link',\n clean: 'Clear formatting',\n};\n\n/** Quill's document when it holds no text; treated as an empty value. */\nconst EMPTY_DOCUMENT = '<p><br></p>';\n\n/**\n * Thin wrapper around the {@link Quill} rich-text editor.\n *\n * Quill is used **directly** rather than through an Angular wrapper package: the\n * wrapper libraries carry peer-dependency ranges that lag behind Angular's\n * release train, and none of them add anything this component needs.\n *\n * Consumers must install `quill` themselves (it is an optional peer dependency)\n * and load its snow theme, e.g. `node_modules/quill/dist/quill.snow.css` in the\n * `styles` array of `angular.json`. Only the chrome around that theme — radius,\n * borders, height limits and the toolbar tooltips — belongs to this component;\n * recolouring Quill's own palette to an app theme stays with the app, because\n * the same `.ql-snow` markup is normally reused to render stored HTML in places\n * where no editor is mounted.\n *\n * Quill itself is pulled in with a dynamic `import()` when the editor mounts.\n * This component sits in the library's single entry point, which apps import\n * eagerly, so a static import would put the whole editor engine in every app's\n * initial bundle — including the pages that never open one.\n *\n * Zoneless notes: nothing here relies on an implicit change-detection tick. The\n * editor is created inside {@link afterNextRender} (the host element only exists\n * after the first render pass) and every value that flows back out is written to\n * a signal or emitted through an `output`, both of which schedule change\n * detection themselves. No `setTimeout`, no manual `detectChanges`.\n *\n * The produced HTML is **not** trusted: sanitise it before rendering it anywhere.\n *\n * @example\n * ```html\n * <mn-rich-text-editor\n * [content]=\"draft()\"\n * [placeholder]=\"'minutes.placeholder' | mnTranslate\"\n * [labelKeys]=\"{ bold: 'editor.bold', italic: 'editor.italic' }\"\n * (contentChange)=\"draft.set($event)\">\n * </mn-rich-text-editor>\n * ```\n */\n@Component({\n selector: 'mn-rich-text-editor',\n standalone: true,\n templateUrl: './mn-rich-text-editor.component.html',\n styleUrl: './mn-rich-text-editor.component.css',\n // Quill builds its DOM at runtime, so those elements never carry Angular's\n // scoping attribute and an encapsulated stylesheet could never reach them.\n // Every rule in the stylesheet is scoped by `.mn-rich-text-editor` instead.\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class MnRichTextEditor implements OnDestroy {\n /**\n * The initial HTML content. Later changes are applied only when they differ\n * from what the editor currently holds, so a parent echoing the emitted value\n * back never moves the caret.\n */\n public readonly content = input<string>('');\n /** Placeholder shown while the editor is empty. */\n public readonly placeholder = input<string>('');\n /** Accessible label for the editing surface. */\n public readonly ariaLabel = input<string>('');\n /** Toolbar layout, in Quill's own format. Defaults to a prose-oriented set. */\n public readonly toolbar = input<MnRichTextEditorToolbar>(DEFAULT_TOOLBAR);\n /** Literal hover labels per toolbar control. */\n public readonly labels = input<MnRichTextEditorLabels>({});\n /** Translation keys per toolbar control; takes precedence over `labels`. */\n public readonly labelKeys = input<MnRichTextEditorLabels>({});\n /**\n * Utilities applied to the wrapper, for sizing the writing surface. Overriding\n * this replaces the default height limits, so pass both bounds when you do.\n */\n public readonly editorClass = input<string>(\n '[&_.ql-editor]:max-h-104 [&_.ql-editor]:min-h-72 [&_.ql-editor]:overflow-y-auto',\n );\n /** Emits the editor's HTML on every user edit. */\n public readonly contentChange = output<string>();\n /**\n * Chrome around Quill's snow theme: the field's radius, border and surface.\n *\n * Descendant variants rather than a stylesheet — the utilities come from the\n * consuming app's Tailwind build (which scans this bundle), so they follow the\n * app's theme tokens the same way the rest of the library does.\n */\n protected readonly chromeClass =\n '[&_.ql-container.ql-snow]:rounded-b-xl [&_.ql-container.ql-snow]:border-base-300 ' +\n '[&_.ql-container.ql-snow]:bg-base-100 [&_.ql-container.ql-snow]:text-base ' +\n '[&_.ql-toolbar.ql-snow]:rounded-t-xl [&_.ql-toolbar.ql-snow]:border-base-300 ' +\n '[&_.ql-toolbar.ql-snow]:bg-base-100';\n /** Host element, used to keep DOM queries inside this component. */\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n /** Language service, used to resolve the toolbar labels from keys. */\n private readonly lang = inject(MnLanguageService);\n /** The container Quill mounts into. */\n private readonly editorHost = viewChild.required<ElementRef<HTMLElement>>('editorHost');\n /** The live editor instance, or null before Quill has loaded. */\n private quill: Quill | null = null;\n\n /** Whether the component is gone, so a late Quill load knows to stop. */\n private destroyed = false;\n\n /** The last HTML this component emitted, used to skip redundant writes. */\n private readonly lastEmitted = signal<string>('');\n\n constructor() {\n afterNextRender(() => void this.createEditor());\n // Push a changed `content` input into a live editor. `lastEmitted` is read\n // `untracked` on purpose: it must gate the write (skip when the incoming HTML\n // already matches what we hold) WITHOUT making the effect depend on it. If it\n // were tracked, every keystroke (which updates `lastEmitted`) would re-run the\n // effect and re-paste the now-stale `content` seed — wiping the user's typing\n // and resetting the caret after any wholesale reseed.\n effect(() => {\n const incoming = this.content();\n if (!this.quill || incoming === untracked(this.lastEmitted)) return;\n this.setEditorHtml(incoming);\n });\n }\n\n /** Drops the editor reference so the instance can be garbage collected. */\n ngOnDestroy(): void {\n this.destroyed = true;\n this.quill = null;\n }\n\n /** Moves focus into the editing surface. */\n public focusEditor(): void {\n this.quill?.focus();\n if (!this.quill) {\n this.host.nativeElement.querySelector<HTMLElement>('.ql-editor')?.focus();\n }\n }\n\n /**\n * Loads Quill, builds the instance and wires its change handler.\n *\n * Nothing awaits this beyond the component itself: the surface appears once\n * the engine has loaded, and until then the `content` effect is a no-op that\n * the seeding below makes good.\n */\n private async createEditor(): Promise<void> {\n const {default: QuillEditor} = await import('quill');\n if (this.destroyed) return;\n const container = this.editorHost().nativeElement;\n this.quill = new QuillEditor(container, {\n theme: 'snow',\n placeholder: this.placeholder(),\n modules: {toolbar: this.toolbar() as unknown[]},\n });\n const label = this.ariaLabel();\n if (label) {\n this.quill.root.setAttribute('aria-label', label);\n }\n this.applyToolbarLabels();\n this.setEditorHtml(this.content());\n this.quill.on('text-change', () => this.emitCurrentHtml());\n }\n\n /**\n * Gives each toolbar control a hover label, so hovering explains what the\n * style does. Set on the Quill-generated DOM after init; a control the current\n * toolbar does not render is simply skipped.\n */\n private applyToolbarLabels(): void {\n const toolbar = this.host.nativeElement.querySelector('.ql-toolbar');\n if (!toolbar) return;\n const labels = this.labels();\n const keys = this.labelKeys();\n for (const [control, selector] of Object.entries(CONTROL_SELECTORS)) {\n const element = toolbar.querySelector(selector);\n if (!element) continue;\n element.classList.add('mn-rte-tooltip');\n element.setAttribute(\n 'data-tip',\n this.resolveLabel(control as MnRichTextEditorControl, labels, keys),\n );\n }\n }\n\n /**\n * Picks the hover label for one control.\n * @param control The control being labelled.\n * @param labels Literal labels supplied by the consumer.\n * @param keys Translation keys supplied by the consumer.\n * @returns The translated key, the literal label, or the built-in default.\n */\n private resolveLabel(\n control: MnRichTextEditorControl,\n labels: MnRichTextEditorLabels,\n keys: MnRichTextEditorLabels,\n ): string {\n const key = keys[control];\n if (key) {\n // `t()` echoes the key back when the consumer has no translation for it;\n // that is a miss, not a label, so fall through to the remaining sources.\n const translated = this.lang.t(key);\n if (translated !== key) return translated;\n }\n return labels[control] ?? DEFAULT_LABELS[control];\n }\n\n /**\n * Replaces the editor content with stored HTML. Quill parses it into its own\n * document model, which silently drops anything it has no format for — a\n * useful extra filter on top of the consumer's sanitiser.\n * @param html The HTML to load into the editor.\n */\n private setEditorHtml(html: string): void {\n if (!this.quill) return;\n // `dangerouslyPasteHTML` is Quill's documented name for \"parse this HTML\".\n this.quill.clipboard.dangerouslyPasteHTML(html ?? '', 'silent');\n this.lastEmitted.set(this.readHtml());\n }\n\n /** Emits the editor's current HTML, normalising Quill's \"empty\" document. */\n private emitCurrentHtml(): void {\n const html = this.readHtml();\n this.lastEmitted.set(html);\n this.contentChange.emit(html);\n }\n\n /**\n * Reads the editor's HTML.\n * @returns The current HTML, or an empty string when the editor is blank.\n */\n private readHtml(): string {\n if (!this.quill) return '';\n // Quill leaves an empty paragraph behind after a clear; treat that as empty\n // so an untouched editor does not count as authored content.\n const html = this.quill.root.innerHTML;\n return html === EMPTY_DOCUMENT ? '' : html;\n }\n}\n","<div class=\"mn-rich-text-editor {{ chromeClass }} {{ editorClass() }}\">\n <div #editorHost></div>\n</div>\n","/**\n * Public API of the `mn-angular-lib/rich-text-editor` entry point: the rich-text editor.\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-rich-text-editor';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;AAmBA;;;;;AAKG;AACH,MAAM,eAAe,GAA4B;IAC/C,CAAC,EAAC,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,EAAC,CAAC;AACzB,IAAA,CAAC,MAAM,EAAE,QAAQ,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GAAA;QACd,IAAI,CAAC,IAAI,CAAC,KAAK;AAAE,YAAA,OAAO,EAAE;;;QAG1B,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS;QACtC,OAAO,IAAI,KAAK,cAAc,GAAG,EAAE,GAAG,IAAI;IAC5C;uGApLW,gBAAgB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAhB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,gBAAgB,qpCCpH7B,gHAGA,EAAA,MAAA,EAAA,CAAA,4jBAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,aAAA,EAAA,EAAA,CAAA,iBAAA,CAAA,IAAA,EAAA,CAAA;;2FDiHa,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAX5B,SAAS;+BACE,qBAAqB,EAAA,UAAA,EACnB,IAAI,EAAA,aAAA,EAMD,iBAAiB,CAAC,IAAI,EAAA,eAAA,EACpB,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,gHAAA,EAAA,MAAA,EAAA,CAAA,4jBAAA,CAAA,EAAA;y0BA6C2B,YAAY,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AE/JxF;;;;;;AAMG;;ACNH;;AAEG;;;;"}
@@ -0,0 +1,246 @@
1
+ import * as i0 from '@angular/core';
2
+ import { EventEmitter, inject, TemplateRef, Output, Input, Component } from '@angular/core';
3
+ import { NgTemplateOutlet } from '@angular/common';
4
+ import { LucideDynamicIcon } from '@lucide/angular';
5
+ import { MnLanguageService, MnTranslatePipe } from 'mn-angular-lib/core';
6
+ import { MnButton } from 'mn-angular-lib/button';
7
+ import { tv } from 'tailwind-variants';
8
+
9
+ /**
10
+ * Styling for {@link MnSegmented}, expressed as tailwind-variants slots so the
11
+ * template pulls one class string per role.
12
+ *
13
+ * The control is a track with the active choice raised out of it, rather than a
14
+ * row of loose buttons: the segments share one bordered surface, so they read as
15
+ * one control with one answer instead of several independent actions. Theme
16
+ * tokens only, so it holds up in both light and dark.
17
+ *
18
+ * Each segment is an `mnButton`, which owns its own size, colour, radius and
19
+ * disabled look; the `segment` slot adds only what the button does not know
20
+ * about — how it sits inside the track.
21
+ */
22
+ const mnSegmentedVariants = tv({
23
+ slots: {
24
+ root: 'inline-flex items-center gap-0.5 border border-base-300 bg-base-200 p-0.5',
25
+ segment: 'gap-1.5 select-none ' +
26
+ 'focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary',
27
+ },
28
+ variants: {
29
+ /**
30
+ * Corner rounding of the track. The segments are rounded one step tighter
31
+ * (see `SEGMENT_RADIUS` on the component) so a filled segment nests inside
32
+ * the track's own corner instead of poking out of it. Token names match
33
+ * mn-button's; `full` makes a pill, where track and segment share the same
34
+ * fully-rounded ends.
35
+ */
36
+ borderRadius: {
37
+ none: { root: 'rounded-none' },
38
+ xs: { root: 'rounded-xs' },
39
+ sm: { root: 'rounded-sm' },
40
+ md: { root: 'rounded-md' },
41
+ lg: { root: 'rounded-lg' },
42
+ xl: { root: 'rounded-xl' },
43
+ two_xl: { root: 'rounded-2xl' },
44
+ three_xl: { root: 'rounded-3xl' },
45
+ four_xl: { root: 'rounded-4xl' },
46
+ full: { root: 'rounded-full' },
47
+ },
48
+ /**
49
+ * Stretch the track and share its width evenly between the segments.
50
+ *
51
+ * The segments grow from a zero basis but keep their automatic minimum, so a
52
+ * justified control inside an auto-width parent still asks for the room its
53
+ * labels need. Letting them shrink below their content (`min-w-0`) made the
54
+ * parent resolve to a narrower box and truncated the labels instead.
55
+ */
56
+ justified: {
57
+ true: { root: 'flex w-full', segment: 'flex-1' },
58
+ false: {},
59
+ },
60
+ /**
61
+ * Whether the segment is the picked one. The colours come from the button
62
+ * itself (a filled primary button when active, a ghost one otherwise); this
63
+ * only keeps an inactive segment's box the same size as an active one, whose
64
+ * fill variant carries a real border.
65
+ */
66
+ active: {
67
+ true: {},
68
+ false: { segment: 'border border-transparent' },
69
+ },
70
+ },
71
+ defaultVariants: {
72
+ borderRadius: 'lg',
73
+ justified: false,
74
+ active: false,
75
+ },
76
+ });
77
+
78
+ /** Icon edge length per size, so a segment's glyph matches its own text. */
79
+ const ICON_SIZE = { sm: 16, md: 18 };
80
+ /**
81
+ * Segment radius per track radius: one step tighter, so a filled segment nests
82
+ * inside the track's corner instead of poking out of it. A pill has no tighter
83
+ * step, so its segments are pills too.
84
+ */
85
+ const SEGMENT_RADIUS = {
86
+ none: 'none',
87
+ xs: 'none',
88
+ sm: 'xs',
89
+ md: 'sm',
90
+ lg: 'md',
91
+ xl: 'lg',
92
+ two_xl: 'xl',
93
+ three_xl: 'two_xl',
94
+ four_xl: 'three_xl',
95
+ full: 'full',
96
+ };
97
+ /**
98
+ * A segmented control: two or three mutually exclusive choices sharing one
99
+ * track, of which exactly one is active — a view switch (list ⇄ calendar), a
100
+ * scope switch (mine ⇄ everyone), a range switch (week ⇄ month).
101
+ *
102
+ * The selection is **controlled**: the component renders whatever
103
+ * {@link value} says and emits {@link valueChange} on a click, so the consumer's
104
+ * own state stays the single source of truth for what is on screen. It keeps no
105
+ * copy of the selection, and — unlike `mn-tab` — it does not mirror one into the
106
+ * URL, so it can sit on a page that already has a tab bar without the two
107
+ * fighting over the query string.
108
+ *
109
+ * Each segment is an `mnButton` — a filled primary one when active, a ghost one
110
+ * otherwise — so the control inherits the button's sizes, colours and disabled
111
+ * look rather than maintaining a parallel set.
112
+ *
113
+ * For switching between panes of a page, reach for `mn-tab`; this is for
114
+ * switching how one pane is rendered.
115
+ */
116
+ class MnSegmented {
117
+ /** The choices and how the group is labelled and scaled. */
118
+ dataSource;
119
+ /**
120
+ * Value of the active segment. No value (or one naming no segment) leaves the
121
+ * control with nothing active, which is what an unresolved selection should
122
+ * look like — the component never picks one on the consumer's behalf.
123
+ */
124
+ value;
125
+ /**
126
+ * Whether the segments stretch to fill the available width. Defaults to false,
127
+ * so the control hugs its content and can be parked at the end of a row; turn
128
+ * it on where it should span its container, typically on a narrow screen.
129
+ */
130
+ justified = false;
131
+ /** Emits the picked segment's value. The consumer decides what to do with it. */
132
+ valueChange = new EventEmitter();
133
+ /** Resolves this control's own accessible names against the app's bundle. */
134
+ lang = inject(MnLanguageService);
135
+ /** Resolved slot classes for the current rounding and layout. */
136
+ get styles() {
137
+ return mnSegmentedVariants({
138
+ borderRadius: this.dataSource.borderRadius,
139
+ justified: this.justified,
140
+ });
141
+ }
142
+ /** Icon edge length matching the control's text size. */
143
+ get iconSize() {
144
+ return ICON_SIZE[this.dataSource.size ?? 'md'];
145
+ }
146
+ /** Accessible name of the group, or null when the consumer named nothing. */
147
+ get groupLabel() {
148
+ const key = this.dataSource.ariaLabel;
149
+ return key ? this.lang.translate(key) : null;
150
+ }
151
+ /**
152
+ * Whether `item` is the active choice.
153
+ * @param item - The segment to test.
154
+ */
155
+ isActive(item) {
156
+ return item.value === this.value;
157
+ }
158
+ /**
159
+ * Layout classes for one segment — how it sits in the track. Its size, colour,
160
+ * radius and disabled look come from the button itself; see
161
+ * {@link segmentButton}.
162
+ * @param item - The segment to style.
163
+ */
164
+ segmentClass(item) {
165
+ return mnSegmentedVariants({
166
+ justified: this.justified,
167
+ active: this.isActive(item),
168
+ }).segment();
169
+ }
170
+ /**
171
+ * The `mnButton` configuration of one segment: a filled primary button when it
172
+ * is the active choice, a ghost button otherwise, at the control's size and one
173
+ * radius step inside the track. The active segment has no hover — re-picking it
174
+ * does nothing, so nothing should invite the click.
175
+ * @param item - The segment to configure.
176
+ */
177
+ segmentButton(item) {
178
+ const active = this.isActive(item);
179
+ return {
180
+ size: this.dataSource.size ?? 'md',
181
+ variant: active ? 'fill' : 'ghost',
182
+ color: active ? 'primary' : 'gray',
183
+ hover: !active,
184
+ borderRadius: SEGMENT_RADIUS[this.dataSource.borderRadius ?? 'lg'],
185
+ disabled: item.disabled ?? false,
186
+ };
187
+ }
188
+ /**
189
+ * Accessible name for an icon-only segment, or null when the segment shows a
190
+ * label — that label already names it, and a second name would only compete.
191
+ * @param item - The segment to name.
192
+ */
193
+ segmentLabel(item) {
194
+ if (item.label || !item.ariaLabel)
195
+ return null;
196
+ return this.lang.translate(item.ariaLabel);
197
+ }
198
+ /**
199
+ * Whether an icon was supplied as a `TemplateRef` rather than lucide icon data.
200
+ * @param value - The icon to test.
201
+ */
202
+ isTemplateRef(value) {
203
+ return value instanceof TemplateRef;
204
+ }
205
+ /**
206
+ * Announces a click. Re-picking the active segment is silent: it is not a
207
+ * change, and a consumer that reloads on every emission would refetch for
208
+ * nothing.
209
+ * @param item - The segment that was clicked.
210
+ */
211
+ select(item) {
212
+ if (item.disabled || this.isActive(item))
213
+ return;
214
+ this.valueChange.emit(item.value);
215
+ }
216
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: MnSegmented, deps: [], target: i0.ɵɵFactoryTarget.Component });
217
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.3", type: MnSegmented, isStandalone: true, selector: "mn-segmented", inputs: { dataSource: "dataSource", value: "value", justified: "justified" }, outputs: { valueChange: "valueChange" }, ngImport: i0, template: "<!-- One control, one answer: `role=\"group\"` with `aria-pressed` per segment, so\n the picked choice is announced as pressed rather than as a plain button\n nobody can tell the state of. Not a radiogroup \u2014 these are buttons that act\n immediately, not a value being edited inside a form. -->\n<div [attr.aria-label]=\"groupLabel\" [class]=\"styles.root()\" role=\"group\">\n @for (item of dataSource.items; track item.value) {\n <!-- Each segment is an mn-button: the active one a filled primary button, the\n rest ghost buttons, so the control shares the button's sizes, colours and\n disabled look instead of re-deriving them. -->\n <button\n mnButton\n (click)=\"select(item)\"\n [attr.aria-label]=\"segmentLabel(item)\"\n [attr.aria-pressed]=\"isActive(item)\"\n [class]=\"segmentClass(item)\"\n [data]=\"segmentButton(item)\"\n type=\"button\"\n >\n @if (item.icon; as icon) {\n <span class=\"inline-flex shrink-0 items-center\">\n <!-- A caller's template, else lucide data rendered at the size that\n matches this control's text \u2014 the same icon convention the\n dropdown's actions use. -->\n @if (isTemplateRef(icon)) {\n <ng-container [ngTemplateOutlet]=\"icon\"></ng-container>\n } @else {\n <svg [lucideIcon]=\"$any(icon)\" [size]=\"iconSize\"></svg>\n }\n </span>\n }\n @if (item.label; as label) {\n <span class=\"truncate\">{{ label | mnTranslate }}</span>\n }\n </button>\n }\n</div>\n", dependencies: [{ kind: "component", type: MnButton, selector: "button[mnButton], a[mnButton]", inputs: ["data"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: LucideDynamicIcon, selector: "svg[lucideIcon]", inputs: ["lucideIcon"] }, { kind: "pipe", type: MnTranslatePipe, name: "mnTranslate" }] });
218
+ }
219
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: MnSegmented, decorators: [{
220
+ type: Component,
221
+ args: [{ selector: 'mn-segmented', standalone: true, imports: [MnButton, MnTranslatePipe, NgTemplateOutlet, LucideDynamicIcon], template: "<!-- One control, one answer: `role=\"group\"` with `aria-pressed` per segment, so\n the picked choice is announced as pressed rather than as a plain button\n nobody can tell the state of. Not a radiogroup \u2014 these are buttons that act\n immediately, not a value being edited inside a form. -->\n<div [attr.aria-label]=\"groupLabel\" [class]=\"styles.root()\" role=\"group\">\n @for (item of dataSource.items; track item.value) {\n <!-- Each segment is an mn-button: the active one a filled primary button, the\n rest ghost buttons, so the control shares the button's sizes, colours and\n disabled look instead of re-deriving them. -->\n <button\n mnButton\n (click)=\"select(item)\"\n [attr.aria-label]=\"segmentLabel(item)\"\n [attr.aria-pressed]=\"isActive(item)\"\n [class]=\"segmentClass(item)\"\n [data]=\"segmentButton(item)\"\n type=\"button\"\n >\n @if (item.icon; as icon) {\n <span class=\"inline-flex shrink-0 items-center\">\n <!-- A caller's template, else lucide data rendered at the size that\n matches this control's text \u2014 the same icon convention the\n dropdown's actions use. -->\n @if (isTemplateRef(icon)) {\n <ng-container [ngTemplateOutlet]=\"icon\"></ng-container>\n } @else {\n <svg [lucideIcon]=\"$any(icon)\" [size]=\"iconSize\"></svg>\n }\n </span>\n }\n @if (item.label; as label) {\n <span class=\"truncate\">{{ label | mnTranslate }}</span>\n }\n </button>\n }\n</div>\n" }]
222
+ }], propDecorators: { dataSource: [{
223
+ type: Input,
224
+ args: [{ required: true }]
225
+ }], value: [{
226
+ type: Input
227
+ }], justified: [{
228
+ type: Input
229
+ }], valueChange: [{
230
+ type: Output
231
+ }] } });
232
+
233
+ /**
234
+ * Public API of the `mn-angular-lib/segmented` entry point: the segmented control.
235
+ *
236
+ * Each entry point is its own module in the published package, so a consumer's bundler
237
+ * splits it into the chunk that uses it instead of loading the whole library at startup.
238
+ * The root `mn-angular-lib` entry re-exports every entry point.
239
+ */
240
+
241
+ /**
242
+ * Generated bundle index. Do not edit.
243
+ */
244
+
245
+ export { MnSegmented, mnSegmentedVariants };
246
+ //# sourceMappingURL=mn-angular-lib-segmented.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mn-angular-lib-segmented.mjs","sources":["../../../projects/mn-angular-lib/segmented/src/mn-segmented/mn-segmentedVariants.ts","../../../projects/mn-angular-lib/segmented/src/mn-segmented/mn-segmented.ts","../../../projects/mn-angular-lib/segmented/src/mn-segmented/mn-segmented.html","../../../projects/mn-angular-lib/segmented/public-api.ts","../../../projects/mn-angular-lib/segmented/mn-angular-lib-segmented.ts"],"sourcesContent":["import { tv, type VariantProps } from 'tailwind-variants';\n\n/**\n * Styling for {@link MnSegmented}, expressed as tailwind-variants slots so the\n * template pulls one class string per role.\n *\n * The control is a track with the active choice raised out of it, rather than a\n * row of loose buttons: the segments share one bordered surface, so they read as\n * one control with one answer instead of several independent actions. Theme\n * tokens only, so it holds up in both light and dark.\n *\n * Each segment is an `mnButton`, which owns its own size, colour, radius and\n * disabled look; the `segment` slot adds only what the button does not know\n * about — how it sits inside the track.\n */\nexport const mnSegmentedVariants = tv({\n slots: {\n root: 'inline-flex items-center gap-0.5 border border-base-300 bg-base-200 p-0.5',\n segment:\n 'gap-1.5 select-none ' +\n 'focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary',\n },\n variants: {\n /**\n * Corner rounding of the track. The segments are rounded one step tighter\n * (see `SEGMENT_RADIUS` on the component) so a filled segment nests inside\n * the track's own corner instead of poking out of it. Token names match\n * mn-button's; `full` makes a pill, where track and segment share the same\n * fully-rounded ends.\n */\n borderRadius: {\n none: { root: 'rounded-none' },\n xs: { root: 'rounded-xs' },\n sm: { root: 'rounded-sm' },\n md: { root: 'rounded-md' },\n lg: { root: 'rounded-lg' },\n xl: { root: 'rounded-xl' },\n two_xl: { root: 'rounded-2xl' },\n three_xl: { root: 'rounded-3xl' },\n four_xl: { root: 'rounded-4xl' },\n full: { root: 'rounded-full' },\n },\n /**\n * Stretch the track and share its width evenly between the segments.\n *\n * The segments grow from a zero basis but keep their automatic minimum, so a\n * justified control inside an auto-width parent still asks for the room its\n * labels need. Letting them shrink below their content (`min-w-0`) made the\n * parent resolve to a narrower box and truncated the labels instead.\n */\n justified: {\n true: { root: 'flex w-full', segment: 'flex-1' },\n false: {},\n },\n /**\n * Whether the segment is the picked one. The colours come from the button\n * itself (a filled primary button when active, a ghost one otherwise); this\n * only keeps an inactive segment's box the same size as an active one, whose\n * fill variant carries a real border.\n */\n active: {\n true: {},\n false: { segment: 'border border-transparent' },\n },\n },\n defaultVariants: {\n borderRadius: 'lg',\n justified: false,\n active: false,\n },\n});\n\nexport type MnSegmentedVariants = VariantProps<typeof mnSegmentedVariants>;\n","import { Component, EventEmitter, inject, Input, Output, TemplateRef } from '@angular/core';\nimport { NgTemplateOutlet } from '@angular/common';\nimport { LucideDynamicIcon } from '@lucide/angular';\nimport { MnLanguageService, MnTranslatePipe } from 'mn-angular-lib/core';\nimport { MnButton, MnButtonTypes } from 'mn-angular-lib/button';\nimport { MnSegmentedDataSource, MnSegmentedItem } from './mn-segmentedTypes';\nimport { MnSegmentedVariants, mnSegmentedVariants } from './mn-segmentedVariants';\n\n/** Icon edge length per size, so a segment's glyph matches its own text. */\nconst ICON_SIZE: Record<'sm' | 'md', number> = { sm: 16, md: 18 };\n\n/**\n * Segment radius per track radius: one step tighter, so a filled segment nests\n * inside the track's corner instead of poking out of it. A pill has no tighter\n * step, so its segments are pills too.\n */\nconst SEGMENT_RADIUS: Record<\n NonNullable<MnSegmentedVariants['borderRadius']>,\n NonNullable<MnButtonTypes['borderRadius']>\n> = {\n none: 'none',\n xs: 'none',\n sm: 'xs',\n md: 'sm',\n lg: 'md',\n xl: 'lg',\n two_xl: 'xl',\n three_xl: 'two_xl',\n four_xl: 'three_xl',\n full: 'full',\n};\n\n/**\n * A segmented control: two or three mutually exclusive choices sharing one\n * track, of which exactly one is active — a view switch (list ⇄ calendar), a\n * scope switch (mine ⇄ everyone), a range switch (week ⇄ month).\n *\n * The selection is **controlled**: the component renders whatever\n * {@link value} says and emits {@link valueChange} on a click, so the consumer's\n * own state stays the single source of truth for what is on screen. It keeps no\n * copy of the selection, and — unlike `mn-tab` — it does not mirror one into the\n * URL, so it can sit on a page that already has a tab bar without the two\n * fighting over the query string.\n *\n * Each segment is an `mnButton` — a filled primary one when active, a ghost one\n * otherwise — so the control inherits the button's sizes, colours and disabled\n * look rather than maintaining a parallel set.\n *\n * For switching between panes of a page, reach for `mn-tab`; this is for\n * switching how one pane is rendered.\n */\n@Component({\n selector: 'mn-segmented',\n standalone: true,\n imports: [MnButton, MnTranslatePipe, NgTemplateOutlet, LucideDynamicIcon],\n templateUrl: './mn-segmented.html',\n})\nexport class MnSegmented {\n /** The choices and how the group is labelled and scaled. */\n @Input({ required: true }) dataSource!: MnSegmentedDataSource;\n\n /**\n * Value of the active segment. No value (or one naming no segment) leaves the\n * control with nothing active, which is what an unresolved selection should\n * look like — the component never picks one on the consumer's behalf.\n */\n @Input() value?: string;\n\n /**\n * Whether the segments stretch to fill the available width. Defaults to false,\n * so the control hugs its content and can be parked at the end of a row; turn\n * it on where it should span its container, typically on a narrow screen.\n */\n @Input() justified = false;\n\n /** Emits the picked segment's value. The consumer decides what to do with it. */\n @Output() valueChange = new EventEmitter<string>();\n\n /** Resolves this control's own accessible names against the app's bundle. */\n private readonly lang = inject(MnLanguageService);\n\n /** Resolved slot classes for the current rounding and layout. */\n get styles() {\n return mnSegmentedVariants({\n borderRadius: this.dataSource.borderRadius,\n justified: this.justified,\n });\n }\n\n /** Icon edge length matching the control's text size. */\n get iconSize(): number {\n return ICON_SIZE[this.dataSource.size ?? 'md'];\n }\n\n /** Accessible name of the group, or null when the consumer named nothing. */\n get groupLabel(): string | null {\n const key = this.dataSource.ariaLabel;\n return key ? this.lang.translate(key) : null;\n }\n\n /**\n * Whether `item` is the active choice.\n * @param item - The segment to test.\n */\n isActive(item: MnSegmentedItem): boolean {\n return item.value === this.value;\n }\n\n /**\n * Layout classes for one segment — how it sits in the track. Its size, colour,\n * radius and disabled look come from the button itself; see\n * {@link segmentButton}.\n * @param item - The segment to style.\n */\n segmentClass(item: MnSegmentedItem): string {\n return mnSegmentedVariants({\n justified: this.justified,\n active: this.isActive(item),\n }).segment();\n }\n\n /**\n * The `mnButton` configuration of one segment: a filled primary button when it\n * is the active choice, a ghost button otherwise, at the control's size and one\n * radius step inside the track. The active segment has no hover — re-picking it\n * does nothing, so nothing should invite the click.\n * @param item - The segment to configure.\n */\n segmentButton(item: MnSegmentedItem): Partial<MnButtonTypes> {\n const active = this.isActive(item);\n return {\n size: this.dataSource.size ?? 'md',\n variant: active ? 'fill' : 'ghost',\n color: active ? 'primary' : 'gray',\n hover: !active,\n borderRadius: SEGMENT_RADIUS[this.dataSource.borderRadius ?? 'lg'],\n disabled: item.disabled ?? false,\n };\n }\n\n /**\n * Accessible name for an icon-only segment, or null when the segment shows a\n * label — that label already names it, and a second name would only compete.\n * @param item - The segment to name.\n */\n segmentLabel(item: MnSegmentedItem): string | null {\n if (item.label || !item.ariaLabel) return null;\n return this.lang.translate(item.ariaLabel);\n }\n\n /**\n * Whether an icon was supplied as a `TemplateRef` rather than lucide icon data.\n * @param value - The icon to test.\n */\n isTemplateRef(value: unknown): value is TemplateRef<unknown> {\n return value instanceof TemplateRef;\n }\n\n /**\n * Announces a click. Re-picking the active segment is silent: it is not a\n * change, and a consumer that reloads on every emission would refetch for\n * nothing.\n * @param item - The segment that was clicked.\n */\n select(item: MnSegmentedItem): void {\n if (item.disabled || this.isActive(item)) return;\n this.valueChange.emit(item.value);\n }\n}\n","<!-- One control, one answer: `role=\"group\"` with `aria-pressed` per segment, so\n the picked choice is announced as pressed rather than as a plain button\n nobody can tell the state of. Not a radiogroup — these are buttons that act\n immediately, not a value being edited inside a form. -->\n<div [attr.aria-label]=\"groupLabel\" [class]=\"styles.root()\" role=\"group\">\n @for (item of dataSource.items; track item.value) {\n <!-- Each segment is an mn-button: the active one a filled primary button, the\n rest ghost buttons, so the control shares the button's sizes, colours and\n disabled look instead of re-deriving them. -->\n <button\n mnButton\n (click)=\"select(item)\"\n [attr.aria-label]=\"segmentLabel(item)\"\n [attr.aria-pressed]=\"isActive(item)\"\n [class]=\"segmentClass(item)\"\n [data]=\"segmentButton(item)\"\n type=\"button\"\n >\n @if (item.icon; as icon) {\n <span class=\"inline-flex shrink-0 items-center\">\n <!-- A caller's template, else lucide data rendered at the size that\n matches this control's text — the same icon convention the\n dropdown's actions use. -->\n @if (isTemplateRef(icon)) {\n <ng-container [ngTemplateOutlet]=\"icon\"></ng-container>\n } @else {\n <svg [lucideIcon]=\"$any(icon)\" [size]=\"iconSize\"></svg>\n }\n </span>\n }\n @if (item.label; as label) {\n <span class=\"truncate\">{{ label | mnTranslate }}</span>\n }\n </button>\n }\n</div>\n","/**\n * Public API of the `mn-angular-lib/segmented` entry point: the segmented control.\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-segmented';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;AAEA;;;;;;;;;;;;AAYG;AACI,MAAM,mBAAmB,GAAG,EAAE,CAAC;AACpC,IAAA,KAAK,EAAE;AACL,QAAA,IAAI,EAAE,2EAA2E;AACjF,QAAA,OAAO,EACL,sBAAsB;YACtB,sFAAsF;AACzF,KAAA;AACD,IAAA,QAAQ,EAAE;AACR;;;;;;AAMG;AACH,QAAA,YAAY,EAAE;AACZ,YAAA,IAAI,EAAE,EAAE,IAAI,EAAE,cAAc,EAAE;AAC9B,YAAA,EAAE,EAAE,EAAE,IAAI,EAAE,YAAY,EAAE;AAC1B,YAAA,EAAE,EAAE,EAAE,IAAI,EAAE,YAAY,EAAE;AAC1B,YAAA,EAAE,EAAE,EAAE,IAAI,EAAE,YAAY,EAAE;AAC1B,YAAA,EAAE,EAAE,EAAE,IAAI,EAAE,YAAY,EAAE;AAC1B,YAAA,EAAE,EAAE,EAAE,IAAI,EAAE,YAAY,EAAE;AAC1B,YAAA,MAAM,EAAE,EAAE,IAAI,EAAE,aAAa,EAAE;AAC/B,YAAA,QAAQ,EAAE,EAAE,IAAI,EAAE,aAAa,EAAE;AACjC,YAAA,OAAO,EAAE,EAAE,IAAI,EAAE,aAAa,EAAE;AAChC,YAAA,IAAI,EAAE,EAAE,IAAI,EAAE,cAAc,EAAE;AAC/B,SAAA;AACD;;;;;;;AAOG;AACH,QAAA,SAAS,EAAE;YACT,IAAI,EAAE,EAAE,IAAI,EAAE,aAAa,EAAE,OAAO,EAAE,QAAQ,EAAE;AAChD,YAAA,KAAK,EAAE,EAAE;AACV,SAAA;AACD;;;;;AAKG;AACH,QAAA,MAAM,EAAE;AACN,YAAA,IA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