@su-labs/fields 19.2.0 → 19.2.1

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/CHANGELOG.md CHANGED
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [22.2.1] - 2026-11-21
9
+
10
+ ### Changed
11
+
12
+ - `su-lib-email-field`: an empty required field no longer says "write your email" just because it was left; that message waits for `showProblem` (the form was sent). A half-typed address is still checked once the field is left
13
+
8
14
  ## [22.2.0] - 2026-11-20
9
15
 
10
16
  ### Added
package/README.md CHANGED
@@ -122,7 +122,7 @@ when the form is sent:
122
122
  | `value` | `''` | The address; `[(value)]` binds both ways |
123
123
  | `label` | — | The visible label |
124
124
  | `placeholder` | — | |
125
- | `required` | `false` | An empty field counts as a problem |
125
+ | `required` | `false` | An empty field counts as a problem, shown only with `showProblem` |
126
126
  | `floating` | `false` | The label sits inside the field and moves up onto its border when focused or filled |
127
127
  | `showProblem` | `false` | Shows the problem before the field was left, e.g. once its form is sent |
128
128
  | `domains` | common providers | Domains to suggest for a typo, e.g. your company's |
@@ -301,11 +301,16 @@ class SuEmailFieldComponent {
301
301
  id = `su-email-${nextId++}`;
302
302
  touched = signal(false);
303
303
  check = computed(() => suCheckEmail(this.value(), this.domains()));
304
- text = computed(() => ({ ...SU_EMAIL_MESSAGES, ...this.messages() }));
305
- /** The problem to show: once the field was left or `showProblem` is on, and an empty field only when it's required */
304
+ text = computed(() => ({
305
+ ...SU_EMAIL_MESSAGES,
306
+ ...this.messages(),
307
+ }));
308
+ /** The problem to show: a typed address once the field was left or `showProblem` is on; an empty required field only with `showProblem` */
306
309
  problem = computed(() => {
307
310
  const { problem } = this.check();
308
- const isShown = this.touched() || this.showProblem();
311
+ const isShown = problem === 'empty'
312
+ ? this.showProblem()
313
+ : this.touched() || this.showProblem();
309
314
  if (!isShown || !problem || (problem === 'empty' && !this.required())) {
310
315
  return null;
311
316
  }
@@ -1 +1 @@
1
- {"version":3,"file":"su-labs-fields.mjs","sources":["../../../../compat/angular-19/build/fields/src/lib/code-boxes/code-boxes.component.ts","../../../../compat/angular-19/build/fields/src/lib/code-boxes/code-boxes.component.html","../../../../compat/angular-19/build/fields/src/lib/strength-meter/password-strength.ts","../../../../compat/angular-19/build/fields/src/lib/strength-meter/strength-meter.component.ts","../../../../compat/angular-19/build/fields/src/lib/strength-meter/strength-meter.component.html","../../../../compat/angular-19/build/fields/src/lib/auto-grow/auto-grow.directive.ts","../../../../compat/angular-19/build/fields/src/lib/switch/switch.component.ts","../../../../compat/angular-19/build/fields/src/lib/switch/switch.component.html","../../../../compat/angular-19/build/fields/src/lib/email-field/email-check.ts","../../../../compat/angular-19/build/fields/src/lib/email-field/email-field.component.ts","../../../../compat/angular-19/build/fields/src/lib/email-field/email-field.component.html","../../../../compat/angular-19/build/fields/src/lib/checkbox/checkbox.component.ts","../../../../compat/angular-19/build/fields/src/lib/checkbox/checkbox.component.html","../../../../compat/angular-19/build/fields/src/lib/chips/chips.component.ts","../../../../compat/angular-19/build/fields/src/lib/chips/chips.component.html","../../../../compat/angular-19/build/fields/src/su-labs-fields.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, computed, input, model } from '@angular/core';\n\n/**\n * A short code typed into a row of boxes that fill one by one, then turn green in a wave once the code is complete.\n * One real text field lies over the boxes, so typing, pasting, the phone keyboard and screen readers all work as usual.\n */\n@Component({\n selector: 'su-lib-code-boxes',\n changeDetection: ChangeDetectionStrategy.OnPush,\n templateUrl: './code-boxes.component.html',\n styleUrl: './code-boxes.component.scss',\n})\nexport class SuCodeBoxesComponent {\n readonly value = model('');\n readonly length = input.required<number>();\n readonly label = input.required<string>();\n /** The code is whole and well-formed: the boxes turn green */\n readonly complete = input(false);\n\n protected readonly boxes = computed(() =>\n Array.from({ length: this.length() }, (_, index) => index)\n );\n\n /** Capitals without spaces, never longer than the boxes */\n protected onInput(field: HTMLInputElement): void {\n const code = field.value\n .replace(/\\s/g, '')\n .toUpperCase()\n .slice(0, this.length());\n field.value = code;\n this.value.set(code);\n }\n}\n","<input\n #field\n class=\"field\"\n type=\"text\"\n inputmode=\"text\"\n autocomplete=\"off\"\n autocapitalize=\"characters\"\n spellcheck=\"false\"\n required\n [attr.maxlength]=\"length()\"\n [attr.aria-label]=\"label()\"\n [value]=\"value()\"\n (input)=\"onInput(field)\"\n/>\n<span class=\"boxes\" [class.is-complete]=\"complete()\" aria-hidden=\"true\">\n @for (index of boxes(); track index) {\n <span\n class=\"box\"\n [class.is-filled]=\"index < value().length\"\n [class.is-current]=\"index === value().length\"\n [style.--index]=\"index\"\n >{{ value()[index] }}</span\n >\n }\n</span>\n","/** How strong a new password looks, one step per bar of the meter */\nexport const SU_STRENGTH_LEVELS = ['weak', 'fair', 'good', 'strong'] as const;\nexport type SuStrengthLevel = (typeof SU_STRENGTH_LEVELS)[number];\n\n/** Shortest password the meter counts as more than weak, unless told otherwise */\nexport const SU_DEFAULT_MIN_PASSWORD_LENGTH = 8;\n\n/**\n * Bars of the strength meter a password fills, from 0 (empty) to 4. Under the minimum length it stays at one bar,\n * whatever else it has. Then one bar each for: four characters past the minimum, letters with digits, and symbols or\n * mixed case.\n */\nexport function suPasswordStrength(\n password: string,\n minLength = SU_DEFAULT_MIN_PASSWORD_LENGTH\n): number {\n if (password.length === 0) {\n return 0;\n }\n if (password.length < minLength) {\n return 1;\n }\n const extras = [\n password.length >= minLength + 4,\n /\\p{L}/u.test(password) && /\\d/.test(password),\n /[^\\p{L}\\d]/u.test(password) ||\n (/\\p{Lu}/u.test(password) && /\\p{Ll}/u.test(password)),\n ].filter(Boolean).length;\n return 1 + extras;\n}\n\n/** The meter's word for a number of bars, or null for an empty password */\nexport const suStrengthLevel = (bars: number): SuStrengthLevel | null =>\n SU_STRENGTH_LEVELS[bars - 1] ?? null;\n","import { ChangeDetectionStrategy, Component, computed, effect, input, signal } from '@angular/core';\nimport { SU_DEFAULT_MIN_PASSWORD_LENGTH, SU_STRENGTH_LEVELS, suPasswordStrength, SuStrengthLevel, suStrengthLevel } from './password-strength';\n\n/**\n * Four bars under a new password that fill, and change colour, as the password gets stronger. It follows the field's\n * own typing, so forms keep their plain fields; a form that empties the field by code sends it an `input` event.\n * Its texts come in as inputs, so it fits any language.\n */\n@Component({\n selector: 'su-lib-strength-meter',\n changeDetection: ChangeDetectionStrategy.OnPush,\n templateUrl: './strength-meter.component.html',\n styleUrl: './strength-meter.component.scss',\n})\nexport class SuStrengthMeterComponent {\n readonly field = input.required<HTMLInputElement>();\n /** The meter's name for screen readers, e.g. \"Password strength\" */\n readonly label = input.required<string>();\n /** The word shown for each step */\n readonly levelNames =\n input.required<Readonly<Record<SuStrengthLevel, string>>>();\n readonly minLength = input(SU_DEFAULT_MIN_PASSWORD_LENGTH);\n\n private readonly password = signal('');\n protected readonly steps = SU_STRENGTH_LEVELS;\n protected readonly bars = computed(() =>\n suPasswordStrength(this.password(), this.minLength())\n );\n protected readonly level = computed(() => suStrengthLevel(this.bars()));\n protected readonly levelName = computed(() => {\n const level = this.level();\n return level ? this.levelNames()[level] : null;\n });\n\n constructor() {\n effect(onCleanup => {\n const field = this.field();\n const read = () => this.password.set(field.value);\n read();\n field.addEventListener('input', read);\n onCleanup(() => field.removeEventListener('input', read));\n });\n }\n}\n","<div\n class=\"bars\"\n role=\"meter\"\n [attr.aria-label]=\"label()\"\n aria-valuemin=\"0\"\n [attr.aria-valuemax]=\"steps.length\"\n [attr.aria-valuenow]=\"bars()\"\n [attr.aria-valuetext]=\"levelName()\"\n>\n @for (step of steps; track step; let index = $index) {\n <span class=\"bar\" [class.is-filled]=\"index < bars()\" [style.--index]=\"index\"></span>\n }\n</div>\n@if (levelName(); as name) {\n <small class=\"level\" [attr.data-level]=\"level()\" aria-hidden=\"true\">{{ name }}</small>\n}\n","import { afterNextRender, booleanAttribute, DestroyRef, Directive, ElementRef, inject, input } from '@angular/core';\n\n/** A soft spring that overshoots a little, as the box settles on its new height */\nconst SPRING = 'height 240ms cubic-bezier(0.34, 1.56, 0.64, 1)';\n\n/**\n * A text box that grows a line at a time as the text gets longer, and shrinks back when it is emptied, with a soft\n * spring (none for visitors who asked their device for less motion). `[suAutoGrow]=\"false\"` leaves it as it is.\n */\n@Directive({\n selector: 'textarea[suAutoGrow]',\n host: { '(input)': 'fit()' },\n})\nexport class SuAutoGrowDirective {\n readonly isOn = input(true, { alias: 'suAutoGrow', transform: booleanAttribute });\n\n private readonly box: HTMLTextAreaElement = inject(ElementRef).nativeElement;\n\n constructor() {\n const destroyRef = inject(DestroyRef);\n afterNextRender(() => {\n const onReset = () => setTimeout(() => this.fit());\n this.box.form?.addEventListener('reset', onReset);\n destroyRef.onDestroy(() =>\n this.box.form?.removeEventListener('reset', onReset)\n );\n });\n }\n\n protected fit(): void {\n if (!this.isOn()) {\n return;\n }\n const box = this.box;\n const from = box.offsetHeight;\n box.style.transition = 'none';\n box.style.height = 'auto';\n const to = box.scrollHeight + box.offsetHeight - box.clientHeight;\n box.style.height = `${from}px`;\n void box.offsetHeight;\n box.style.overflowY = 'hidden';\n box.style.transition = matchMedia('(prefers-reduced-motion: reduce)')\n .matches\n ? 'none'\n : SPRING;\n box.style.height = `${to}px`;\n }\n}\n","import { booleanAttribute, ChangeDetectionStrategy, Component, effect, input, linkedSignal, output, untracked } from '@angular/core';\n\n/** Where the label sits: after the switch, or before it with the switch at the end of the row */\nexport type SuSwitchLabelPosition = 'start' | 'end';\n\nexport type SuSwitchSize = 'small' | 'medium';\n\n/**\n * A real checkbox (`role=\"switch\"`) drawn as a sliding switch: the knob stretches while pressed, springs across and a\n * tick pops in when it's on. Put the label inside: `<su-lib-switch [(checked)]=\"on\">Reduce motion</su-lib-switch>`.\n *\n * It shows a click at once and follows `checked` whenever it changes. While `busy` (e.g. saving the change) it ignores\n * clicks, and once no longer busy it shows `checked` again, so a change that failed to save flips back.\n */\n@Component({\n selector: 'su-lib-switch',\n changeDetection: ChangeDetectionStrategy.OnPush,\n templateUrl: './switch.component.html',\n styleUrl: './switch.component.scss',\n})\nexport class SuSwitchComponent {\n readonly checked = input(false, { transform: booleanAttribute });\n readonly disabled = input(false, { transform: booleanAttribute });\n /** Busy saving the change: clicks are ignored, and `aria-busy` is set */\n readonly busy = input(false, { transform: booleanAttribute });\n /** @default 'end' */\n readonly labelPosition = input<SuSwitchLabelPosition>('end');\n /** @default 'medium' */\n readonly size = input<SuSwitchSize>('medium');\n /** Switched by the user: the new value */\n readonly checkedChange = output<boolean>();\n\n protected readonly shown = linkedSignal(() => this.checked());\n\n constructor() {\n effect(() => {\n if (!this.busy()) {\n untracked(() => this.shown.set(this.checked()));\n }\n });\n }\n\n protected onClick(event: MouseEvent): void {\n if (this.busy()) {\n event.preventDefault();\n }\n }\n\n protected onChange(event: Event): void {\n if (event.target instanceof HTMLInputElement) {\n this.shown.set(event.target.checked);\n this.checkedChange.emit(event.target.checked);\n }\n }\n}\n","<label class=\"su-switch su-switch-{{ size() }}\" [class.is-label-start]=\"labelPosition() === 'start'\">\n <input\n type=\"checkbox\"\n role=\"switch\"\n [checked]=\"shown()\"\n [disabled]=\"disabled()\"\n [attr.aria-busy]=\"busy() ? true : null\"\n (click)=\"onClick($event)\"\n (change)=\"onChange($event)\"\n />\n <span class=\"su-switch-track\" aria-hidden=\"true\"></span>\n <span class=\"su-switch-label\"><ng-content /></span>\n</label>\n","/** What's wrong with an email address, in the order it's checked */\nexport type SuEmailProblem = 'empty' | 'spaces' | 'at' | 'name' | 'domain' | 'dot' | 'ending';\n\n/** The outcome of `suCheckEmail` */\nexport interface SuEmailCheck {\n readonly valid: boolean;\n readonly problem: SuEmailProblem | null;\n /** The address with a common domain in place of a likely typo, e.g. `jo@gmail.com` for `jo@gmial.com`, or null */\n readonly suggestion: string | null;\n}\n\n/** Domains `suCheckEmail` suggests when one is mistyped */\nexport const SU_COMMON_EMAIL_DOMAINS: readonly string[] = [\n 'gmail.com',\n 'hotmail.com',\n 'outlook.com',\n 'live.com',\n 'yahoo.com',\n 'icloud.com',\n 'me.com',\n 'aol.com',\n 'proton.me',\n 'protonmail.com',\n 'gmx.com',\n 'yandex.com',\n 'hotmail.es',\n 'yahoo.es',\n];\n\n/** How far a typed domain may be from a common one, in single-letter edits, to suggest it */\nconst MAX_TYPO_DISTANCE = 2;\n\nfunction editDistance(a: string, b: string): number {\n let previous = Array.from({ length: b.length + 1 }, (_, index) => index);\n for (let i = 1; i <= a.length; i++) {\n const current = [i];\n for (let j = 1; j <= b.length; j++) {\n current[j] = Math.min(previous[j] + 1, current[j - 1] + 1, previous[j - 1] + (a[i - 1] === b[j - 1] ? 0 : 1));\n }\n previous = current;\n }\n return previous[b.length];\n}\n\n/** The common domain a typed one most likely meant, or null when it's already common or nothing is close */\nfunction closestDomain(domain: string, domains: readonly string[]): string | null {\n if (!domain || domains.includes(domain)) {\n return null;\n }\n let best: { readonly domain: string; readonly distance: number } | null = null;\n for (const candidate of domains) {\n const distance = editDistance(domain, candidate);\n if (distance <= MAX_TYPO_DISTANCE && (!best || distance < best.distance)) {\n best = { domain: candidate, distance };\n }\n }\n return best?.domain ?? null;\n}\n\nfunction problemOf(email: string): SuEmailProblem | null {\n if (email === '') {\n return 'empty';\n }\n if (/\\s/.test(email)) {\n return 'spaces';\n }\n const parts = email.split('@');\n if (parts.length !== 2) {\n return 'at';\n }\n const [name, domain] = parts;\n if (!name) {\n return 'name';\n }\n if (!domain) {\n return 'domain';\n }\n const labels = domain.split('.');\n if (labels.length < 2 || labels.some((label) => label === '')) {\n return 'dot';\n }\n return /^\\p{L}{2,}$/u.test(labels[labels.length - 1]) ? null : 'ending';\n}\n\n/**\n * Checks an email address the way people mistype them: empty, spaces, not exactly one @, nothing before or after it,\n * a domain without a proper dot, or an ending shorter than two letters. It also suggests a common domain for a\n * likely typo (`gmial.com` → `gmail.com`), even when the address is otherwise valid.\n */\nexport function suCheckEmail(value: string, domains: readonly string[] = SU_COMMON_EMAIL_DOMAINS): SuEmailCheck {\n const email = value.trim();\n const problem = problemOf(email);\n const [name = '', domain = ''] = email.split('@');\n const fixable = problem === null || problem === 'dot' || problem === 'ending';\n const fix = fixable && name ? closestDomain(domain.toLowerCase(), domains) : null;\n return { valid: problem === null, problem, suggestion: fix ? `${name}@${fix}` : null };\n}\n","import { booleanAttribute, ChangeDetectionStrategy, Component, computed, effect, input, model, output, signal } from '@angular/core';\nimport { SU_COMMON_EMAIL_DOMAINS, suCheckEmail, SuEmailProblem } from './email-check';\n\n/** The field's texts, e.g. in the page's language */\nexport interface SuEmailMessages extends Readonly<Record<SuEmailProblem, string>> {\n /** Before a suggested address: \"Did you mean jo@gmail.com?\" */\n readonly suggestion: string;\n}\n\nexport const SU_EMAIL_MESSAGES: SuEmailMessages = {\n empty: 'Enter your email address',\n spaces: 'An email address has no spaces',\n at: 'An email address has one @, like name@example.com',\n name: 'Add the part before the @',\n domain: 'Add the part after the @, like example.com',\n dot: 'The part after the @ needs a dot, like example.com',\n ending: 'The ending after the last dot needs at least two letters',\n suggestion: 'Did you mean',\n};\n\nlet nextId = 0;\n\n/**\n * An email field that checks the address the way people mistype it, and suggests a common domain for a likely typo\n * (`gmial.com` → `gmail.com`, applied with one tap). It stays quiet while typing and says what's wrong once the field\n * is left; a tick shows when the address looks right.\n */\n@Component({\n selector: 'su-lib-email-field',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: { '[class.is-floating]': 'floating()' },\n templateUrl: './email-field.component.html',\n styleUrl: './email-field.component.scss',\n})\nexport class SuEmailFieldComponent {\n readonly value = model('');\n /** The visible label */\n readonly label = input.required<string>();\n readonly placeholder = input<string>();\n /** An empty field counts as a problem @default false */\n readonly required = input(false, { transform: booleanAttribute });\n readonly messages = input<Partial<SuEmailMessages>>({});\n /** The label sits inside the field and moves up onto its border when the field is focused or filled @default false */\n readonly floating = input(false, { transform: booleanAttribute });\n /** Shows the problem before the field was left, e.g. when its form is sent @default false */\n readonly showProblem = input(false, { transform: booleanAttribute });\n /** Domains to suggest when one is mistyped */\n readonly domains = input<readonly string[]>(SU_COMMON_EMAIL_DOMAINS);\n /** Whether the address is valid, on every change */\n readonly validityChange = output<boolean>();\n\n protected readonly id = `su-email-${nextId++}`;\n protected readonly touched = signal(false);\n protected readonly check = computed(() => suCheckEmail(this.value(), this.domains()));\n protected readonly text = computed<SuEmailMessages>(() => ({ ...SU_EMAIL_MESSAGES, ...this.messages() }));\n /** The problem to show: once the field was left or `showProblem` is on, and an empty field only when it's required */\n protected readonly problem = computed(() => {\n const { problem } = this.check();\n const isShown = this.touched() || this.showProblem();\n if (!isShown || !problem || (problem === 'empty' && !this.required())) {\n return null;\n }\n return problem;\n });\n\n constructor() {\n effect(() => this.validityChange.emit(this.check().valid));\n }\n\n protected onInput(event: Event): void {\n if (event.target instanceof HTMLInputElement) {\n this.value.set(event.target.value);\n }\n }\n\n protected apply(suggestion: string): void {\n this.value.set(suggestion);\n this.touched.set(true);\n }\n}\n","@let result = check();\n@let t = text();\n@if (!floating()) {\n <label class=\"su-email-label\" [for]=\"id\">{{ label() }}</label>\n}\n<div class=\"su-email-box\" [class.is-valid]=\"result.valid\" [class.is-invalid]=\"problem() !== null\">\n <input\n class=\"su-email-input\"\n type=\"email\"\n inputmode=\"email\"\n autocomplete=\"email\"\n autocapitalize=\"off\"\n spellcheck=\"false\"\n [id]=\"id\"\n [value]=\"value()\"\n [required]=\"required()\"\n [attr.placeholder]=\"floating() ? ' ' : (placeholder() ?? null)\"\n [attr.aria-invalid]=\"problem() !== null ? true : null\"\n [attr.aria-describedby]=\"id + '-message'\"\n (input)=\"onInput($event)\"\n (blur)=\"touched.set(true)\"\n />\n @if (floating()) {\n <label class=\"su-email-label su-email-floating-label\" [for]=\"id\">{{ label() }}</label>\n }\n <span class=\"su-email-tick\" aria-hidden=\"true\"></span>\n</div>\n<p class=\"su-email-message\" aria-live=\"polite\" [id]=\"id + '-message'\">\n @if (problem(); as problem) {\n <span class=\"su-email-problem\">{{ t[problem] }}</span>\n }\n @if (result.suggestion; as suggestion) {\n <span class=\"su-email-suggestion\">\n {{ t.suggestion }}\n <button type=\"button\" class=\"su-email-fix\" (click)=\"apply(suggestion)\">{{ suggestion }}</button>?\n </span>\n }\n</p>\n","import { booleanAttribute, ChangeDetectionStrategy, Component, input, linkedSignal, output } from '@angular/core';\n\n/**\n * A real checkbox whose tick draws itself in, with a small squash when pressed and a dash when partly checked. Put the\n * label inside: `<su-lib-checkbox [(checked)]=\"agree\">I agree</su-lib-checkbox>`.\n */\n@Component({\n selector: 'su-lib-checkbox',\n changeDetection: ChangeDetectionStrategy.OnPush,\n templateUrl: './checkbox.component.html',\n styleUrl: './checkbox.component.scss',\n})\nexport class SuCheckboxComponent {\n readonly checked = input(false, { transform: booleanAttribute });\n /** Partly checked, e.g. some of a group; a click checks it */\n readonly indeterminate = input(false, { transform: booleanAttribute });\n readonly disabled = input(false, { transform: booleanAttribute });\n /** Ticked or unticked by the user: the new value */\n readonly checkedChange = output<boolean>();\n\n protected readonly shown = linkedSignal(() => this.checked());\n\n protected onChange(event: Event): void {\n if (event.target instanceof HTMLInputElement) {\n this.shown.set(event.target.checked);\n this.checkedChange.emit(event.target.checked);\n }\n }\n}\n","<label class=\"su-checkbox\" [class.is-mixed]=\"indeterminate() && !shown()\">\n <input\n type=\"checkbox\"\n [checked]=\"shown()\"\n [indeterminate]=\"indeterminate() && !shown()\"\n [disabled]=\"disabled()\"\n (change)=\"onChange($event)\"\n />\n <span class=\"su-checkbox-box\" aria-hidden=\"true\">\n <svg viewBox=\"0 0 24 24\">\n <path class=\"su-checkbox-tick\" d=\"M5 12.5l4.5 4.5L19 7.5\" />\n <path class=\"su-checkbox-dash\" d=\"M6 12h12\" />\n </svg>\n </span>\n <span class=\"su-checkbox-label\"><ng-content /></span>\n</label>\n","import { booleanAttribute, ChangeDetectionStrategy, Component, input, model } from '@angular/core';\n\n/** One chip: the value it stands for and its text */\nexport interface SuChipOption<TValue extends string> {\n readonly value: TValue;\n readonly label: string;\n readonly disabled?: boolean;\n}\n\n/**\n * Toggle chips to pick several options (or one, with `multiple` off): each is a button that pops a tick in when\n * picked. `<su-lib-chips label=\"Categories\" [options]=\"categories\" [(value)]=\"picked\" />`\n */\n@Component({\n selector: 'su-lib-chips',\n changeDetection: ChangeDetectionStrategy.OnPush,\n templateUrl: './chips.component.html',\n styleUrl: './chips.component.scss',\n})\nexport class SuChipsComponent<TValue extends string> {\n readonly options = input.required<readonly SuChipOption<TValue>[]>();\n /** The picked values, in the options' order */\n readonly value = model<readonly TValue[]>([]);\n /** The group's name for screen readers */\n readonly label = input.required<string>();\n /** Several can be picked; off, picking one replaces the other @default true */\n readonly multiple = input(true, { transform: booleanAttribute });\n\n protected isPicked(value: TValue): boolean {\n return this.value().includes(value);\n }\n\n protected toggle(option: SuChipOption<TValue>): void {\n if (!this.multiple()) {\n this.value.set([option.value]);\n return;\n }\n const picked = this.isPicked(option.value)\n ? this.value().filter((value) => value !== option.value)\n : [...this.value(), option.value];\n this.value.set(this.options().map((item) => item.value).filter((value) => picked.includes(value)));\n }\n}\n","<div class=\"su-chips\" role=\"group\" [attr.aria-label]=\"label()\">\n @for (option of options(); track option.value) {\n <button\n type=\"button\"\n class=\"su-chip\"\n [attr.aria-pressed]=\"isPicked(option.value)\"\n [disabled]=\"option.disabled ?? false\"\n (click)=\"toggle(option)\"\n >\n <span class=\"su-chip-tick\" aria-hidden=\"true\"></span>\n {{ option.label }}\n </button>\n }\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;AAEA;;;AAGG;MAOU,oBAAoB,CAAA;AACtB,IAAA,KAAK,GAAG,KAAK,CAAC,EAAE,CAAC;AACjB,IAAA,MAAM,GAAG,KAAK,CAAC,QAAQ,EAAU;AACjC,IAAA,KAAK,GAAG,KAAK,CAAC,QAAQ,EAAU;;AAEhC,IAAA,QAAQ,GAAG,KAAK,CAAC,KAAK,CAAC;AAEb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,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK;AACvC,cAAE,IAAI,CAAC,KAAK,EAAE,CAAC,MAAM,CAAC,CAAC,KAAK,KAAK,KAAK,KAAK,MAAM,CAAC,KAAK;AACvD,cAAE,CAAC,GAAG,IAAI,CAAC,KAAK,EAAE,EAAE,MAAM,CAAC,KAAK,CAAC;AACnC,QAAA,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,GAAG,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC,KAAK,KAAK,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC;IACpG;wGAtBW,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,SAAA,EAAA,IAAA,EAAA,gBAAgB,omBCnB7B,+bAcA,EAAA,MAAA,EAAA,CAAA,49CAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;4FDKa,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAN5B,SAAS;+BACE,cAAc,EAAA,eAAA,EACP,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,+bAAA,EAAA,MAAA,EAAA,CAAA,49CAAA,CAAA,EAAA;;;AEfjD;;AAEG;;;;"}
1
+ {"version":3,"file":"su-labs-fields.mjs","sources":["../../../../compat/angular-19/build/fields/src/lib/code-boxes/code-boxes.component.ts","../../../../compat/angular-19/build/fields/src/lib/code-boxes/code-boxes.component.html","../../../../compat/angular-19/build/fields/src/lib/strength-meter/password-strength.ts","../../../../compat/angular-19/build/fields/src/lib/strength-meter/strength-meter.component.ts","../../../../compat/angular-19/build/fields/src/lib/strength-meter/strength-meter.component.html","../../../../compat/angular-19/build/fields/src/lib/auto-grow/auto-grow.directive.ts","../../../../compat/angular-19/build/fields/src/lib/switch/switch.component.ts","../../../../compat/angular-19/build/fields/src/lib/switch/switch.component.html","../../../../compat/angular-19/build/fields/src/lib/email-field/email-check.ts","../../../../compat/angular-19/build/fields/src/lib/email-field/email-field.component.ts","../../../../compat/angular-19/build/fields/src/lib/email-field/email-field.component.html","../../../../compat/angular-19/build/fields/src/lib/checkbox/checkbox.component.ts","../../../../compat/angular-19/build/fields/src/lib/checkbox/checkbox.component.html","../../../../compat/angular-19/build/fields/src/lib/chips/chips.component.ts","../../../../compat/angular-19/build/fields/src/lib/chips/chips.component.html","../../../../compat/angular-19/build/fields/src/su-labs-fields.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, computed, input, model } from '@angular/core';\n\n/**\n * A short code typed into a row of boxes that fill one by one, then turn green in a wave once the code is complete.\n * One real text field lies over the boxes, so typing, pasting, the phone keyboard and screen readers all work as usual.\n */\n@Component({\n selector: 'su-lib-code-boxes',\n changeDetection: ChangeDetectionStrategy.OnPush,\n templateUrl: './code-boxes.component.html',\n styleUrl: './code-boxes.component.scss',\n})\nexport class SuCodeBoxesComponent {\n readonly value = model('');\n readonly length = input.required<number>();\n readonly label = input.required<string>();\n /** The code is whole and well-formed: the boxes turn green */\n readonly complete = input(false);\n\n protected readonly boxes = computed(() =>\n Array.from({ length: this.length() }, (_, index) => index)\n );\n\n /** Capitals without spaces, never longer than the boxes */\n protected onInput(field: HTMLInputElement): void {\n const code = field.value\n .replace(/\\s/g, '')\n .toUpperCase()\n .slice(0, this.length());\n field.value = code;\n this.value.set(code);\n }\n}\n","<input\n #field\n class=\"field\"\n type=\"text\"\n inputmode=\"text\"\n autocomplete=\"off\"\n autocapitalize=\"characters\"\n spellcheck=\"false\"\n required\n [attr.maxlength]=\"length()\"\n [attr.aria-label]=\"label()\"\n [value]=\"value()\"\n (input)=\"onInput(field)\"\n/>\n<span class=\"boxes\" [class.is-complete]=\"complete()\" aria-hidden=\"true\">\n @for (index of boxes(); track index) {\n <span\n class=\"box\"\n [class.is-filled]=\"index < value().length\"\n [class.is-current]=\"index === value().length\"\n [style.--index]=\"index\"\n >{{ value()[index] }}</span\n >\n }\n</span>\n","/** How strong a new password looks, one step per bar of the meter */\nexport const SU_STRENGTH_LEVELS = ['weak', 'fair', 'good', 'strong'] as const;\nexport type SuStrengthLevel = (typeof SU_STRENGTH_LEVELS)[number];\n\n/** Shortest password the meter counts as more than weak, unless told otherwise */\nexport const SU_DEFAULT_MIN_PASSWORD_LENGTH = 8;\n\n/**\n * Bars of the strength meter a password fills, from 0 (empty) to 4. Under the minimum length it stays at one bar,\n * whatever else it has. Then one bar each for: four characters past the minimum, letters with digits, and symbols or\n * mixed case.\n */\nexport function suPasswordStrength(\n password: string,\n minLength = SU_DEFAULT_MIN_PASSWORD_LENGTH\n): number {\n if (password.length === 0) {\n return 0;\n }\n if (password.length < minLength) {\n return 1;\n }\n const extras = [\n password.length >= minLength + 4,\n /\\p{L}/u.test(password) && /\\d/.test(password),\n /[^\\p{L}\\d]/u.test(password) ||\n (/\\p{Lu}/u.test(password) && /\\p{Ll}/u.test(password)),\n ].filter(Boolean).length;\n return 1 + extras;\n}\n\n/** The meter's word for a number of bars, or null for an empty password */\nexport const suStrengthLevel = (bars: number): SuStrengthLevel | null =>\n SU_STRENGTH_LEVELS[bars - 1] ?? null;\n","import { ChangeDetectionStrategy, Component, computed, effect, input, signal } from '@angular/core';\nimport { SU_DEFAULT_MIN_PASSWORD_LENGTH, SU_STRENGTH_LEVELS, suPasswordStrength, SuStrengthLevel, suStrengthLevel } from './password-strength';\n\n/**\n * Four bars under a new password that fill, and change colour, as the password gets stronger. It follows the field's\n * own typing, so forms keep their plain fields; a form that empties the field by code sends it an `input` event.\n * Its texts come in as inputs, so it fits any language.\n */\n@Component({\n selector: 'su-lib-strength-meter',\n changeDetection: ChangeDetectionStrategy.OnPush,\n templateUrl: './strength-meter.component.html',\n styleUrl: './strength-meter.component.scss',\n})\nexport class SuStrengthMeterComponent {\n readonly field = input.required<HTMLInputElement>();\n /** The meter's name for screen readers, e.g. \"Password strength\" */\n readonly label = input.required<string>();\n /** The word shown for each step */\n readonly levelNames =\n input.required<Readonly<Record<SuStrengthLevel, string>>>();\n readonly minLength = input(SU_DEFAULT_MIN_PASSWORD_LENGTH);\n\n private readonly password = signal('');\n protected readonly steps = SU_STRENGTH_LEVELS;\n protected readonly bars = computed(() =>\n suPasswordStrength(this.password(), this.minLength())\n );\n protected readonly level = computed(() => suStrengthLevel(this.bars()));\n protected readonly levelName = computed(() => {\n const level = this.level();\n return level ? this.levelNames()[level] : null;\n });\n\n constructor() {\n effect(onCleanup => {\n const field = this.field();\n const read = () => this.password.set(field.value);\n read();\n field.addEventListener('input', read);\n onCleanup(() => field.removeEventListener('input', read));\n });\n }\n}\n","<div\n class=\"bars\"\n role=\"meter\"\n [attr.aria-label]=\"label()\"\n aria-valuemin=\"0\"\n [attr.aria-valuemax]=\"steps.length\"\n [attr.aria-valuenow]=\"bars()\"\n [attr.aria-valuetext]=\"levelName()\"\n>\n @for (step of steps; track step; let index = $index) {\n <span class=\"bar\" [class.is-filled]=\"index < bars()\" [style.--index]=\"index\"></span>\n }\n</div>\n@if (levelName(); as name) {\n <small class=\"level\" [attr.data-level]=\"level()\" aria-hidden=\"true\">{{ name }}</small>\n}\n","import { afterNextRender, booleanAttribute, DestroyRef, Directive, ElementRef, inject, input } from '@angular/core';\n\n/** A soft spring that overshoots a little, as the box settles on its new height */\nconst SPRING = 'height 240ms cubic-bezier(0.34, 1.56, 0.64, 1)';\n\n/**\n * A text box that grows a line at a time as the text gets longer, and shrinks back when it is emptied, with a soft\n * spring (none for visitors who asked their device for less motion). `[suAutoGrow]=\"false\"` leaves it as it is.\n */\n@Directive({\n selector: 'textarea[suAutoGrow]',\n host: { '(input)': 'fit()' },\n})\nexport class SuAutoGrowDirective {\n readonly isOn = input(true, { alias: 'suAutoGrow', transform: booleanAttribute });\n\n private readonly box: HTMLTextAreaElement = inject(ElementRef).nativeElement;\n\n constructor() {\n const destroyRef = inject(DestroyRef);\n afterNextRender(() => {\n const onReset = () => setTimeout(() => this.fit());\n this.box.form?.addEventListener('reset', onReset);\n destroyRef.onDestroy(() =>\n this.box.form?.removeEventListener('reset', onReset)\n );\n });\n }\n\n protected fit(): void {\n if (!this.isOn()) {\n return;\n }\n const box = this.box;\n const from = box.offsetHeight;\n box.style.transition = 'none';\n box.style.height = 'auto';\n const to = box.scrollHeight + box.offsetHeight - box.clientHeight;\n box.style.height = `${from}px`;\n void box.offsetHeight;\n box.style.overflowY = 'hidden';\n box.style.transition = matchMedia('(prefers-reduced-motion: reduce)')\n .matches\n ? 'none'\n : SPRING;\n box.style.height = `${to}px`;\n }\n}\n","import { booleanAttribute, ChangeDetectionStrategy, Component, effect, input, linkedSignal, output, untracked } from '@angular/core';\n\n/** Where the label sits: after the switch, or before it with the switch at the end of the row */\nexport type SuSwitchLabelPosition = 'start' | 'end';\n\nexport type SuSwitchSize = 'small' | 'medium';\n\n/**\n * A real checkbox (`role=\"switch\"`) drawn as a sliding switch: the knob stretches while pressed, springs across and a\n * tick pops in when it's on. Put the label inside: `<su-lib-switch [(checked)]=\"on\">Reduce motion</su-lib-switch>`.\n *\n * It shows a click at once and follows `checked` whenever it changes. While `busy` (e.g. saving the change) it ignores\n * clicks, and once no longer busy it shows `checked` again, so a change that failed to save flips back.\n */\n@Component({\n selector: 'su-lib-switch',\n changeDetection: ChangeDetectionStrategy.OnPush,\n templateUrl: './switch.component.html',\n styleUrl: './switch.component.scss',\n})\nexport class SuSwitchComponent {\n readonly checked = input(false, { transform: booleanAttribute });\n readonly disabled = input(false, { transform: booleanAttribute });\n /** Busy saving the change: clicks are ignored, and `aria-busy` is set */\n readonly busy = input(false, { transform: booleanAttribute });\n /** @default 'end' */\n readonly labelPosition = input<SuSwitchLabelPosition>('end');\n /** @default 'medium' */\n readonly size = input<SuSwitchSize>('medium');\n /** Switched by the user: the new value */\n readonly checkedChange = output<boolean>();\n\n protected readonly shown = linkedSignal(() => this.checked());\n\n constructor() {\n effect(() => {\n if (!this.busy()) {\n untracked(() => this.shown.set(this.checked()));\n }\n });\n }\n\n protected onClick(event: MouseEvent): void {\n if (this.busy()) {\n event.preventDefault();\n }\n }\n\n protected onChange(event: Event): void {\n if (event.target instanceof HTMLInputElement) {\n this.shown.set(event.target.checked);\n this.checkedChange.emit(event.target.checked);\n }\n }\n}\n","<label class=\"su-switch su-switch-{{ size() }}\" [class.is-label-start]=\"labelPosition() === 'start'\">\n <input\n type=\"checkbox\"\n role=\"switch\"\n [checked]=\"shown()\"\n [disabled]=\"disabled()\"\n [attr.aria-busy]=\"busy() ? true : null\"\n (click)=\"onClick($event)\"\n (change)=\"onChange($event)\"\n />\n <span class=\"su-switch-track\" aria-hidden=\"true\"></span>\n <span class=\"su-switch-label\"><ng-content /></span>\n</label>\n","/** What's wrong with an email address, in the order it's checked */\nexport type SuEmailProblem = 'empty' | 'spaces' | 'at' | 'name' | 'domain' | 'dot' | 'ending';\n\n/** The outcome of `suCheckEmail` */\nexport interface SuEmailCheck {\n readonly valid: boolean;\n readonly problem: SuEmailProblem | null;\n /** The address with a common domain in place of a likely typo, e.g. `jo@gmail.com` for `jo@gmial.com`, or null */\n readonly suggestion: string | null;\n}\n\n/** Domains `suCheckEmail` suggests when one is mistyped */\nexport const SU_COMMON_EMAIL_DOMAINS: readonly string[] = [\n 'gmail.com',\n 'hotmail.com',\n 'outlook.com',\n 'live.com',\n 'yahoo.com',\n 'icloud.com',\n 'me.com',\n 'aol.com',\n 'proton.me',\n 'protonmail.com',\n 'gmx.com',\n 'yandex.com',\n 'hotmail.es',\n 'yahoo.es',\n];\n\n/** How far a typed domain may be from a common one, in single-letter edits, to suggest it */\nconst MAX_TYPO_DISTANCE = 2;\n\nfunction editDistance(a: string, b: string): number {\n let previous = Array.from({ length: b.length + 1 }, (_, index) => index);\n for (let i = 1; i <= a.length; i++) {\n const current = [i];\n for (let j = 1; j <= b.length; j++) {\n current[j] = Math.min(previous[j] + 1, current[j - 1] + 1, previous[j - 1] + (a[i - 1] === b[j - 1] ? 0 : 1));\n }\n previous = current;\n }\n return previous[b.length];\n}\n\n/** The common domain a typed one most likely meant, or null when it's already common or nothing is close */\nfunction closestDomain(domain: string, domains: readonly string[]): string | null {\n if (!domain || domains.includes(domain)) {\n return null;\n }\n let best: { readonly domain: string; readonly distance: number } | null = null;\n for (const candidate of domains) {\n const distance = editDistance(domain, candidate);\n if (distance <= MAX_TYPO_DISTANCE && (!best || distance < best.distance)) {\n best = { domain: candidate, distance };\n }\n }\n return best?.domain ?? null;\n}\n\nfunction problemOf(email: string): SuEmailProblem | null {\n if (email === '') {\n return 'empty';\n }\n if (/\\s/.test(email)) {\n return 'spaces';\n }\n const parts = email.split('@');\n if (parts.length !== 2) {\n return 'at';\n }\n const [name, domain] = parts;\n if (!name) {\n return 'name';\n }\n if (!domain) {\n return 'domain';\n }\n const labels = domain.split('.');\n if (labels.length < 2 || labels.some((label) => label === '')) {\n return 'dot';\n }\n return /^\\p{L}{2,}$/u.test(labels[labels.length - 1]) ? null : 'ending';\n}\n\n/**\n * Checks an email address the way people mistype them: empty, spaces, not exactly one @, nothing before or after it,\n * a domain without a proper dot, or an ending shorter than two letters. It also suggests a common domain for a\n * likely typo (`gmial.com` → `gmail.com`), even when the address is otherwise valid.\n */\nexport function suCheckEmail(value: string, domains: readonly string[] = SU_COMMON_EMAIL_DOMAINS): SuEmailCheck {\n const email = value.trim();\n const problem = problemOf(email);\n const [name = '', domain = ''] = email.split('@');\n const fixable = problem === null || problem === 'dot' || problem === 'ending';\n const fix = fixable && name ? closestDomain(domain.toLowerCase(), domains) : null;\n return { valid: problem === null, problem, suggestion: fix ? `${name}@${fix}` : null };\n}\n","import { booleanAttribute, ChangeDetectionStrategy, Component, computed, effect, input, model, output, signal } from '@angular/core';\nimport { SU_COMMON_EMAIL_DOMAINS, suCheckEmail, SuEmailProblem } from './email-check';\n\n/** The field's texts, e.g. in the page's language */\nexport interface SuEmailMessages extends Readonly<\n Record<SuEmailProblem, string>\n> {\n /** Before a suggested address: \"Did you mean jo@gmail.com?\" */\n readonly suggestion: string;\n}\n\nexport const SU_EMAIL_MESSAGES: SuEmailMessages = {\n empty: 'Enter your email address',\n spaces: 'An email address has no spaces',\n at: 'An email address has one @, like name@example.com',\n name: 'Add the part before the @',\n domain: 'Add the part after the @, like example.com',\n dot: 'The part after the @ needs a dot, like example.com',\n ending: 'The ending after the last dot needs at least two letters',\n suggestion: 'Did you mean',\n};\n\nlet nextId = 0;\n\n/**\n * An email field that checks the address the way people mistype it, and suggests a common domain for a likely typo\n * (`gmial.com` → `gmail.com`, applied with one tap). It stays quiet while typing and says what's wrong once the field\n * is left; a tick shows when the address looks right.\n */\n@Component({\n selector: 'su-lib-email-field',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: { '[class.is-floating]': 'floating()' },\n templateUrl: './email-field.component.html',\n styleUrl: './email-field.component.scss',\n})\nexport class SuEmailFieldComponent {\n readonly value = model('');\n /** The visible label */\n readonly label = input.required<string>();\n readonly placeholder = input<string>();\n /** An empty field counts as a problem @default false */\n readonly required = input(false, { transform: booleanAttribute });\n readonly messages = input<Partial<SuEmailMessages>>({});\n /** The label sits inside the field and moves up onto its border when the field is focused or filled @default false */\n readonly floating = input(false, { transform: booleanAttribute });\n /** Shows the problem before the field was left, e.g. when its form is sent @default false */\n readonly showProblem = input(false, { transform: booleanAttribute });\n /** Domains to suggest when one is mistyped */\n readonly domains = input<readonly string[]>(SU_COMMON_EMAIL_DOMAINS);\n /** Whether the address is valid, on every change */\n readonly validityChange = output<boolean>();\n\n protected readonly id = `su-email-${nextId++}`;\n protected readonly touched = signal(false);\n protected readonly check = computed(() =>\n suCheckEmail(this.value(), this.domains())\n );\n protected readonly text = computed<SuEmailMessages>(() => ({\n ...SU_EMAIL_MESSAGES,\n ...this.messages(),\n }));\n /** The problem to show: a typed address once the field was left or `showProblem` is on; an empty required field only with `showProblem` */\n protected readonly problem = computed(() => {\n const { problem } = this.check();\n const isShown =\n problem === 'empty'\n ? this.showProblem()\n : this.touched() || this.showProblem();\n if (!isShown || !problem || (problem === 'empty' && !this.required())) {\n return null;\n }\n return problem;\n });\n\n constructor() {\n effect(() => this.validityChange.emit(this.check().valid));\n }\n\n protected onInput(event: Event): void {\n if (event.target instanceof HTMLInputElement) {\n this.value.set(event.target.value);\n }\n }\n\n protected apply(suggestion: string): void {\n this.value.set(suggestion);\n this.touched.set(true);\n }\n}\n","@let result = check();\n@let t = text();\n@if (!floating()) {\n <label class=\"su-email-label\" [for]=\"id\">{{ label() }}</label>\n}\n<div class=\"su-email-box\" [class.is-valid]=\"result.valid\" [class.is-invalid]=\"problem() !== null\">\n <input\n class=\"su-email-input\"\n type=\"email\"\n inputmode=\"email\"\n autocomplete=\"email\"\n autocapitalize=\"off\"\n spellcheck=\"false\"\n [id]=\"id\"\n [value]=\"value()\"\n [required]=\"required()\"\n [attr.placeholder]=\"floating() ? ' ' : (placeholder() ?? null)\"\n [attr.aria-invalid]=\"problem() !== null ? true : null\"\n [attr.aria-describedby]=\"id + '-message'\"\n (input)=\"onInput($event)\"\n (blur)=\"touched.set(true)\"\n />\n @if (floating()) {\n <label class=\"su-email-label su-email-floating-label\" [for]=\"id\">{{ label() }}</label>\n }\n <span class=\"su-email-tick\" aria-hidden=\"true\"></span>\n</div>\n<p class=\"su-email-message\" aria-live=\"polite\" [id]=\"id + '-message'\">\n @if (problem(); as problem) {\n <span class=\"su-email-problem\">{{ t[problem] }}</span>\n }\n @if (result.suggestion; as suggestion) {\n <span class=\"su-email-suggestion\">\n {{ t.suggestion }}\n <button type=\"button\" class=\"su-email-fix\" (click)=\"apply(suggestion)\">{{ suggestion }}</button>?\n </span>\n }\n</p>\n","import { booleanAttribute, ChangeDetectionStrategy, Component, input, linkedSignal, output } from '@angular/core';\n\n/**\n * A real checkbox whose tick draws itself in, with a small squash when pressed and a dash when partly checked. Put the\n * label inside: `<su-lib-checkbox [(checked)]=\"agree\">I agree</su-lib-checkbox>`.\n */\n@Component({\n selector: 'su-lib-checkbox',\n changeDetection: ChangeDetectionStrategy.OnPush,\n templateUrl: './checkbox.component.html',\n styleUrl: './checkbox.component.scss',\n})\nexport class SuCheckboxComponent {\n readonly checked = input(false, { transform: booleanAttribute });\n /** Partly checked, e.g. some of a group; a click checks it */\n readonly indeterminate = input(false, { transform: booleanAttribute });\n readonly disabled = input(false, { transform: booleanAttribute });\n /** Ticked or unticked by the user: the new value */\n readonly checkedChange = output<boolean>();\n\n protected readonly shown = linkedSignal(() => this.checked());\n\n protected onChange(event: Event): void {\n if (event.target instanceof HTMLInputElement) {\n this.shown.set(event.target.checked);\n this.checkedChange.emit(event.target.checked);\n }\n }\n}\n","<label class=\"su-checkbox\" [class.is-mixed]=\"indeterminate() && !shown()\">\n <input\n type=\"checkbox\"\n [checked]=\"shown()\"\n [indeterminate]=\"indeterminate() && !shown()\"\n [disabled]=\"disabled()\"\n (change)=\"onChange($event)\"\n />\n <span class=\"su-checkbox-box\" aria-hidden=\"true\">\n <svg viewBox=\"0 0 24 24\">\n <path class=\"su-checkbox-tick\" d=\"M5 12.5l4.5 4.5L19 7.5\" />\n <path class=\"su-checkbox-dash\" d=\"M6 12h12\" />\n </svg>\n </span>\n <span class=\"su-checkbox-label\"><ng-content /></span>\n</label>\n","import { booleanAttribute, ChangeDetectionStrategy, Component, input, model } from '@angular/core';\n\n/** One chip: the value it stands for and its text */\nexport interface SuChipOption<TValue extends string> {\n readonly value: TValue;\n readonly label: string;\n readonly disabled?: boolean;\n}\n\n/**\n * Toggle chips to pick several options (or one, with `multiple` off): each is a button that pops a tick in when\n * picked. `<su-lib-chips label=\"Categories\" [options]=\"categories\" [(value)]=\"picked\" />`\n */\n@Component({\n selector: 'su-lib-chips',\n changeDetection: ChangeDetectionStrategy.OnPush,\n templateUrl: './chips.component.html',\n styleUrl: './chips.component.scss',\n})\nexport class SuChipsComponent<TValue extends string> {\n readonly options = input.required<readonly SuChipOption<TValue>[]>();\n /** The picked values, in the options' order */\n readonly value = model<readonly TValue[]>([]);\n /** The group's name for screen readers */\n readonly label = input.required<string>();\n /** Several can be picked; off, picking one replaces the other @default true */\n readonly multiple = input(true, { transform: booleanAttribute });\n\n protected isPicked(value: TValue): boolean {\n return this.value().includes(value);\n }\n\n protected toggle(option: SuChipOption<TValue>): void {\n if (!this.multiple()) {\n this.value.set([option.value]);\n return;\n }\n const picked = this.isPicked(option.value)\n ? this.value().filter((value) => value !== option.value)\n : [...this.value(), option.value];\n this.value.set(this.options().map((item) => item.value).filter((value) => picked.includes(value)));\n }\n}\n","<div class=\"su-chips\" role=\"group\" [attr.aria-label]=\"label()\">\n @for (option of options(); track option.value) {\n <button\n type=\"button\"\n class=\"su-chip\"\n [attr.aria-pressed]=\"isPicked(option.value)\"\n [disabled]=\"option.disabled ?? false\"\n (click)=\"toggle(option)\"\n >\n <span class=\"su-chip-tick\" aria-hidden=\"true\"></span>\n {{ option.label }}\n </button>\n }\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;AAEA;;;AAGG;MAOU,oBAAoB,CAAA;AACtB,IAAA,KAAK,GAAG,KAAK,CAAC,EAAE,CAAC;AACjB,IAAA,MAAM,GAAG,KAAK,CAAC,QAAQ,EAAU;AACjC,IAAA,KAAK,GAAG,KAAK,CAAC,QAAQ,EAAU;;AAEhC,IAAA,QAAQ,GAAG,KAAK,CAAC,KAAK,CAAC;AAEb,IAAA,KAAK,GAAG,QAAQ,CAAC,MAClC,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,KAAK,KAAK,CAAC,CAC3D;;AAGS,IAAA,OAAO,CAAC,KAAuB,EAAA;AACvC,QAAA,MAAM,IAAI,GAAG,KAAK,CAAC;AAChB,aAAA,OAAO,CAA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AAE,EAAE,MAAM,CAAC,KAAK,CAAC;AACnC,QAAA,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,GAAG,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC,KAAK,KAAK,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC;IACpG;wGAtBW,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,SAAA,EAAA,IAAA,EAAA,gBAAgB,omBCnB7B,+bAcA,EAAA,MAAA,EAAA,CAAA,49CAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;4FDKa,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAN5B,SAAS;+BACE,cAAc,EAAA,eAAA,EACP,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,+bAAA,EAAA,MAAA,EAAA,CAAA,49CAAA,CAAA,EAAA;;;AEfjD;;AAEG;;;;"}
@@ -31,7 +31,7 @@ export declare class SuEmailFieldComponent {
31
31
  protected readonly touched: import("@angular/core").WritableSignal<boolean>;
32
32
  protected readonly check: import("@angular/core").Signal<import("@su-labs/fields").SuEmailCheck>;
33
33
  protected readonly text: import("@angular/core").Signal<SuEmailMessages>;
34
- /** The problem to show: once the field was left or `showProblem` is on, and an empty field only when it's required */
34
+ /** The problem to show: a typed address once the field was left or `showProblem` is on; an empty required field only with `showProblem` */
35
35
  protected readonly problem: import("@angular/core").Signal<"empty" | "spaces" | "at" | "name" | "domain" | "dot" | "ending" | null>;
36
36
  constructor();
37
37
  protected onInput(event: Event): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@su-labs/fields",
3
- "version": "19.2.0",
3
+ "version": "19.2.1",
4
4
  "description": "Animated Angular form fields: code boxes that fill one by one, a password strength meter, an email field that catches typos, a sliding switch, checkboxes, chips, and a text box that grows as you type.",
5
5
  "keywords": [
6
6
  "angular",