@liquid-js/lyr-core 22.0.0-alpha.0 → 22.0.0-alpha.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/fesm2022/liquid-js-lyr-core-base.mjs +13 -1
- package/fesm2022/liquid-js-lyr-core-base.mjs.map +1 -1
- package/fesm2022/liquid-js-lyr-core-button.mjs +5 -2
- package/fesm2022/liquid-js-lyr-core-button.mjs.map +1 -1
- package/fesm2022/liquid-js-lyr-core-checkbox.mjs +2 -2
- package/fesm2022/liquid-js-lyr-core-checkbox.mjs.map +1 -1
- package/fesm2022/liquid-js-lyr-core-datepicker.mjs +7 -5
- package/fesm2022/liquid-js-lyr-core-datepicker.mjs.map +1 -1
- package/fesm2022/liquid-js-lyr-core-file-drop.mjs +7 -4
- package/fesm2022/liquid-js-lyr-core-file-drop.mjs.map +1 -1
- package/fesm2022/liquid-js-lyr-core-input.mjs +8 -5
- package/fesm2022/liquid-js-lyr-core-input.mjs.map +1 -1
- package/fesm2022/liquid-js-lyr-core-radio.mjs +1 -1
- package/fesm2022/liquid-js-lyr-core-radio.mjs.map +1 -1
- package/fesm2022/liquid-js-lyr-core-select.mjs +25 -15
- package/fesm2022/liquid-js-lyr-core-select.mjs.map +1 -1
- package/fesm2022/liquid-js-lyr-core-slider.mjs +5 -2
- package/fesm2022/liquid-js-lyr-core-slider.mjs.map +1 -1
- package/fesm2022/liquid-js-lyr-core-timepicker.mjs +1 -1
- package/fesm2022/liquid-js-lyr-core-timepicker.mjs.map +1 -1
- package/fesm2022/liquid-js-lyr-core-toggle.mjs +2 -2
- package/fesm2022/liquid-js-lyr-core-toggle.mjs.map +1 -1
- package/package.json +1 -1
- package/types/liquid-js-lyr-core-base.d.ts +6 -1
- package/types/liquid-js-lyr-core-button.d.ts +1 -1
- package/types/liquid-js-lyr-core-select.d.ts +5 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"liquid-js-lyr-core-file-drop.mjs","names":["convertToBoolProperty","enableTransitionsAfterRender"],"sources":["../../../packages/core/src/components/file-drop/file-drop.component.ts","../../../packages/core/src/components/file-drop/file-drop.component.html","../../../packages/core/src/components/file-drop/file-drop.module.ts"],"sourcesContent":["import { NgTemplateOutlet } from '@angular/common'\nimport {\n Component,\n computed,\n contentChild,\n DestroyRef,\n Directive,\n ElementRef,\n forwardRef,\n inject,\n input,\n linkedSignal,\n LOCALE_ID,\n output,\n signal,\n TemplateRef,\n viewChild\n} from '@angular/core'\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms'\n\nimport { injectNbDefaults, NbStatusService, NbComponentShape, NbComponentSize, NbComponentOrCustomStatus, ɵconvertToBoolProperty as convertToBoolProperty, NbBooleanInput, ɵenableTransitionsAfterRender as enableTransitionsAfterRender, injectNbTexts, NbLocalize, nbFormatList } from '@liquid-js/lyr-core/base'\nimport { NbIconComponent } from '@liquid-js/lyr-core/icon'\nimport { NbValidationDirective } from '@liquid-js/lyr-core/validation'\n\n/** @internal */\ndeclare const $localize: NbLocalize\n\n/**\n * Why a file was not added: its type isn't accepted, it's larger than `maxSize`, or it's over `maxFiles`\n * (or a second file for a single-file drop).\n */\nexport type NbFileRejectionReason = 'type' | 'size' | 'count'\n\nexport interface NbFileRejection {\n file: File\n reason: NbFileRejectionReason\n}\n\n/**\n * What a `nbFileDropPreview` template gets.\n */\nexport interface NbFileDropPreviewContext<T = unknown> {\n /**\n * The files in the value: the `File`s the user added, and any other items the value was set to,\n * such as the URL of a file that is already uploaded.\n */\n $implicit: T[]\n /**\n * Removes a file from the value.\n */\n remove: (file: T) => void\n /**\n * A URL to show the file at, e.g. as an image: an object URL for a `File` (revoked when it's removed),\n * the item itself when it's a string, otherwise `undefined`.\n */\n url: (file: T) => string | undefined\n}\n\n/**\n * Shows the files of a `nb-file-drop` in place of its default list, e.g. as image previews.\n *\n * ```html\n * <ng-template nbFileDropPreview let-files let-remove=\"remove\" let-url=\"url\">\n * @for (file of files; track file) {\n * <img [src]=\"url(file)\" alt=\"\" />\n * }\n * </ng-template>\n * ```\n */\n@Directive({\n selector: 'ng-template[nbFileDropPreview]'\n})\nexport class NbFileDropPreviewDirective {\n readonly template = inject<TemplateRef<NbFileDropPreviewContext>>(TemplateRef)\n\n static ngTemplateContextGuard(_dir: NbFileDropPreviewDirective, _ctx: unknown): _ctx is NbFileDropPreviewContext {\n return true\n }\n}\n\nlet lastFileDropId = 0\n\n/**\n * A form control for choosing files by dropping them, pasting them, or picking them in the browser's file dialog.\n *\n * ```html\n * <nb-file-drop formControlName=\"attachment\" accept=\"image/*,.pdf\" />\n * ```\n *\n * @stacked-example(Showcase, file-drop/file-drop-showcase.component)\n *\n * Drop zones come in the same sizes as other fields, which scale their width, spacing, text and buttons:\n * @stacked-example(Sizes, file-drop/file-drop-sizes.component)\n *\n * The value is a `File` (or `null`), or with `multiple` an array of them. Files that don't match `accept`, are larger\n * than `maxSize`, or are over `maxFiles` aren't added; `rejected` tells which and why.\n * @stacked-example(Multiple files and limits, file-drop/file-drop-multiple.component)\n *\n * Show the files your way with a `nbFileDropPreview` template; its `url` gives a URL to show a file at. The value\n * can also hold items that aren't `File`s, such as the URL of an image already uploaded, which the template shows too.\n * @stacked-example(Image preview, file-drop/file-drop-preview.component)\n *\n * The drop zone is operated with the keyboard through a native file input, which also takes the `id` for a label.\n * Add `nbValidation` to show its validation state.\n * @styles\n *\n * file-drop-border-style:\n * file-drop-border-width:\n * file-drop-tiny-padding:\n * file-drop-tiny-min-height:\n * file-drop-tiny-gap:\n * file-drop-tiny-icon-size:\n * file-drop-small-padding:\n * file-drop-small-min-height:\n * file-drop-small-gap:\n * file-drop-small-icon-size:\n * file-drop-medium-padding:\n * file-drop-medium-min-height:\n * file-drop-medium-gap:\n * file-drop-medium-icon-size:\n * file-drop-large-padding:\n * file-drop-large-min-height:\n * file-drop-large-gap:\n * file-drop-large-icon-size:\n * file-drop-giant-padding:\n * file-drop-giant-min-height:\n * file-drop-giant-gap:\n * file-drop-giant-icon-size:\n * file-drop-drag-background-color:\n * file-drop-drag-border-color:\n * file-drop-drag-text-color:\n * file-drop-remove-highlight-color:\n * file-drop-remove-hover-background-color:\n * file-drop-remove-focus-background-color:\n * file-drop-remove-active-background-color:\n * file-drop-remove-outline-width:\n * file-drop-remove-outline-color:\n * file-drop-remove-border-radius:\n */\n@Component({\n selector: 'nb-file-drop',\n templateUrl: './file-drop.component.html',\n styleUrls: ['./file-drop.component.scss'],\n imports: [NgTemplateOutlet, NbIconComponent],\n providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => NbFileDropComponent), multi: true }],\n host: {\n // The id goes to the native input, which labels point at; the host keeps none, so it isn't duplicated.\n '[attr.id]': 'null',\n '[class]': 'hostClasses()',\n '[class.full-width]': 'fullWidth()',\n // With the default list, the remove buttons sit at the end edge, as a form field's suffix button does.\n '[class.has-file-list]': 'files().length > 0 && !preview()',\n '[class.disabled]': 'isDisabled()',\n '[class.focused]': 'focused()',\n '[class.drag-over]': 'dragOver()',\n '(click)': 'onClick($event)',\n '(dragenter)': 'onDragEnter($event)',\n '(dragover)': 'onDragOver($event)',\n '(dragleave)': 'onDragLeave()',\n '(drop)': 'onDrop($event)',\n '(paste)': 'onPaste($event)',\n // The whole field shows focus, wherever in it the focus is, as a select does.\n '(focusin)': 'focused.set(true)',\n '(focusout)': 'onFocusOut($event)'\n }\n})\nexport class NbFileDropComponent implements ControlValueAccessor {\n // The app's defaults for this type, which the inputs below start from.\n protected readonly nbDefaults = injectNbDefaults('fileDrop')\n\n protected readonly hostElement = inject<ElementRef<HTMLElement>>(ElementRef)\n protected readonly statusService = inject(NbStatusService)\n protected readonly locale = inject(LOCALE_ID)\n protected readonly texts = injectNbTexts('fileDrop', () => ({\n prompt: $localize`:@@nb.fileDrop.prompt:Drop a file here or click to choose one`,\n promptMultiple: $localize`:@@nb.fileDrop.promptMultiple:Drop files here or click to choose them`,\n dropHere: $localize`:@@nb.fileDrop.dropHere:Drop to add`,\n remove: (name) => $localize`:@@nb.fileDrop.remove:Remove ${name}:name:`,\n added: (names) => $localize`:@@nb.fileDrop.added:Added ${names}:names:`,\n notAdded: (names) => $localize`:@@nb.fileDrop.notAdded:Couldn't add ${names}:names:`\n }))\n protected readonly validation = inject(NbValidationDirective, { self: true, optional: true })\n protected readonly sizeFormat = new Intl.NumberFormat(inject(LOCALE_ID), { maximumFractionDigits: 1 })\n\n /**\n * Id of the native file input, for a `<label for>`.\n */\n readonly id = input(`nb-file-drop-${lastFileDropId++}`)\n\n /**\n * File types to accept, as for a native file input: MIME types (`image/png`), wildcards (`image/*`) and\n * extensions (`.pdf`), separated by commas. Accepts every file when empty.\n */\n readonly accept = input('')\n\n /**\n * Whether the value is a list of files the user adds to, instead of one file the user replaces.\n */\n readonly multiple = input<boolean, NbBooleanInput>(false, { transform: convertToBoolProperty })\n\n /**\n * The largest file to accept, in bytes.\n */\n readonly maxSize = input<number>()\n\n /**\n * With `multiple`, the most files the value can hold.\n */\n readonly maxFiles = input<number>()\n\n /**\n * Scales the drop zone as other fields: `tiny`, `small`, `medium` (default), `large`, `giant`.\n */\n readonly sizeInput = input<NbComponentSize | undefined>(undefined, { alias: 'size' })\n /** The size in use: the input's, the app's default, or 'medium'. */\n readonly size = linkedSignal<NbComponentSize>(() => this.sizeInput() ?? this.nbDefaults().size ?? 'medium')\n\n /**\n * Status of the drop zone: `basic` (default), `primary`, `success`, `info`, `warning`, `danger`, `control` or a\n * custom one. With `nbValidation`, its error or success status takes over.\n */\n readonly status = input<NbComponentOrCustomStatus>('basic')\n\n /**\n * Shape of the drop zone: `rectangle`, `semi-round` or `round`. Unset, it follows the app's default, or\n * `rectangle`.\n */\n readonly shapeInput = input<NbComponentShape | undefined>(undefined, { alias: 'shape' })\n /** The shape in use: the input's, the app's default, or 'rectangle'. */\n readonly shape = linkedSignal<NbComponentShape>(() => this.shapeInput() ?? this.nbDefaults().shape ?? 'rectangle')\n\n /**\n * If set, the drop zone fills its container, as other fields do with `fullWidth`.\n */\n readonly fullWidth = input<boolean, NbBooleanInput>(false, { transform: convertToBoolProperty })\n\n /**\n * Disables the drop zone; a form control's disabled state does too.\n */\n readonly disabled = input<boolean, NbBooleanInput>(false, { transform: convertToBoolProperty })\n\n /**\n * What to drop, e.g. \"Drop your logo here\". Defaults to the `fileDrop` texts of `NbTextsService`.\n */\n readonly prompt = input<string>()\n\n /**\n * Files the user tried to add that weren't added, and why.\n */\n readonly rejected = output<NbFileRejection[]>()\n\n protected readonly preview = contentChild(NbFileDropPreviewDirective)\n protected readonly nativeInput = viewChild.required<ElementRef<HTMLInputElement>>('nativeInput')\n\n /**\n * The files in the value.\n */\n readonly files = signal(new Array<unknown>())\n\n protected readonly focused = signal(false)\n protected readonly announcement = signal('')\n protected readonly dragOver = signal(false)\n /** Whether it's disabled: the `disabled` input, or the form's disabled state, whichever changed last. */\n readonly isDisabled = linkedSignal(() => this.disabled())\n\n // With `nbValidation`, the status it gives while the control shows errors or success.\n protected readonly resolvedStatus = computed(() => this.validation?.status() ?? this.status())\n\n protected readonly hostClasses = computed(() => [\n `size-${this.size()}`,\n this.statusService.getStatusClass(this.resolvedStatus()),\n `shape-${this.shape()}`\n ])\n\n protected readonly resolvedPrompt = computed(\n () => this.prompt() ?? (this.multiple() ? this.texts().promptMultiple : this.texts().prompt)\n )\n protected readonly promptId = computed(() => `${this.id()}-prompt`)\n protected readonly listId = computed(() => `${this.id()}-files`)\n // The prompt says what the input does when there is no label, and the list which files it has; errors from\n // `nbValidation` come after them.\n protected readonly describedBy = computed(() =>\n [this.promptId(), this.files().length && !this.preview() ? this.listId() : '', this.validation?.describedBy()]\n .filter(Boolean)\n .join(' ')\n )\n\n protected readonly previewContext = computed<NbFileDropPreviewContext>(() => ({\n $implicit: this.files(),\n remove: (file) => this.remove(file),\n url: (file) => this.url(file)\n }))\n\n // Dragging over child elements fires dragleave on the parent, so count entries to know when the drag really left.\n protected dragDepth = 0\n protected readonly objectUrls = new Map<File, string>()\n protected onChange: (value: unknown) => void = () => undefined\n protected onTouched = () => {}\n\n constructor() {\n this.validation?.delegateAria()\n enableTransitionsAfterRender(this.hostElement.nativeElement)\n inject(DestroyRef).onDestroy(() => this.objectUrls.forEach((url) => URL.revokeObjectURL(url)))\n }\n\n /**\n * Adds files as if the user dropped them: only the accepted ones, replacing the file of a single-file drop.\n */\n addFiles(candidates: File[]) {\n if (this.isDisabled() || !candidates.length) {\n return\n }\n const rejections = new Array<NbFileRejection>()\n const accepted = new Array<File>()\n const room = this.multiple() ? (this.maxFiles() ?? Infinity) - this.files().length : 1\n for (const file of candidates) {\n const reason = this.rejectionReason(file)\n if (reason) {\n rejections.push({ file, reason })\n } else if (accepted.length >= room) {\n rejections.push({ file, reason: 'count' })\n } else {\n accepted.push(file)\n }\n }\n if (accepted.length) {\n if (this.multiple()) {\n this.setFiles([...this.files(), ...accepted])\n } else {\n this.setFiles(accepted)\n }\n }\n if (rejections.length) {\n this.rejected.emit(rejections)\n }\n // The native input is cleared after each choice, so screen readers would otherwise not hear what happened.\n const names = (files: File[]) => files.map((file) => file.name)\n this.announcement.set(\n [\n accepted.length ? this.texts().added(nbFormatList(this.locale, names(accepted))) : '',\n rejections.length\n ? this.texts().notAdded(nbFormatList(this.locale, names(rejections.map(({ file }) => file))))\n : ''\n ]\n .filter(Boolean)\n .join('. ')\n )\n }\n\n /**\n * Removes a file from the value, unless the drop zone is disabled.\n */\n remove(file: unknown) {\n if (!this.isDisabled()) {\n this.setFiles(this.files().filter((existing) => existing !== file))\n }\n }\n\n /**\n * Opens the browser's file dialog.\n */\n open() {\n if (!this.isDisabled()) {\n // Focused, as a click on a field focuses it, so leaving it touches the control, as does cancelling the dialog.\n const field = this.nativeInput().nativeElement\n field.focus({ preventScroll: true })\n field.click()\n }\n }\n\n writeValue(value: unknown) {\n this.files.set(value == null ? [] : Array.isArray(value) ? [...value] : [value])\n this.revokeUnused()\n }\n\n registerOnChange(fn: (value: unknown) => void) {\n this.onChange = fn\n }\n\n registerOnTouched(fn: () => void) {\n this.onTouched = fn\n }\n\n setDisabledState(isDisabled: boolean) {\n this.isDisabled.set(isDisabled)\n }\n\n protected setFiles(files: unknown[]) {\n this.files.set(files)\n this.revokeUnused()\n this.onChange(this.multiple() ? files : (files[0] ?? null))\n this.onTouched()\n }\n\n protected url(file: unknown): string | undefined {\n if (typeof file === 'string') {\n return file\n }\n if (!(file instanceof File)) {\n return undefined\n }\n let url = this.objectUrls.get(file)\n if (!url) {\n url = URL.createObjectURL(file)\n this.objectUrls.set(file, url)\n }\n return url\n }\n\n protected revokeUnused() {\n const files = this.files()\n for (const [file, url] of this.objectUrls) {\n if (!files.includes(file)) {\n URL.revokeObjectURL(url)\n this.objectUrls.delete(file)\n }\n }\n }\n\n protected rejectionReason(file: File): NbFileRejectionReason | undefined {\n const maxSize = this.maxSize()\n if (!this.isAccepted(file)) {\n return 'type'\n }\n if (maxSize !== undefined && file.size > maxSize) {\n return 'size'\n }\n return undefined\n }\n\n // The same rules as the native accept attribute: a file is accepted when it matches any of the entries.\n protected isAccepted(file: File): boolean {\n const entries = this.accept()\n .split(',')\n .map((entry) => entry.trim().toLowerCase())\n .filter(Boolean)\n if (!entries.length) {\n return true\n }\n const name = file.name.toLowerCase()\n const type = file.type.toLowerCase()\n return entries.some((entry) => {\n if (entry.startsWith('.')) {\n return name.endsWith(entry)\n }\n if (entry.endsWith('/*')) {\n return type.startsWith(entry.slice(0, -1))\n }\n return type === entry\n })\n }\n\n protected formatSize(file: unknown): string {\n if (!(file instanceof File)) {\n return ''\n }\n const units = ['B', 'KB', 'MB', 'GB']\n let size = file.size\n let unit = 0\n while (size >= 1024 && unit < units.length - 1) {\n size /= 1024\n unit++\n }\n return `${this.sizeFormat.format(size)} ${units[unit]}`\n }\n\n protected fileName(file: unknown): string {\n if (file instanceof File) {\n return file.name\n }\n return typeof file === 'string' ? (file.split('/').pop() ?? file) : String(file)\n }\n\n protected onClick(event: MouseEvent) {\n // Buttons and links in the files, such as remove, do their own thing; the input opens the dialog itself.\n const target = event.target as Element\n if (target.closest('button, a, input') === null) {\n this.open()\n }\n }\n\n protected onFocusOut(event: FocusEvent) {\n // Moving between the input and the remove buttons stays inside the field.\n if (!this.hostElement.nativeElement.contains(event.relatedTarget as Node | null)) {\n this.focused.set(false)\n this.onTouched()\n }\n }\n\n protected onSelected() {\n const nativeInput = this.nativeInput().nativeElement\n this.addFiles(Array.from(nativeInput.files ?? []))\n // Clear it, so choosing the same file again still reports a change.\n nativeInput.value = ''\n }\n\n protected onDragEnter(event: DragEvent) {\n if (this.hasFiles(event)) {\n event.preventDefault()\n this.dragDepth++\n this.dragOver.set(true)\n }\n }\n\n protected onDragOver(event: DragEvent) {\n if (this.hasFiles(event) && event.dataTransfer) {\n event.preventDefault()\n event.dataTransfer.dropEffect = this.isDisabled() ? 'none' : 'copy'\n }\n }\n\n protected onDragLeave() {\n this.dragDepth = Math.max(0, this.dragDepth - 1)\n if (!this.dragDepth) {\n this.dragOver.set(false)\n }\n }\n\n protected onDrop(event: DragEvent) {\n if (!this.hasFiles(event)) {\n return\n }\n event.preventDefault()\n this.dragDepth = 0\n this.dragOver.set(false)\n this.addFiles(Array.from(event.dataTransfer?.files ?? []))\n }\n\n protected onPaste(event: ClipboardEvent) {\n const files = Array.from(event.clipboardData?.files ?? [])\n if (files.length) {\n event.preventDefault()\n this.addFiles(files)\n }\n }\n\n protected hasFiles(event: DragEvent): boolean {\n return !!event.dataTransfer?.types.includes('Files')\n }\n}\n","<input #nativeInput\n type=\"file\"\n class=\"native-input visually-hidden\"\n tabindex=\"0\"\n [id]=\"id()\"\n [accept]=\"accept()\"\n [multiple]=\"multiple()\"\n [disabled]=\"isDisabled()\"\n [attr.aria-invalid]=\"validation?.ariaInvalid()\"\n [attr.aria-describedby]=\"describedBy()\"\n [attr.aria-labelledby]=\"validation?.labelledBy()\"\n [attr.aria-required]=\"validation?.ariaRequired()\"\n (cancel)=\"onTouched()\"\n (change)=\"onSelected()\" />\n\n@if (files().length) {\n@if (preview(); as preview) {\n<ng-container *ngTemplateOutlet=\"preview.template; context: previewContext()\" />\n} @else {\n<ul class=\"file-list\"\n [id]=\"listId()\">\n @for (file of files(); track file) {\n <li class=\"file\">\n <span class=\"file-info\">\n <!-- A name aligns by its own direction, so a long one is cut at its end. -->\n <span class=\"file-name\"\n dir=\"auto\">{{ fileName(file) }}</span>\n @if (formatSize(file); as size) {\n <span class=\"file-size\">{{ size }}</span>\n }\n </span>\n <button type=\"button\"\n class=\"file-remove\"\n tabindex=\"0\"\n [disabled]=\"isDisabled()\"\n [attr.aria-label]=\"texts().remove(fileName(file))\"\n (click)=\"remove(file); nativeInput.focus()\">\n <nb-icon icon=\"close-outline\"\n pack=\"essentials\" />\n </button>\n </li>\n }\n</ul>\n}\n}\n\n@if (!files().length || multiple()) {\n<div class=\"prompt\"\n [id]=\"promptId()\">\n <nb-icon icon=\"cloud-upload-outline\"\n pack=\"essentials\" />\n {{ resolvedPrompt() }}\n</div>\n}\n\n<span class=\"visually-hidden\"\n aria-live=\"polite\">{{ announcement() }}</span>\n\n<div class=\"drop-overlay\"\n aria-hidden=\"true\">{{ texts().dropHere }}</div>\n","import { NgModule } from '@angular/core'\n\nimport { NbFileDropComponent, NbFileDropPreviewDirective } from './file-drop.component'\n\nconst COMPONENTS = [NbFileDropComponent, NbFileDropPreviewDirective]\n\n@NgModule({\n imports: [...COMPONENTS],\n exports: [...COMPONENTS]\n})\nexport class NbFileDropModule {}\n"],"mappings":";;;;;;;AAwEA,IAAa,6BAAb,MAAa,2BAA0B;CAHvC,cAAA;EAIa,KAAA,WAAW,OAA8C,WAAW;CAKhF;CAHG,OAAO,uBAAuB,MAAkC,MAAa;EACzE,OAAO;CACX;CALS;EAAA,KAAA,OAAA,GAAA,mBAAA;GAAA,YAAA;GAAA,SAAA;GAAA,UAAA;GAAA,MAAA;GAA0B,MAAA,CAAA;GAAA,QAAA,GAAA,gBAAA;EAAA,CAAA;CAAA;CAA1B;EAAA,KAAA,OAAA,GAAA,qBAAA;GAAA,YAAA;GAAA,S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CAAA,UAAA;CAAA,MAAA;CAAgB,YAAA,CAAA;EAJ5B,MAAA;EAAS,MAAA,CAAA;GACN,SAAS,CAAC,GAAG,UAAU;GACvB,SAAS,CAAC,GAAG,UAAU;EAC1B,CAAA"}
|
|
1
|
+
{"version":3,"file":"liquid-js-lyr-core-file-drop.mjs","names":["convertToBoolProperty","enableTransitionsAfterRender","sameControlValue"],"sources":["../../../packages/core/src/components/file-drop/file-drop.component.ts","../../../packages/core/src/components/file-drop/file-drop.component.html","../../../packages/core/src/components/file-drop/file-drop.module.ts"],"sourcesContent":["import { NgTemplateOutlet } from '@angular/common'\nimport {\n Component,\n computed,\n contentChild,\n DestroyRef,\n Directive,\n ElementRef,\n forwardRef,\n inject,\n input,\n linkedSignal,\n LOCALE_ID,\n output,\n signal,\n TemplateRef,\n untracked,\n viewChild\n} from '@angular/core'\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms'\n\nimport { injectNbDefaults, NbStatusService, NbComponentShape, NbComponentSize, NbComponentOrCustomStatus, ɵconvertToBoolProperty as convertToBoolProperty, NbBooleanInput, ɵenableTransitionsAfterRender as enableTransitionsAfterRender, injectNbTexts, NbLocalize, nbFormatList, ɵsameControlValue as sameControlValue } from '@liquid-js/lyr-core/base'\nimport { NbIconComponent } from '@liquid-js/lyr-core/icon'\nimport { NbValidationDirective } from '@liquid-js/lyr-core/validation'\n\n/** @internal */\ndeclare const $localize: NbLocalize\n\n/**\n * Why a file was not added: its type isn't accepted, it's larger than `maxSize`, or it's over `maxFiles`\n * (or a second file for a single-file drop).\n */\nexport type NbFileRejectionReason = 'type' | 'size' | 'count'\n\nexport interface NbFileRejection {\n file: File\n reason: NbFileRejectionReason\n}\n\n/**\n * What a `nbFileDropPreview` template gets.\n */\nexport interface NbFileDropPreviewContext<T = unknown> {\n /**\n * The files in the value: the `File`s the user added, and any other items the value was set to,\n * such as the URL of a file that is already uploaded.\n */\n $implicit: T[]\n /**\n * Removes a file from the value.\n */\n remove: (file: T) => void\n /**\n * A URL to show the file at, e.g. as an image: an object URL for a `File` (revoked when it's removed),\n * the item itself when it's a string, otherwise `undefined`.\n */\n url: (file: T) => string | undefined\n}\n\n/**\n * Shows the files of a `nb-file-drop` in place of its default list, e.g. as image previews.\n *\n * ```html\n * <ng-template nbFileDropPreview let-files let-remove=\"remove\" let-url=\"url\">\n * @for (file of files; track file) {\n * <img [src]=\"url(file)\" alt=\"\" />\n * }\n * </ng-template>\n * ```\n */\n@Directive({\n selector: 'ng-template[nbFileDropPreview]'\n})\nexport class NbFileDropPreviewDirective {\n readonly template = inject<TemplateRef<NbFileDropPreviewContext>>(TemplateRef)\n\n static ngTemplateContextGuard(_dir: NbFileDropPreviewDirective, _ctx: unknown): _ctx is NbFileDropPreviewContext {\n return true\n }\n}\n\nlet lastFileDropId = 0\n\n/**\n * A form control for choosing files by dropping them, pasting them, or picking them in the browser's file dialog.\n *\n * ```html\n * <nb-file-drop formControlName=\"attachment\" accept=\"image/*,.pdf\" />\n * ```\n *\n * @stacked-example(Showcase, file-drop/file-drop-showcase.component)\n *\n * Drop zones come in the same sizes as other fields, which scale their width, spacing, text and buttons:\n * @stacked-example(Sizes, file-drop/file-drop-sizes.component)\n *\n * The value is a `File` (or `null`), or with `multiple` an array of them. Files that don't match `accept`, are larger\n * than `maxSize`, or are over `maxFiles` aren't added; `rejected` tells which and why.\n * @stacked-example(Multiple files and limits, file-drop/file-drop-multiple.component)\n *\n * Show the files your way with a `nbFileDropPreview` template; its `url` gives a URL to show a file at. The value\n * can also hold items that aren't `File`s, such as the URL of an image already uploaded, which the template shows too.\n * @stacked-example(Image preview, file-drop/file-drop-preview.component)\n *\n * The drop zone is operated with the keyboard through a native file input, which also takes the `id` for a label.\n * Add `nbValidation` to show its validation state.\n * @styles\n *\n * file-drop-border-style:\n * file-drop-border-width:\n * file-drop-tiny-padding:\n * file-drop-tiny-min-height:\n * file-drop-tiny-gap:\n * file-drop-tiny-icon-size:\n * file-drop-small-padding:\n * file-drop-small-min-height:\n * file-drop-small-gap:\n * file-drop-small-icon-size:\n * file-drop-medium-padding:\n * file-drop-medium-min-height:\n * file-drop-medium-gap:\n * file-drop-medium-icon-size:\n * file-drop-large-padding:\n * file-drop-large-min-height:\n * file-drop-large-gap:\n * file-drop-large-icon-size:\n * file-drop-giant-padding:\n * file-drop-giant-min-height:\n * file-drop-giant-gap:\n * file-drop-giant-icon-size:\n * file-drop-drag-background-color:\n * file-drop-drag-border-color:\n * file-drop-drag-text-color:\n * file-drop-remove-highlight-color:\n * file-drop-remove-hover-background-color:\n * file-drop-remove-focus-background-color:\n * file-drop-remove-active-background-color:\n * file-drop-remove-outline-width:\n * file-drop-remove-outline-color:\n * file-drop-remove-border-radius:\n */\n@Component({\n selector: 'nb-file-drop',\n templateUrl: './file-drop.component.html',\n styleUrls: ['./file-drop.component.scss'],\n imports: [NgTemplateOutlet, NbIconComponent],\n providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => NbFileDropComponent), multi: true }],\n host: {\n // The id goes to the native input, which labels point at; the host keeps none, so it isn't duplicated.\n '[attr.id]': 'null',\n '[class]': 'hostClasses()',\n '[class.full-width]': 'fullWidth()',\n // With the default list, the remove buttons sit at the end edge, as a form field's suffix button does.\n '[class.has-file-list]': 'files().length > 0 && !preview()',\n '[class.disabled]': 'isDisabled()',\n '[class.focused]': 'focused()',\n '[class.drag-over]': 'dragOver()',\n '(click)': 'onClick($event)',\n '(dragenter)': 'onDragEnter($event)',\n '(dragover)': 'onDragOver($event)',\n '(dragleave)': 'onDragLeave()',\n '(drop)': 'onDrop($event)',\n '(paste)': 'onPaste($event)',\n // The whole field shows focus, wherever in it the focus is, as a select does.\n '(focusin)': 'focused.set(true)',\n '(focusout)': 'onFocusOut($event)'\n }\n})\nexport class NbFileDropComponent implements ControlValueAccessor {\n // The app's defaults for this type, which the inputs below start from.\n protected readonly nbDefaults = injectNbDefaults('fileDrop')\n\n protected readonly hostElement = inject<ElementRef<HTMLElement>>(ElementRef)\n protected readonly statusService = inject(NbStatusService)\n protected readonly locale = inject(LOCALE_ID)\n protected readonly texts = injectNbTexts('fileDrop', () => ({\n prompt: $localize`:@@nb.fileDrop.prompt:Drop a file here or click to choose one`,\n promptMultiple: $localize`:@@nb.fileDrop.promptMultiple:Drop files here or click to choose them`,\n dropHere: $localize`:@@nb.fileDrop.dropHere:Drop to add`,\n remove: (name) => $localize`:@@nb.fileDrop.remove:Remove ${name}:name:`,\n added: (names) => $localize`:@@nb.fileDrop.added:Added ${names}:names:`,\n notAdded: (names) => $localize`:@@nb.fileDrop.notAdded:Couldn't add ${names}:names:`\n }))\n protected readonly validation = inject(NbValidationDirective, { self: true, optional: true })\n protected readonly sizeFormat = new Intl.NumberFormat(inject(LOCALE_ID), { maximumFractionDigits: 1 })\n\n /**\n * Id of the native file input, for a `<label for>`.\n */\n readonly id = input(`nb-file-drop-${lastFileDropId++}`)\n\n /**\n * File types to accept, as for a native file input: MIME types (`image/png`), wildcards (`image/*`) and\n * extensions (`.pdf`), separated by commas. Accepts every file when empty.\n */\n readonly accept = input('')\n\n /**\n * Whether the value is a list of files the user adds to, instead of one file the user replaces.\n */\n readonly multiple = input<boolean, NbBooleanInput>(false, { transform: convertToBoolProperty })\n\n /**\n * The largest file to accept, in bytes.\n */\n readonly maxSize = input<number>()\n\n /**\n * With `multiple`, the most files the value can hold.\n */\n readonly maxFiles = input<number>()\n\n /**\n * Scales the drop zone as other fields: `tiny`, `small`, `medium` (default), `large`, `giant`.\n */\n readonly sizeInput = input<NbComponentSize | undefined>(undefined, { alias: 'size' })\n /** The size in use: the input's, the app's default, or 'medium'. */\n readonly size = linkedSignal<NbComponentSize>(() => this.sizeInput() ?? this.nbDefaults().size ?? 'medium')\n\n /**\n * Status of the drop zone: `basic` (default), `primary`, `success`, `info`, `warning`, `danger`, `control` or a\n * custom one. With `nbValidation`, its error or success status takes over.\n */\n readonly status = input<NbComponentOrCustomStatus>('basic')\n\n /**\n * Shape of the drop zone: `rectangle`, `semi-round` or `round`. Unset, it follows the app's default, or\n * `rectangle`.\n */\n readonly shapeInput = input<NbComponentShape | undefined>(undefined, { alias: 'shape' })\n /** The shape in use: the input's, the app's default, or 'rectangle'. */\n readonly shape = linkedSignal<NbComponentShape>(() => this.shapeInput() ?? this.nbDefaults().shape ?? 'rectangle')\n\n /**\n * If set, the drop zone fills its container, as other fields do with `fullWidth`.\n */\n readonly fullWidth = input<boolean, NbBooleanInput>(false, { transform: convertToBoolProperty })\n\n /**\n * Disables the drop zone; a form control's disabled state does too.\n */\n readonly disabled = input<boolean, NbBooleanInput>(false, { transform: convertToBoolProperty })\n\n /**\n * What to drop, e.g. \"Drop your logo here\". Defaults to the `fileDrop` texts of `NbTextsService`.\n */\n readonly prompt = input<string>()\n\n /**\n * Files the user tried to add that weren't added, and why.\n */\n readonly rejected = output<NbFileRejection[]>()\n\n protected readonly preview = contentChild(NbFileDropPreviewDirective)\n protected readonly nativeInput = viewChild.required<ElementRef<HTMLInputElement>>('nativeInput')\n\n /**\n * The files in the value.\n */\n readonly files = signal(new Array<unknown>())\n\n protected readonly focused = signal(false)\n protected readonly announcement = signal('')\n protected readonly dragOver = signal(false)\n /** Whether it's disabled: the `disabled` input, or the form's disabled state, whichever changed last. */\n readonly isDisabled = linkedSignal(() => this.disabled())\n\n // With `nbValidation`, the status it gives while the control shows errors or success.\n protected readonly resolvedStatus = computed(() => this.validation?.status() ?? this.status())\n\n protected readonly hostClasses = computed(() => [\n `size-${this.size()}`,\n this.statusService.getStatusClass(this.resolvedStatus()),\n `shape-${this.shape()}`\n ])\n\n protected readonly resolvedPrompt = computed(\n () => this.prompt() ?? (this.multiple() ? this.texts().promptMultiple : this.texts().prompt)\n )\n protected readonly promptId = computed(() => `${this.id()}-prompt`)\n protected readonly listId = computed(() => `${this.id()}-files`)\n // The prompt says what the input does when there is no label, and the list which files it has; errors from\n // `nbValidation` come after them.\n protected readonly describedBy = computed(() =>\n [this.promptId(), this.files().length && !this.preview() ? this.listId() : '', this.validation?.describedBy()]\n .filter(Boolean)\n .join(' ')\n )\n\n protected readonly previewContext = computed<NbFileDropPreviewContext>(() => ({\n $implicit: this.files(),\n remove: (file) => this.remove(file),\n url: (file) => this.url(file)\n }))\n\n // Dragging over child elements fires dragleave on the parent, so count entries to know when the drag really left.\n protected dragDepth = 0\n protected readonly objectUrls = new Map<File, string>()\n protected onChange: (value: unknown) => void = () => undefined\n protected onTouched = () => {}\n\n constructor() {\n this.validation?.delegateAria()\n enableTransitionsAfterRender(this.hostElement.nativeElement)\n inject(DestroyRef).onDestroy(() => this.objectUrls.forEach((url) => URL.revokeObjectURL(url)))\n }\n\n /**\n * Adds files as if the user dropped them: only the accepted ones, replacing the file of a single-file drop.\n */\n addFiles(candidates: File[]) {\n if (this.isDisabled() || !candidates.length) {\n return\n }\n const rejections = new Array<NbFileRejection>()\n const accepted = new Array<File>()\n const room = this.multiple() ? (this.maxFiles() ?? Infinity) - this.files().length : 1\n for (const file of candidates) {\n const reason = this.rejectionReason(file)\n if (reason) {\n rejections.push({ file, reason })\n } else if (accepted.length >= room) {\n rejections.push({ file, reason: 'count' })\n } else {\n accepted.push(file)\n }\n }\n if (accepted.length) {\n if (this.multiple()) {\n this.setFiles([...this.files(), ...accepted])\n } else {\n this.setFiles(accepted)\n }\n }\n if (rejections.length) {\n this.rejected.emit(rejections)\n }\n // The native input is cleared after each choice, so screen readers would otherwise not hear what happened.\n const names = (files: File[]) => files.map((file) => file.name)\n this.announcement.set(\n [\n accepted.length ? this.texts().added(nbFormatList(this.locale, names(accepted))) : '',\n rejections.length\n ? this.texts().notAdded(nbFormatList(this.locale, names(rejections.map(({ file }) => file))))\n : ''\n ]\n .filter(Boolean)\n .join('. ')\n )\n }\n\n /**\n * Removes a file from the value, unless the drop zone is disabled.\n */\n remove(file: unknown) {\n if (!this.isDisabled()) {\n this.setFiles(this.files().filter((existing) => existing !== file))\n }\n }\n\n /**\n * Opens the browser's file dialog.\n */\n open() {\n if (!this.isDisabled()) {\n // Focused, as a click on a field focuses it, so leaving it touches the control, as does cancelling the dialog.\n const field = this.nativeInput().nativeElement\n field.focus({ preventScroll: true })\n field.click()\n }\n }\n\n // Untracked, as forms write values from wherever the app sets them, e.g. an effect that mustn't come to depend\n // on the control.\n writeValue(value: unknown) {\n untracked(() => {\n const files = value == null ? [] : Array.isArray(value) ? [...value] : [value]\n if (!sameControlValue(this.files(), files)) {\n this.files.set(files)\n }\n this.revokeUnused()\n })\n }\n\n registerOnChange(fn: (value: unknown) => void) {\n this.onChange = fn\n }\n\n registerOnTouched(fn: () => void) {\n this.onTouched = fn\n }\n\n setDisabledState(isDisabled: boolean) {\n this.isDisabled.set(isDisabled)\n }\n\n protected setFiles(files: unknown[]) {\n this.files.set(files)\n this.revokeUnused()\n this.onChange(this.multiple() ? files : (files[0] ?? null))\n this.onTouched()\n }\n\n protected url(file: unknown): string | undefined {\n if (typeof file === 'string') {\n return file\n }\n if (!(file instanceof File)) {\n return undefined\n }\n let url = this.objectUrls.get(file)\n if (!url) {\n url = URL.createObjectURL(file)\n this.objectUrls.set(file, url)\n }\n return url\n }\n\n protected revokeUnused() {\n const files = this.files()\n for (const [file, url] of this.objectUrls) {\n if (!files.includes(file)) {\n URL.revokeObjectURL(url)\n this.objectUrls.delete(file)\n }\n }\n }\n\n protected rejectionReason(file: File): NbFileRejectionReason | undefined {\n const maxSize = this.maxSize()\n if (!this.isAccepted(file)) {\n return 'type'\n }\n if (maxSize !== undefined && file.size > maxSize) {\n return 'size'\n }\n return undefined\n }\n\n // The same rules as the native accept attribute: a file is accepted when it matches any of the entries.\n protected isAccepted(file: File): boolean {\n const entries = this.accept()\n .split(',')\n .map((entry) => entry.trim().toLowerCase())\n .filter(Boolean)\n if (!entries.length) {\n return true\n }\n const name = file.name.toLowerCase()\n const type = file.type.toLowerCase()\n return entries.some((entry) => {\n if (entry.startsWith('.')) {\n return name.endsWith(entry)\n }\n if (entry.endsWith('/*')) {\n return type.startsWith(entry.slice(0, -1))\n }\n return type === entry\n })\n }\n\n protected formatSize(file: unknown): string {\n if (!(file instanceof File)) {\n return ''\n }\n const units = ['B', 'KB', 'MB', 'GB']\n let size = file.size\n let unit = 0\n while (size >= 1024 && unit < units.length - 1) {\n size /= 1024\n unit++\n }\n return `${this.sizeFormat.format(size)} ${units[unit]}`\n }\n\n protected fileName(file: unknown): string {\n if (file instanceof File) {\n return file.name\n }\n return typeof file === 'string' ? (file.split('/').pop() ?? file) : String(file)\n }\n\n protected onClick(event: MouseEvent) {\n // Buttons and links in the files, such as remove, do their own thing; the input opens the dialog itself.\n const target = event.target as Element\n if (target.closest('button, a, input') === null) {\n this.open()\n }\n }\n\n protected onFocusOut(event: FocusEvent) {\n // Moving between the input and the remove buttons stays inside the field.\n if (!this.hostElement.nativeElement.contains(event.relatedTarget as Node | null)) {\n this.focused.set(false)\n this.onTouched()\n }\n }\n\n protected onSelected() {\n const nativeInput = this.nativeInput().nativeElement\n this.addFiles(Array.from(nativeInput.files ?? []))\n // Clear it, so choosing the same file again still reports a change.\n nativeInput.value = ''\n }\n\n protected onDragEnter(event: DragEvent) {\n if (this.hasFiles(event)) {\n event.preventDefault()\n this.dragDepth++\n this.dragOver.set(true)\n }\n }\n\n protected onDragOver(event: DragEvent) {\n if (this.hasFiles(event) && event.dataTransfer) {\n event.preventDefault()\n event.dataTransfer.dropEffect = this.isDisabled() ? 'none' : 'copy'\n }\n }\n\n protected onDragLeave() {\n this.dragDepth = Math.max(0, this.dragDepth - 1)\n if (!this.dragDepth) {\n this.dragOver.set(false)\n }\n }\n\n protected onDrop(event: DragEvent) {\n if (!this.hasFiles(event)) {\n return\n }\n event.preventDefault()\n this.dragDepth = 0\n this.dragOver.set(false)\n this.addFiles(Array.from(event.dataTransfer?.files ?? []))\n }\n\n protected onPaste(event: ClipboardEvent) {\n const files = Array.from(event.clipboardData?.files ?? [])\n if (files.length) {\n event.preventDefault()\n this.addFiles(files)\n }\n }\n\n protected hasFiles(event: DragEvent): boolean {\n return !!event.dataTransfer?.types.includes('Files')\n }\n}\n","<input #nativeInput\n type=\"file\"\n class=\"native-input visually-hidden\"\n tabindex=\"0\"\n [id]=\"id()\"\n [accept]=\"accept()\"\n [multiple]=\"multiple()\"\n [disabled]=\"isDisabled()\"\n [attr.aria-invalid]=\"validation?.ariaInvalid()\"\n [attr.aria-describedby]=\"describedBy()\"\n [attr.aria-labelledby]=\"validation?.labelledBy()\"\n [attr.aria-required]=\"validation?.ariaRequired()\"\n (cancel)=\"onTouched()\"\n (change)=\"onSelected()\" />\n\n@if (files().length) {\n@if (preview(); as preview) {\n<ng-container *ngTemplateOutlet=\"preview.template; context: previewContext()\" />\n} @else {\n<ul class=\"file-list\"\n [id]=\"listId()\">\n @for (file of files(); track file) {\n <li class=\"file\">\n <span class=\"file-info\">\n <!-- A name aligns by its own direction, so a long one is cut at its end. -->\n <span class=\"file-name\"\n dir=\"auto\">{{ fileName(file) }}</span>\n @if (formatSize(file); as size) {\n <span class=\"file-size\">{{ size }}</span>\n }\n </span>\n <button type=\"button\"\n class=\"file-remove\"\n tabindex=\"0\"\n [disabled]=\"isDisabled()\"\n [attr.aria-label]=\"texts().remove(fileName(file))\"\n (click)=\"remove(file); nativeInput.focus()\">\n <nb-icon icon=\"close-outline\"\n pack=\"essentials\" />\n </button>\n </li>\n }\n</ul>\n}\n}\n\n@if (!files().length || multiple()) {\n<div class=\"prompt\"\n [id]=\"promptId()\">\n <nb-icon icon=\"cloud-upload-outline\"\n pack=\"essentials\" />\n {{ resolvedPrompt() }}\n</div>\n}\n\n<span class=\"visually-hidden\"\n aria-live=\"polite\">{{ announcement() }}</span>\n\n<div class=\"drop-overlay\"\n aria-hidden=\"true\">{{ texts().dropHere }}</div>\n","import { NgModule } from '@angular/core'\n\nimport { NbFileDropComponent, NbFileDropPreviewDirective } from './file-drop.component'\n\nconst COMPONENTS = [NbFileDropComponent, NbFileDropPreviewDirective]\n\n@NgModule({\n imports: [...COMPONENTS],\n exports: [...COMPONENTS]\n})\nexport class NbFileDropModule {}\n"],"mappings":";;;;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;GAAA,UAAA;GAAA,MAAA;GAAgB,MAAA,CAAA;GAAA,QAAA,GAAA,gBAAA;EAAA,CAAA;CAAA;CAAhB;EAAA,KAAA,OAAA,GAAA,oBAAA;GAAA,YAAA;GAAA,SAAA;GAAA,UAAA;GAAA,MAAA;GAAgB,SAAA,CANT,qBAAqB,0BAA0B;GAAA,SAAA,CAA/C,qBAAqB,0BAA0B;EAAA,CAAA;CAAA;CAMtD;EAAA,KAAA,OAAA,GAAA,oBAAA;GAAA,YAAA;GAAA,SAAA;GAAA,UAAA;GAAA,MAAA;GAAgB,SAAA,CANT,mBAAmB;EAAA,CAAA;CAAA;;AAM1B,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAgB,YAAA,CAAA;EAJ5B,MAAA;EAAS,MAAA,CAAA;GACN,SAAS,CAAC,GAAG,UAAU;GACvB,SAAS,CAAC,GAAG,UAAU;EAC1B,CAAA"}
|
|
@@ -190,6 +190,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
190
190
|
}
|
|
191
191
|
});
|
|
192
192
|
const round = (value) => Number(value.toPrecision(12));
|
|
193
|
+
const isBadInput = (element) => !!element.validity?.badInput;
|
|
193
194
|
const optionalNumber = (value) => value == null || value === "" ? void 0 : numberAttribute(value);
|
|
194
195
|
var NbNumberInputDirective = class NbNumberInputDirective {
|
|
195
196
|
constructor() {
|
|
@@ -227,8 +228,10 @@ var NbNumberInputDirective = class NbNumberInputDirective {
|
|
|
227
228
|
});
|
|
228
229
|
}
|
|
229
230
|
writeValue(value) {
|
|
230
|
-
|
|
231
|
-
|
|
231
|
+
untracked(() => {
|
|
232
|
+
this.value = typeof value === "number" && !isNaN(value) ? value : null;
|
|
233
|
+
this.render();
|
|
234
|
+
});
|
|
232
235
|
}
|
|
233
236
|
registerOnChange(fn) {
|
|
234
237
|
this.onChange = fn;
|
|
@@ -243,7 +246,7 @@ var NbNumberInputDirective = class NbNumberInputDirective {
|
|
|
243
246
|
this.elementRef.nativeElement.disabled = isDisabled;
|
|
244
247
|
}
|
|
245
248
|
validate(control) {
|
|
246
|
-
if (this.elementRef.nativeElement
|
|
249
|
+
if (isBadInput(this.elementRef.nativeElement)) return { nbNumberInputParse: ɵnbValidationError(this.message, "nbNumberInputParse", {}) };
|
|
247
250
|
if (typeof control.value !== "number") return null;
|
|
248
251
|
const actual = round(control.value * this.scale());
|
|
249
252
|
const min = this.min();
|
|
@@ -260,7 +263,7 @@ var NbNumberInputDirective = class NbNumberInputDirective {
|
|
|
260
263
|
}
|
|
261
264
|
onInput() {
|
|
262
265
|
const element = this.elementRef.nativeElement;
|
|
263
|
-
if (element
|
|
266
|
+
if (isBadInput(element)) {
|
|
264
267
|
this.onValidatorChange();
|
|
265
268
|
return;
|
|
266
269
|
}
|
|
@@ -272,7 +275,7 @@ var NbNumberInputDirective = class NbNumberInputDirective {
|
|
|
272
275
|
render() {
|
|
273
276
|
const element = this.elementRef.nativeElement;
|
|
274
277
|
const shown = this.value === null ? null : round(this.value * this.scale());
|
|
275
|
-
if ((element
|
|
278
|
+
if ((isBadInput(element) ? NaN : element.value === "" ? null : element.valueAsNumber) !== shown) element.value = shown === null ? "" : String(shown);
|
|
276
279
|
}
|
|
277
280
|
static {
|
|
278
281
|
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"liquid-js-lyr-core-input.mjs","names":["convertToBoolProperty","enableTransitionsAfterRender","nbValidationError"],"sources":["../../../packages/core/src/components/input/input.directive.ts","../../../packages/core/src/components/input/number-input.directive.ts","../../../packages/core/src/components/input/input.module.ts"],"sourcesContent":["import {\n computed,\n DestroyRef,\n Directive,\n DoCheck,\n ElementRef,\n inject,\n input,\n linkedSignal,\n signal,\n untracked\n} from '@angular/core'\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop'\nimport { map } from 'rxjs/operators'\n\nimport { injectNbDefaults, NbStatusService, ɵconvertToBoolProperty as convertToBoolProperty, NbBooleanInput, NbComponentSize, NbComponentShape, NbComponentOrCustomStatus, ɵenableTransitionsAfterRender as enableTransitionsAfterRender } from '@liquid-js/lyr-core/base'\nimport { NbFormFieldControl } from '@liquid-js/lyr-core/form-field'\nimport { NbValidationDirective } from '@liquid-js/lyr-core/validation'\nimport { NbFocusMonitor } from '@liquid-js/lyr-core/cdk'\n\n/**\n * Styles an `<input>` or `<textarea>` as a field of the design system.\n *\n * ```html\n * <input nbInput />\n * ```\n *\n * ### Installation\n *\n * Import `NbInputDirective` into your standalone component:\n * ```ts\n * @Component({\n * imports: [NbInputDirective],\n * })\n * export class PageComponent { }\n * ```\n *\n * With NgModules:\n *\n * Import `NbInputModule` to your feature module.\n * ```ts\n * @NgModule({\n * imports: [\n * // ...\n * NbInputModule,\n * ],\n * })\n * export class PageModule { }\n * ```\n * ### Usage\n *\n * @stacked-example(Showcase, input/input-showcase.component)\n *\n * `status` colours the field:\n * @stacked-example(Input Colors, input/input-colors.component)\n *\n * Inputs come in five sizes, `tiny`, `small`, `medium` (default), `large` and `giant`, set with `fieldSize`: on an\n * `<input>`, `size` is already the HTML attribute for its width in characters. Components that aren't a native field,\n * such as `nb-select`, the phone input and the colour picker, take `size`.\n * @stacked-example(Input Sizes, input/input-sizes.component)\n *\n * `shape` rounds the corners:\n * @stacked-example(Input Shapes, input/input-shapes.component)\n *\n * It applies to `input` and `textarea` elements:\n * @stacked-example(Input Elements, input/input-types.component)\n *\n * `fullWidth` makes the field fill its container:\n * @stacked-example(Full width inputs, input/input-full-width.component)\n *\n * A `ghost` input shows no background or border until it's hovered or focused, for fields edited in place:\n * @stacked-example(Ghost inputs, input/input-ghost.component)\n *\n * It works with reactive forms and `ngModel` as any input does:\n * @stacked-example(Input form binding, input/input-form.component)\n *\n * Add `nbValidation` to show the control's validation errors and status, see [Validation](components/forms/validation).\n *\n * `<nb-form-field>` adds content before (`nbPrefix`) or after (`nbSuffix`) the field, such as an icon or a button.\n * @stacked-example(Prefix and suffix, form-field/form-field-showcase.component)\n * @stacked-example(Input with icon, form-field/form-field-input.component)\n * @stacked-example(Input with button, form-field/form-field-password.component)\n *\n * Addons grow to fit text, e.g. a unit or a URL scheme, and the input's padding follows their width:\n * @stacked-example(Input with text, form-field/form-field-text.component)\n * @styles\n *\n * input-ghost-background-color:\n * input-ghost-border-color:\n * input-tiny-width:\n * input-small-width:\n * input-medium-width:\n * input-large-width:\n * input-giant-width:\n * input-border-style:\n * input-border-width:\n * input-placeholder-text-font-family:\n * input-text-font-family:\n * input-basic-text-color:\n * input-basic-placeholder-text-color:\n * input-basic-background-color:\n * input-basic-border-color:\n * input-basic-focus-background-color:\n * input-basic-focus-and-hover-background-color:\n * input-basic-focus-and-hover-border-color:\n * input-basic-focus-border-color:\n * input-basic-hover-background-color:\n * input-basic-hover-border-color:\n * input-basic-disabled-background-color:\n * input-basic-disabled-border-color:\n * input-basic-disabled-text-color:\n * input-basic-disabled-placeholder-text-color:\n * input-primary-text-color:\n * input-primary-placeholder-text-color:\n * input-primary-background-color:\n * input-primary-border-color:\n * input-primary-focus-background-color:\n * input-primary-focus-and-hover-background-color:\n * input-primary-focus-and-hover-border-color:\n * input-primary-focus-border-color:\n * input-primary-hover-background-color:\n * input-primary-hover-border-color:\n * input-primary-disabled-background-color:\n * input-primary-disabled-border-color:\n * input-primary-disabled-text-color:\n * input-primary-disabled-placeholder-text-color:\n * input-success-text-color:\n * input-success-placeholder-text-color:\n * input-success-background-color:\n * input-success-border-color:\n * input-success-focus-background-color:\n * input-success-focus-and-hover-background-color:\n * input-success-focus-and-hover-border-color:\n * input-success-focus-border-color:\n * input-success-hover-background-color:\n * input-success-hover-border-color:\n * input-success-disabled-background-color:\n * input-success-disabled-border-color:\n * input-success-disabled-text-color:\n * input-success-disabled-placeholder-text-color:\n * input-info-text-color:\n * input-info-placeholder-text-color:\n * input-info-background-color:\n * input-info-border-color:\n * input-info-focus-background-color:\n * input-info-focus-and-hover-background-color:\n * input-info-focus-and-hover-border-color:\n * input-info-focus-border-color:\n * input-info-hover-background-color:\n * input-info-hover-border-color:\n * input-info-disabled-background-color:\n * input-info-disabled-border-color:\n * input-info-disabled-text-color:\n * input-info-disabled-placeholder-text-color:\n * input-warning-text-color:\n * input-warning-placeholder-text-color:\n * input-warning-background-color:\n * input-warning-border-color:\n * input-warning-focus-background-color:\n * input-warning-focus-and-hover-background-color:\n * input-warning-focus-and-hover-border-color:\n * input-warning-focus-border-color:\n * input-warning-hover-background-color:\n * input-warning-hover-border-color:\n * input-warning-disabled-background-color:\n * input-warning-disabled-border-color:\n * input-warning-disabled-text-color:\n * input-warning-disabled-placeholder-text-color:\n * input-danger-text-color:\n * input-danger-placeholder-text-color:\n * input-danger-background-color:\n * input-danger-border-color:\n * input-danger-focus-background-color:\n * input-danger-focus-and-hover-background-color:\n * input-danger-focus-and-hover-border-color:\n * input-danger-focus-border-color:\n * input-danger-hover-background-color:\n * input-danger-hover-border-color:\n * input-danger-disabled-background-color:\n * input-danger-disabled-border-color:\n * input-danger-disabled-text-color:\n * input-danger-disabled-placeholder-text-color:\n * input-control-text-color:\n * input-control-placeholder-text-color:\n * input-control-background-color:\n * input-control-border-color:\n * input-control-focus-background-color:\n * input-control-focus-and-hover-background-color:\n * input-control-focus-and-hover-border-color:\n * input-control-focus-border-color:\n * input-control-hover-background-color:\n * input-control-hover-border-color:\n * input-control-disabled-background-color:\n * input-control-disabled-border-color:\n * input-control-disabled-text-color:\n * input-control-disabled-placeholder-text-color:\n * input-rectangle-border-radius:\n * input-semi-round-border-radius:\n * input-round-border-radius:\n * input-textarea-max-border-radius:\n * input-tiny-text-font-size:\n * input-tiny-text-font-weight:\n * input-tiny-text-line-height:\n * input-tiny-placeholder-text-font-size:\n * input-tiny-placeholder-text-font-weight:\n * input-tiny-placeholder-text-line-height:\n * input-tiny-padding:\n * input-tiny-max-width:\n * input-small-text-font-size:\n * input-small-text-font-weight:\n * input-small-text-line-height:\n * input-small-placeholder-text-font-size:\n * input-small-placeholder-text-font-weight:\n * input-small-placeholder-text-line-height:\n * input-small-padding:\n * input-small-max-width:\n * input-medium-text-font-size:\n * input-medium-text-font-weight:\n * input-medium-text-line-height:\n * input-medium-placeholder-text-font-size:\n * input-medium-placeholder-text-font-weight:\n * input-medium-placeholder-text-line-height:\n * input-medium-padding:\n * input-medium-max-width:\n * input-large-text-font-size:\n * input-large-text-font-weight:\n * input-large-text-line-height:\n * input-large-placeholder-text-font-size:\n * input-large-placeholder-text-font-weight:\n * input-large-placeholder-text-line-height:\n * input-large-padding:\n * input-large-max-width:\n * input-giant-text-font-size:\n * input-giant-text-font-weight:\n * input-giant-text-line-height:\n * input-giant-placeholder-text-font-size:\n * input-giant-placeholder-text-font-weight:\n * input-giant-placeholder-text-line-height:\n * input-giant-padding:\n * input-giant-max-width:\n */\n@Directive({\n selector: 'input[nbInput],textarea[nbInput]',\n providers: [\n { provide: NbFormFieldControl, useExisting: NbInputDirective }\n ],\n host: {\n '[class]': 'hostClasses()',\n '[class.input-full-width]': 'fullWidth()',\n '[class.input-ghost]': 'ghost()'\n }\n})\nexport class NbInputDirective implements DoCheck, NbFormFieldControl {\n // The app's defaults for this type, which the inputs below start from.\n protected readonly nbDefaults = injectNbDefaults('input')\n\n protected readonly elementRef = inject<ElementRef<HTMLInputElement | HTMLTextAreaElement>>(ElementRef)\n protected readonly focusMonitor = inject(NbFocusMonitor)\n protected readonly statusService = inject(NbStatusService)\n protected readonly validation = inject(NbValidationDirective, { self: true, optional: true })\n\n /**\n * Field size: `tiny`, `small`, `medium` (default), `large` or `giant`. Not `size`, which on an `<input>` is the\n * HTML attribute for its width in characters.\n */\n readonly fieldSizeInput = input<NbComponentSize | undefined>(undefined, { alias: 'fieldSize' })\n /** The fieldSize in use: the input's, the app's default, or 'medium'. */\n readonly fieldSize = linkedSignal<NbComponentSize>(() => this.fieldSizeInput() ?? this.nbDefaults().size ?? 'medium')\n\n /**\n * Colours the field: `basic` (default), `primary`, `info`, `success`, `warning`, `danger` or `control`. With\n * `nbValidation`, the validation status takes over while the control shows errors or success.\n */\n readonly status = input<NbComponentOrCustomStatus>('basic')\n\n // With `nbValidation`, the status it gives while the control shows errors or success.\n protected readonly resolvedStatus = computed(() => this.validation?.status() ?? this.status())\n\n /** `rectangle` (default), `semi-round` or `round`. */\n readonly shapeInput = input<NbComponentShape | undefined>(undefined, { alias: 'shape' })\n /** The shape in use: the input's, the app's default, or 'rectangle'. */\n readonly shape = linkedSignal<NbComponentShape>(() => this.shapeInput() ?? this.nbDefaults().shape ?? 'rectangle')\n\n /** Fills the container's width. */\n readonly fullWidth = input<boolean, NbBooleanInput>(false, { transform: convertToBoolProperty })\n\n /**\n * Shows no background or border at rest; under the pointer and with focus the input looks as usual.\n * Fits fields edited in place, e.g. a title.\n */\n readonly ghost = input<boolean, NbBooleanInput>(false, { transform: convertToBoolProperty })\n\n /** Whether the field has focus, for the form field around it. */\n readonly focused = signal(false)\n\n // The element's disabled property, which forms and bindings set directly, read on every check.\n protected readonly disabled = signal(false)\n\n readonly controlState = computed(() => ({\n status: this.resolvedStatus(),\n size: this.fieldSize(),\n fullWidth: this.fullWidth(),\n focused: this.focused(),\n disabled: this.disabled()\n }))\n\n protected readonly hostClasses = computed(() => [\n `size-${this.fieldSize()}`,\n this.statusService.getStatusClass(this.resolvedStatus()),\n `shape-${this.shape()}`\n ])\n\n constructor() {\n enableTransitionsAfterRender(this.elementRef.nativeElement)\n\n this.focusMonitor\n .monitor(this.elementRef)\n .pipe(map((origin) => !!origin), takeUntilDestroyed())\n // Focus can change while a view renders, e.g. when hiding a focused element makes the browser blur it.\n .subscribe((focused) => untracked(() => this.focused.set(focused)))\n inject(DestroyRef).onDestroy(() => this.focusMonitor.stopMonitoring(this.elementRef))\n }\n\n ngDoCheck() {\n this.disabled.set(this.elementRef.nativeElement.disabled)\n }\n\n}\n","import { Directive, effect, ElementRef, forwardRef, inject, input, numberAttribute, untracked } from '@angular/core'\nimport { AbstractControl, ControlValueAccessor, NG_VALIDATORS, NG_VALUE_ACCESSOR, ValidationErrors, Validator } from '@angular/forms'\n\nimport { injectNbValidationMessage, ɵnbValidationError as nbValidationError } from '@liquid-js/lyr-core/validation'\n\n// Clears floating point noise, e.g. 0.07 * 100 = 7.000000000000001.\nconst round = (value: number) => Number(value.toPrecision(12))\n\nconst optionalNumber = (value: unknown) => (value == null || value === '' ? undefined : numberAttribute(value))\n\n/**\n * A number input whose value is scaled for display, e.g. a fraction shown as a percent, or radians shown in degrees.\n * Use it on an `nbInput`, and show the unit in a form field suffix:\n *\n * ```html\n * <nb-form-field>\n * <input nbInput nbNumberInput [scale]=\"100\" min=\"0\" max=\"100\" [(ngModel)]=\"opacity\" />\n * <span nbSuffix>%</span>\n * </nb-form-field>\n * ```\n *\n * With `scale` at 100 the input shows 50 for a value of 0.5. `min`, `max` and `step` are in the units it shows,\n * as on any number input, and so are the `min` and `max` errors it gives forms. While the text isn't a number, e.g.\n * `1e`, the value stays the last one and the field has the `nbNumberInputParse` error. Its errors are\n * `{ kind, message, …data }`, with the messages of `nb-validation-errors`, in reactive, template-driven and signal\n * forms alike.\n *\n * @stacked-example(Number input, input/input-number.component)\n *\n * It sets the input's type; leave the `type` attribute out, as Angular's own `min` and `max` validators apply to\n * inputs with it, and they compare the value without its scale.\n */\n@Directive({\n selector: 'input[nbNumberInput]',\n providers: [\n { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => NbNumberInputDirective), multi: true },\n { provide: NG_VALIDATORS, useExisting: forwardRef(() => NbNumberInputDirective), multi: true }\n ],\n host: {\n 'type': 'number',\n '[attr.min]': 'min() ?? null',\n '[attr.max]': 'max() ?? null',\n '[attr.step]': 'step() ?? null',\n '(input)': 'onInput()',\n '(blur)': 'onTouched()'\n }\n})\nexport class NbNumberInputDirective implements ControlValueAccessor, Validator {\n protected readonly elementRef = inject<ElementRef<HTMLInputElement>>(ElementRef)\n protected readonly message = injectNbValidationMessage()\n\n /**\n * How many of the units it shows make up one of the value's, e.g. 100 for a fraction shown as a percent.\n */\n readonly scale = input<number, unknown>(1, { transform: (value) => numberAttribute(value, 1) || 1 })\n\n /**\n * The least number it accepts, in the units it shows.\n */\n readonly min = input<number | undefined, unknown>(undefined, { transform: optionalNumber })\n\n /**\n * The greatest number it accepts, in the units it shows.\n */\n readonly max = input<number | undefined, unknown>(undefined, { transform: optionalNumber })\n\n /**\n * How far the arrow keys and the spin buttons move it, in the units it shows; `any` for no steps.\n * 1 by default, as on any number input.\n */\n readonly step = input<number | 'any' | undefined, unknown>(undefined, {\n transform: (value) => (value === 'any' ? value : optionalNumber(value))\n })\n\n // The value the form has: null for an empty field, as forms hold it.\n protected value: number | null = null\n protected onChange: (value: number | null) => void = () => {}\n protected onTouched: () => void = () => {}\n protected onValidatorChange: () => void = () => {}\n\n constructor() {\n // Shows the value at a new scale.\n effect(() => {\n this.scale()\n untracked(() => this.render())\n })\n effect(() => {\n this.min()\n this.max()\n this.scale()\n untracked(() => this.onValidatorChange())\n })\n }\n\n writeValue(value: unknown) {\n this.value = typeof value === 'number' && !isNaN(value) ? value : null\n this.render()\n }\n\n registerOnChange(fn: (value: number | null) => void) {\n this.onChange = fn\n }\n\n registerOnTouched(fn: () => void) {\n this.onTouched = fn\n }\n\n registerOnValidatorChange(fn: () => void) {\n this.onValidatorChange = fn\n }\n\n setDisabledState(isDisabled: boolean) {\n this.elementRef.nativeElement.disabled = isDisabled\n }\n\n validate(control: AbstractControl): ValidationErrors | null {\n // The browser leaves the value empty for text that isn't a number, e.g. `1e`.\n if (this.elementRef.nativeElement.validity.badInput) {\n return { nbNumberInputParse: nbValidationError(this.message, 'nbNumberInputParse', {}) }\n }\n if (typeof control.value !== 'number') {\n return null\n }\n const actual = round(control.value * this.scale())\n const min = this.min()\n const max = this.max()\n if (min !== undefined && actual < min) {\n return { min: nbValidationError(this.message, 'min', { min, actual }) }\n }\n if (max !== undefined && actual > max) {\n return { max: nbValidationError(this.message, 'max', { max, actual }) }\n }\n return null\n }\n\n protected onInput() {\n const element = this.elementRef.nativeElement\n // While the text isn't a number, the value stays and the field has the parse error.\n if (element.validity.badInput) {\n this.onValidatorChange()\n return\n }\n const shown = element.valueAsNumber\n this.value = isNaN(shown) ? null : round(shown / this.scale())\n this.onChange(this.value)\n // The parse check reads the text, which signal forms don't see change, e.g. from `50e` back to `50`.\n this.onValidatorChange()\n }\n\n protected render() {\n const element = this.elementRef.nativeElement\n const shown = this.value === null ? null : round(this.value * this.scale())\n // Leaves text that already shows the value, e.g. `0.50` while it's typed, and clears text that isn't a number.\n const current = element.validity.badInput ? NaN : element.value === '' ? null : element.valueAsNumber\n if (current !== shown) {\n element.value = shown === null ? '' : String(shown)\n }\n }\n}\n","import { NgModule } from '@angular/core'\nimport { NbInputDirective } from './input.directive'\nimport { NbNumberInputDirective } from './number-input.directive'\n\nconst NB_INPUT_COMPONENTS = [\n NbInputDirective,\n NbNumberInputDirective\n]\n\n@NgModule({\n imports: [...NB_INPUT_COMPONENTS],\n exports: NB_INPUT_COMPONENTS\n})\nexport class NbInputModule {}\n"],"mappings":";;;;;;;;;AA4PA,IAAa,mBAAb,MAAa,iBAAgB;CA4DzB,cAAA;EA1DmB,KAAA,aAAa,iBAAiB,OAAO;EAErC,KAAA,aAAa,OAA2D,UAAU;EAClF,KAAA,eAAe,OAAO,cAAc;EACpC,KAAA,gBAAgB,OAAO,eAAe;EACtC,KAAA,aAAa,OAAO,uBAAuB;GAAE,MAAM;GAAM,UAAU;EAAI,CAAE;EAMnF,KAAA,iBAAiB,MAAmC,QAAS;GAAA,GAAA,YAAA,EAAA,WAAA,iBAAA,+BAAA,CAAA;GAAI,OAAO;EAAW,CAAA;EAEnF,KAAA,YAAY,mBAAoC,KAAK,eAAc,KAAM,KAAK,WAAU,CAAE,CAAC,QAAQ,UAAS,GAAA,YAAA,CAAA,EAAA,WAAA,YAAA,CAAA,+BAAA,CAAA,CAAA;EAM5G,KAAA,SAAS,MAAiC,SAAQ,GAAA,YAAA,CAAA,EAAA,WAAA,SAAA,CAAA,+BAAA,CAAA,CAAA;EAGxC,KAAA,i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mB,aAAa,iBAAgB,sBAAuB;IAAG,OAAO;GAAI,GAChG;IAAE,SAAS;IAAe,aAAa,iBAAgB,sBAAuB;IAAG,OAAO;GAAI,CAC/F;GACD,MAAM;IACF,QAAQ;IACR,cAAc;IACd,cAAc;IACd,eAAe;IACf,WAAW;IACX,UAAU;GACb;EACJ,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC1CD,MAAM,sBAAsB,CACxB,kBACA,sBACH;AAMD,IAAa,gBAAb,MAAa,cAAa;CAAb;EAAA,KAAA,OAAA,GAAA,mBAAA;GAAA,YAAA;GAAA,SAAA;GAAA,UAAA;GAAA,MAAA;GAAa,MAAA,CAAA;GAAA,QAAA,GAAA,gBAAA;EAAA,CAAA;CAAA;CAAb;EAAA,KAAA,OAAA,GAAA,oBAAA;GAAA,YAAA;GAAA,SAAA;GAAA,UAAA;GAAA,MAAA;GAAa,SAAA,CARtB,kBACA,sBAAsB;GAAA,SAAA,CADtB,kBACA,sBAAsB;EAAA,CAAA;CAAA;CAOb;EAAA,KAAA,OAAA,GAAA,oBAAA;GAAA,YAAA;GAAA,SAAA;GAAA,UAAA;GAAA,MAAA;EAAa,CAAA;CAAA;;AAAb,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAa,YAAA,CAAA;EAJzB,MAAA;EAAS,MAAA,CAAA;GACN,SAAS,CAAC,GAAG,mBAAmB;GAChC,SAAS;EACZ,CAAA"}
|
|
1
|
+
{"version":3,"file":"liquid-js-lyr-core-input.mjs","names":["convertToBoolProperty","enableTransitionsAfterRender","nbValidationError"],"sources":["../../../packages/core/src/components/input/input.directive.ts","../../../packages/core/src/components/input/number-input.directive.ts","../../../packages/core/src/components/input/input.module.ts"],"sourcesContent":["import {\n computed,\n DestroyRef,\n Directive,\n DoCheck,\n ElementRef,\n inject,\n input,\n linkedSignal,\n signal,\n untracked\n} from '@angular/core'\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop'\nimport { map } from 'rxjs/operators'\n\nimport { injectNbDefaults, NbStatusService, ɵconvertToBoolProperty as convertToBoolProperty, NbBooleanInput, NbComponentSize, NbComponentShape, NbComponentOrCustomStatus, ɵenableTransitionsAfterRender as enableTransitionsAfterRender } from '@liquid-js/lyr-core/base'\nimport { NbFormFieldControl } from '@liquid-js/lyr-core/form-field'\nimport { NbValidationDirective } from '@liquid-js/lyr-core/validation'\nimport { NbFocusMonitor } from '@liquid-js/lyr-core/cdk'\n\n/**\n * Styles an `<input>` or `<textarea>` as a field of the design system.\n *\n * ```html\n * <input nbInput />\n * ```\n *\n * ### Installation\n *\n * Import `NbInputDirective` into your standalone component:\n * ```ts\n * @Component({\n * imports: [NbInputDirective],\n * })\n * export class PageComponent { }\n * ```\n *\n * With NgModules:\n *\n * Import `NbInputModule` to your feature module.\n * ```ts\n * @NgModule({\n * imports: [\n * // ...\n * NbInputModule,\n * ],\n * })\n * export class PageModule { }\n * ```\n * ### Usage\n *\n * @stacked-example(Showcase, input/input-showcase.component)\n *\n * `status` colours the field:\n * @stacked-example(Input Colors, input/input-colors.component)\n *\n * Inputs come in five sizes, `tiny`, `small`, `medium` (default), `large` and `giant`, set with `fieldSize`: on an\n * `<input>`, `size` is already the HTML attribute for its width in characters. Components that aren't a native field,\n * such as `nb-select`, the phone input and the colour picker, take `size`.\n * @stacked-example(Input Sizes, input/input-sizes.component)\n *\n * `shape` rounds the corners:\n * @stacked-example(Input Shapes, input/input-shapes.component)\n *\n * It applies to `input` and `textarea` elements:\n * @stacked-example(Input Elements, input/input-types.component)\n *\n * `fullWidth` makes the field fill its container:\n * @stacked-example(Full width inputs, input/input-full-width.component)\n *\n * A `ghost` input shows no background or border until it's hovered or focused, for fields edited in place:\n * @stacked-example(Ghost inputs, input/input-ghost.component)\n *\n * It works with reactive forms and `ngModel` as any input does:\n * @stacked-example(Input form binding, input/input-form.component)\n *\n * Add `nbValidation` to show the control's validation errors and status, see [Validation](components/forms/validation).\n *\n * `<nb-form-field>` adds content before (`nbPrefix`) or after (`nbSuffix`) the field, such as an icon or a button.\n * @stacked-example(Prefix and suffix, form-field/form-field-showcase.component)\n * @stacked-example(Input with icon, form-field/form-field-input.component)\n * @stacked-example(Input with button, form-field/form-field-password.component)\n *\n * Addons grow to fit text, e.g. a unit or a URL scheme, and the input's padding follows their width:\n * @stacked-example(Input with text, form-field/form-field-text.component)\n * @styles\n *\n * input-ghost-background-color:\n * input-ghost-border-color:\n * input-tiny-width:\n * input-small-width:\n * input-medium-width:\n * input-large-width:\n * input-giant-width:\n * input-border-style:\n * input-border-width:\n * input-placeholder-text-font-family:\n * input-text-font-family:\n * input-basic-text-color:\n * input-basic-placeholder-text-color:\n * input-basic-background-color:\n * input-basic-border-color:\n * input-basic-focus-background-color:\n * input-basic-focus-and-hover-background-color:\n * input-basic-focus-and-hover-border-color:\n * input-basic-focus-border-color:\n * input-basic-hover-background-color:\n * input-basic-hover-border-color:\n * input-basic-disabled-background-color:\n * input-basic-disabled-border-color:\n * input-basic-disabled-text-color:\n * input-basic-disabled-placeholder-text-color:\n * input-primary-text-color:\n * input-primary-placeholder-text-color:\n * input-primary-background-color:\n * input-primary-border-color:\n * input-primary-focus-background-color:\n * input-primary-focus-and-hover-background-color:\n * input-primary-focus-and-hover-border-color:\n * input-primary-focus-border-color:\n * input-primary-hover-background-color:\n * input-primary-hover-border-color:\n * input-primary-disabled-background-color:\n * input-primary-disabled-border-color:\n * input-primary-disabled-text-color:\n * input-primary-disabled-placeholder-text-color:\n * input-success-text-color:\n * input-success-placeholder-text-color:\n * input-success-background-color:\n * input-success-border-color:\n * input-success-focus-background-color:\n * input-success-focus-and-hover-background-color:\n * input-success-focus-and-hover-border-color:\n * input-success-focus-border-color:\n * input-success-hover-background-color:\n * input-success-hover-border-color:\n * input-success-disabled-background-color:\n * input-success-disabled-border-color:\n * input-success-disabled-text-color:\n * input-success-disabled-placeholder-text-color:\n * input-info-text-color:\n * input-info-placeholder-text-color:\n * input-info-background-color:\n * input-info-border-color:\n * input-info-focus-background-color:\n * input-info-focus-and-hover-background-color:\n * input-info-focus-and-hover-border-color:\n * input-info-focus-border-color:\n * input-info-hover-background-color:\n * input-info-hover-border-color:\n * input-info-disabled-background-color:\n * input-info-disabled-border-color:\n * input-info-disabled-text-color:\n * input-info-disabled-placeholder-text-color:\n * input-warning-text-color:\n * input-warning-placeholder-text-color:\n * input-warning-background-color:\n * input-warning-border-color:\n * input-warning-focus-background-color:\n * input-warning-focus-and-hover-background-color:\n * input-warning-focus-and-hover-border-color:\n * input-warning-focus-border-color:\n * input-warning-hover-background-color:\n * input-warning-hover-border-color:\n * input-warning-disabled-background-color:\n * input-warning-disabled-border-color:\n * input-warning-disabled-text-color:\n * input-warning-disabled-placeholder-text-color:\n * input-danger-text-color:\n * input-danger-placeholder-text-color:\n * input-danger-background-color:\n * input-danger-border-color:\n * input-danger-focus-background-color:\n * input-danger-focus-and-hover-background-color:\n * input-danger-focus-and-hover-border-color:\n * input-danger-focus-border-color:\n * input-danger-hover-background-color:\n * input-danger-hover-border-color:\n * input-danger-disabled-background-color:\n * input-danger-disabled-border-color:\n * input-danger-disabled-text-color:\n * input-danger-disabled-placeholder-text-color:\n * input-control-text-color:\n * input-control-placeholder-text-color:\n * input-control-background-color:\n * input-control-border-color:\n * input-control-focus-background-color:\n * input-control-focus-and-hover-background-color:\n * input-control-focus-and-hover-border-color:\n * input-control-focus-border-color:\n * input-control-hover-background-color:\n * input-control-hover-border-color:\n * input-control-disabled-background-color:\n * input-control-disabled-border-color:\n * input-control-disabled-text-color:\n * input-control-disabled-placeholder-text-color:\n * input-rectangle-border-radius:\n * input-semi-round-border-radius:\n * input-round-border-radius:\n * input-textarea-max-border-radius:\n * input-tiny-text-font-size:\n * input-tiny-text-font-weight:\n * input-tiny-text-line-height:\n * input-tiny-placeholder-text-font-size:\n * input-tiny-placeholder-text-font-weight:\n * input-tiny-placeholder-text-line-height:\n * input-tiny-padding:\n * input-tiny-max-width:\n * input-small-text-font-size:\n * input-small-text-font-weight:\n * input-small-text-line-height:\n * input-small-placeholder-text-font-size:\n * input-small-placeholder-text-font-weight:\n * input-small-placeholder-text-line-height:\n * input-small-padding:\n * input-small-max-width:\n * input-medium-text-font-size:\n * input-medium-text-font-weight:\n * input-medium-text-line-height:\n * input-medium-placeholder-text-font-size:\n * input-medium-placeholder-text-font-weight:\n * input-medium-placeholder-text-line-height:\n * input-medium-padding:\n * input-medium-max-width:\n * input-large-text-font-size:\n * input-large-text-font-weight:\n * input-large-text-line-height:\n * input-large-placeholder-text-font-size:\n * input-large-placeholder-text-font-weight:\n * input-large-placeholder-text-line-height:\n * input-large-padding:\n * input-large-max-width:\n * input-giant-text-font-size:\n * input-giant-text-font-weight:\n * input-giant-text-line-height:\n * input-giant-placeholder-text-font-size:\n * input-giant-placeholder-text-font-weight:\n * input-giant-placeholder-text-line-height:\n * input-giant-padding:\n * input-giant-max-width:\n */\n@Directive({\n selector: 'input[nbInput],textarea[nbInput]',\n providers: [\n { provide: NbFormFieldControl, useExisting: NbInputDirective }\n ],\n host: {\n '[class]': 'hostClasses()',\n '[class.input-full-width]': 'fullWidth()',\n '[class.input-ghost]': 'ghost()'\n }\n})\nexport class NbInputDirective implements DoCheck, NbFormFieldControl {\n // The app's defaults for this type, which the inputs below start from.\n protected readonly nbDefaults = injectNbDefaults('input')\n\n protected readonly elementRef = inject<ElementRef<HTMLInputElement | HTMLTextAreaElement>>(ElementRef)\n protected readonly focusMonitor = inject(NbFocusMonitor)\n protected readonly statusService = inject(NbStatusService)\n protected readonly validation = inject(NbValidationDirective, { self: true, optional: true })\n\n /**\n * Field size: `tiny`, `small`, `medium` (default), `large` or `giant`. Not `size`, which on an `<input>` is the\n * HTML attribute for its width in characters.\n */\n readonly fieldSizeInput = input<NbComponentSize | undefined>(undefined, { alias: 'fieldSize' })\n /** The fieldSize in use: the input's, the app's default, or 'medium'. */\n readonly fieldSize = linkedSignal<NbComponentSize>(() => this.fieldSizeInput() ?? this.nbDefaults().size ?? 'medium')\n\n /**\n * Colours the field: `basic` (default), `primary`, `info`, `success`, `warning`, `danger` or `control`. With\n * `nbValidation`, the validation status takes over while the control shows errors or success.\n */\n readonly status = input<NbComponentOrCustomStatus>('basic')\n\n // With `nbValidation`, the status it gives while the control shows errors or success.\n protected readonly resolvedStatus = computed(() => this.validation?.status() ?? this.status())\n\n /** `rectangle` (default), `semi-round` or `round`. */\n readonly shapeInput = input<NbComponentShape | undefined>(undefined, { alias: 'shape' })\n /** The shape in use: the input's, the app's default, or 'rectangle'. */\n readonly shape = linkedSignal<NbComponentShape>(() => this.shapeInput() ?? this.nbDefaults().shape ?? 'rectangle')\n\n /** Fills the container's width. */\n readonly fullWidth = input<boolean, NbBooleanInput>(false, { transform: convertToBoolProperty })\n\n /**\n * Shows no background or border at rest; under the pointer and with focus the input looks as usual.\n * Fits fields edited in place, e.g. a title.\n */\n readonly ghost = input<boolean, NbBooleanInput>(false, { transform: convertToBoolProperty })\n\n /** Whether the field has focus, for the form field around it. */\n readonly focused = signal(false)\n\n // The element's disabled property, which forms and bindings set directly, read on every check.\n protected readonly disabled = signal(false)\n\n readonly controlState = computed(() => ({\n status: this.resolvedStatus(),\n size: this.fieldSize(),\n fullWidth: this.fullWidth(),\n focused: this.focused(),\n disabled: this.disabled()\n }))\n\n protected readonly hostClasses = computed(() => [\n `size-${this.fieldSize()}`,\n this.statusService.getStatusClass(this.resolvedStatus()),\n `shape-${this.shape()}`\n ])\n\n constructor() {\n enableTransitionsAfterRender(this.elementRef.nativeElement)\n\n this.focusMonitor\n .monitor(this.elementRef)\n .pipe(map((origin) => !!origin), takeUntilDestroyed())\n // Focus can change while a view renders, e.g. when hiding a focused element makes the browser blur it.\n .subscribe((focused) => untracked(() => this.focused.set(focused)))\n inject(DestroyRef).onDestroy(() => this.focusMonitor.stopMonitoring(this.elementRef))\n }\n\n ngDoCheck() {\n this.disabled.set(this.elementRef.nativeElement.disabled)\n }\n\n}\n","import { Directive, effect, ElementRef, forwardRef, inject, input, numberAttribute, untracked } from '@angular/core'\nimport { AbstractControl, ControlValueAccessor, NG_VALIDATORS, NG_VALUE_ACCESSOR, ValidationErrors, Validator } from '@angular/forms'\n\nimport { injectNbValidationMessage, ɵnbValidationError as nbValidationError } from '@liquid-js/lyr-core/validation'\n\n// Clears floating point noise, e.g. 0.07 * 100 = 7.000000000000001.\nconst round = (value: number) => Number(value.toPrecision(12))\n\n// Text the browser couldn't read as a number, e.g. `1e`. The server's DOM has no validity, and nothing is typed there.\nconst isBadInput = (element: HTMLInputElement) => !!(element.validity as ValidityState | undefined)?.badInput\nconst optionalNumber = (value: unknown) => (value == null || value === '' ? undefined : numberAttribute(value))\n\n/**\n * A number input whose value is scaled for display, e.g. a fraction shown as a percent, or radians shown in degrees.\n * Use it on an `nbInput`, and show the unit in a form field suffix:\n *\n * ```html\n * <nb-form-field>\n * <input nbInput nbNumberInput [scale]=\"100\" min=\"0\" max=\"100\" [(ngModel)]=\"opacity\" />\n * <span nbSuffix>%</span>\n * </nb-form-field>\n * ```\n *\n * With `scale` at 100 the input shows 50 for a value of 0.5. `min`, `max` and `step` are in the units it shows,\n * as on any number input, and so are the `min` and `max` errors it gives forms. While the text isn't a number, e.g.\n * `1e`, the value stays the last one and the field has the `nbNumberInputParse` error. Its errors are\n * `{ kind, message, …data }`, with the messages of `nb-validation-errors`, in reactive, template-driven and signal\n * forms alike.\n *\n * @stacked-example(Number input, input/input-number.component)\n *\n * It sets the input's type; leave the `type` attribute out, as Angular's own `min` and `max` validators apply to\n * inputs with it, and they compare the value without its scale.\n */\n@Directive({\n selector: 'input[nbNumberInput]',\n providers: [\n { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => NbNumberInputDirective), multi: true },\n { provide: NG_VALIDATORS, useExisting: forwardRef(() => NbNumberInputDirective), multi: true }\n ],\n host: {\n 'type': 'number',\n '[attr.min]': 'min() ?? null',\n '[attr.max]': 'max() ?? null',\n '[attr.step]': 'step() ?? null',\n '(input)': 'onInput()',\n '(blur)': 'onTouched()'\n }\n})\nexport class NbNumberInputDirective implements ControlValueAccessor, Validator {\n protected readonly elementRef = inject<ElementRef<HTMLInputElement>>(ElementRef)\n protected readonly message = injectNbValidationMessage()\n\n /**\n * How many of the units it shows make up one of the value's, e.g. 100 for a fraction shown as a percent.\n */\n readonly scale = input<number, unknown>(1, { transform: (value) => numberAttribute(value, 1) || 1 })\n\n /**\n * The least number it accepts, in the units it shows.\n */\n readonly min = input<number | undefined, unknown>(undefined, { transform: optionalNumber })\n\n /**\n * The greatest number it accepts, in the units it shows.\n */\n readonly max = input<number | undefined, unknown>(undefined, { transform: optionalNumber })\n\n /**\n * How far the arrow keys and the spin buttons move it, in the units it shows; `any` for no steps.\n * 1 by default, as on any number input.\n */\n readonly step = input<number | 'any' | undefined, unknown>(undefined, {\n transform: (value) => (value === 'any' ? value : optionalNumber(value))\n })\n\n // The value the form has: null for an empty field, as forms hold it.\n protected value: number | null = null\n protected onChange: (value: number | null) => void = () => {}\n protected onTouched: () => void = () => {}\n protected onValidatorChange: () => void = () => {}\n\n constructor() {\n // Shows the value at a new scale.\n effect(() => {\n this.scale()\n untracked(() => this.render())\n })\n effect(() => {\n this.min()\n this.max()\n this.scale()\n untracked(() => this.onValidatorChange())\n })\n }\n\n // Untracked, as forms write values from wherever the app sets them, e.g. an effect that mustn't come to depend\n // on the control.\n writeValue(value: unknown) {\n untracked(() => {\n this.value = typeof value === 'number' && !isNaN(value) ? value : null\n this.render()\n })\n }\n\n registerOnChange(fn: (value: number | null) => void) {\n this.onChange = fn\n }\n\n registerOnTouched(fn: () => void) {\n this.onTouched = fn\n }\n\n registerOnValidatorChange(fn: () => void) {\n this.onValidatorChange = fn\n }\n\n setDisabledState(isDisabled: boolean) {\n this.elementRef.nativeElement.disabled = isDisabled\n }\n\n validate(control: AbstractControl): ValidationErrors | null {\n // The browser leaves the value empty for text that isn't a number, e.g. `1e`.\n if (isBadInput(this.elementRef.nativeElement)) {\n return { nbNumberInputParse: nbValidationError(this.message, 'nbNumberInputParse', {}) }\n }\n if (typeof control.value !== 'number') {\n return null\n }\n const actual = round(control.value * this.scale())\n const min = this.min()\n const max = this.max()\n if (min !== undefined && actual < min) {\n return { min: nbValidationError(this.message, 'min', { min, actual }) }\n }\n if (max !== undefined && actual > max) {\n return { max: nbValidationError(this.message, 'max', { max, actual }) }\n }\n return null\n }\n\n protected onInput() {\n const element = this.elementRef.nativeElement\n // While the text isn't a number, the value stays and the field has the parse error.\n if (isBadInput(element)) {\n this.onValidatorChange()\n return\n }\n const shown = element.valueAsNumber\n this.value = isNaN(shown) ? null : round(shown / this.scale())\n this.onChange(this.value)\n // The parse check reads the text, which signal forms don't see change, e.g. from `50e` back to `50`.\n this.onValidatorChange()\n }\n\n protected render() {\n const element = this.elementRef.nativeElement\n const shown = this.value === null ? null : round(this.value * this.scale())\n // Leaves text that already shows the value, e.g. `0.50` while it's typed, and clears text that isn't a number.\n const current = isBadInput(element) ? NaN : element.value === '' ? null : element.valueAsNumber\n if (current !== shown) {\n element.value = shown === null ? '' : String(shown)\n }\n }\n}\n","import { NgModule } from '@angular/core'\nimport { NbInputDirective } from './input.directive'\nimport { NbNumberInputDirective } from './number-input.directive'\n\nconst NB_INPUT_COMPONENTS = [\n NbInputDirective,\n NbNumberInputDirective\n]\n\n@NgModule({\n imports: [...NB_INPUT_COMPONENTS],\n exports: NB_INPUT_COMPONENTS\n})\nexport class NbInputModule {}\n"],"mappings":";;;;;;;;;AA4PA,IAAa,mBAAb,MAAa,iBAAgB;CA4DzB,cAAA;EA1DmB,KAAA,aAAa,iBAAiB,OAAO;EAErC,KAAA,aAAa,OAA2D,UAAU;EAClF,KAAA,eAAe,OAAO,cAAc;EACpC,KAAA,gBAAgB,OAAO,eAAe;EACtC,KAAA,aAAa,OAAO,uBAAuB;GAAE,MAAM;GAAM,UAAU;EAAI,CAAE;EAMnF,KAAA,iBAAiB,MAAmC,QAAS;GAAA,GAAA,YAAA,EAAA,WAAA,iBAAA,+BAAA,CAAA;GAAI,OAAO;EAA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,SAAS;EACZ,CAAA"}
|
|
@@ -244,7 +244,7 @@ var NbRadioGroupComponent = class NbRadioGroupComponent {
|
|
|
244
244
|
this.onTouched = fn;
|
|
245
245
|
}
|
|
246
246
|
writeValue(value) {
|
|
247
|
-
this.valueState.set(value);
|
|
247
|
+
untracked(() => this.valueState.set(value));
|
|
248
248
|
}
|
|
249
249
|
setDisabledState(isDisabled) {
|
|
250
250
|
this.isDisabled.set(isDisabled);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"liquid-js-lyr-core-radio.mjs","names":["focusOnClick","convertToBoolProperty","convertToBoolProperty"],"sources":["../../../packages/core/src/components/radio/radio-group-token.ts","../../../packages/core/src/components/radio/radio.component.ts","../../../packages/core/src/components/radio/radio.component.html","../../../packages/core/src/components/radio/radio-group.component.ts","../../../packages/core/src/components/radio/radio.module.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core'\n\nimport type { NbRadioGroupComponent } from './radio-group.component'\n\n/**\n * The radio group a radio belongs to. Radios read the group's name, value, disabled state, status and size from it.\n */\nexport const NB_RADIO_GROUP = new InjectionToken<NbRadioGroupComponent>('NB_RADIO_GROUP')\n","import { Component, computed, effect, inject, input, linkedSignal, output, untracked } from '@angular/core'\n\nimport { injectNbDefaults, NbStatusService, ɵconvertToBoolProperty as convertToBoolProperty, NbBooleanInput, ɵfocusOnClick as focusOnClick, NbComponentOrCustomStatus, NbComponentSize } from '@liquid-js/lyr-core/base'\nimport { NB_RADIO_GROUP } from './radio-group-token'\n\n/**\n * A radio button, styled like the design system's; a native `<input type=\"radio\">` underneath.\n *\n * @stacked-example(Showcase, radio/radio-showcase.component)\n *\n * ### Installation\n *\n * Import `NbRadioGroupComponent`, `NbRadioComponent` into your standalone component:\n * ```ts\n * @Component({\n * imports: [NbRadioGroupComponent, NbRadioComponent],\n * })\n * export class PageComponent { }\n * ```\n *\n * With NgModules:\n *\n * Import `NbRadioModule` to your feature module.\n *\n * ```ts\n * @NgModule({\n * imports: [\n * // ...\n * NbRadioModule,\n * ],\n * })\n * export class PageModule { }\n * ```\n *\n * ### Usage\n *\n * Radios go in an `nb-radio-group`, which holds the value and binds to forms:\n *\n * ```html\n * <nb-radio-group [(ngModel)]=\"selectedOption\">\n * <nb-radio value=\"1\">Option 1</nb-radio>\n * <nb-radio value=\"2\">Option 2</nb-radio>\n * <nb-radio value=\"3\">Option 3</nb-radio>\n * </nb-radio-group>\n * ```\n *\n * `disabled` disables single radios in a group:\n * @stacked-example(Disabled, radio/radio-disabled.component)\n * @styles\n *\n * radio-tiny-width:\n * radio-tiny-height:\n * radio-small-width:\n * radio-small-height:\n * radio-medium-width:\n * radio-medium-height:\n * radio-label-padding:\n * radio-large-width:\n * radio-large-height:\n * radio-giant-width:\n * radio-giant-height:\n * radio-border-style:\n * radio-border-width:\n * radio-text-font-family:\n * radio-text-padding:\n * radio-tiny-text-font-size:\n * radio-tiny-text-font-weight:\n * radio-tiny-text-line-height:\n * radio-small-text-font-size:\n * radio-small-text-font-weight:\n * radio-small-text-line-height:\n * radio-medium-text-font-size:\n * radio-medium-text-font-weight:\n * radio-medium-text-line-height:\n * radio-large-text-font-size:\n * radio-large-text-font-weight:\n * radio-large-text-line-height:\n * radio-giant-text-font-size:\n * radio-giant-text-font-weight:\n * radio-giant-text-line-height:\n * radio-outline-color:\n * radio-outline-width:\n * radio-basic-text-color:\n * radio-basic-border-color:\n * radio-basic-background-color:\n * radio-basic-checked-background-color:\n * radio-basic-checked-border-color:\n * radio-basic-inner-circle-color:\n * radio-basic-focus-border-color:\n * radio-basic-focus-inner-circle-color:\n * radio-basic-focus-background-color:\n * radio-basic-focus-checked-background-color:\n * radio-basic-focus-checked-border-color:\n * radio-basic-hover-background-color:\n * radio-basic-hover-border-color:\n * radio-basic-hover-inner-circle-color:\n * radio-basic-hover-checked-background-color:\n * radio-basic-hover-checked-border-color:\n * radio-basic-active-border-color:\n * radio-basic-active-inner-circle-color:\n * radio-basic-active-background-color:\n * radio-basic-active-checked-background-color:\n * radio-basic-active-checked-border-color:\n * radio-basic-disabled-background-color:\n * radio-basic-disabled-border-color:\n * radio-basic-disabled-text-color:\n * radio-basic-disabled-checked-background-color:\n * radio-basic-disabled-checked-border-color:\n * radio-basic-disabled-checked-inner-circle-color:\n * radio-primary-text-color:\n * radio-primary-border-color:\n * radio-primary-background-color:\n * radio-primary-checked-background-color:\n * radio-primary-checked-border-color:\n * radio-primary-inner-circle-color:\n * radio-primary-focus-border-color:\n * radio-primary-focus-inner-circle-color:\n * radio-primary-focus-background-color:\n * radio-primary-focus-checked-background-color:\n * radio-primary-focus-checked-border-color:\n * radio-primary-hover-background-color:\n * radio-primary-hover-border-color:\n * radio-primary-hover-inner-circle-color:\n * radio-primary-hover-checked-background-color:\n * radio-primary-hover-checked-border-color:\n * radio-primary-active-border-color:\n * radio-primary-active-inner-circle-color:\n * radio-primary-active-background-color:\n * radio-primary-active-checked-background-color:\n * radio-primary-active-checked-border-color:\n * radio-primary-disabled-background-color:\n * radio-primary-disabled-border-color:\n * radio-primary-disabled-text-color:\n * radio-primary-disabled-checked-background-color:\n * radio-primary-disabled-checked-border-color:\n * radio-primary-disabled-checked-inner-circle-color:\n * radio-success-text-color:\n * radio-success-border-color:\n * radio-success-background-color:\n * radio-success-checked-background-color:\n * radio-success-checked-border-color:\n * radio-success-inner-circle-color:\n * radio-success-focus-border-color:\n * radio-success-focus-inner-circle-color:\n * radio-success-focus-background-color:\n * radio-success-focus-checked-background-color:\n * radio-success-focus-checked-border-color:\n * radio-success-hover-background-color:\n * radio-success-hover-border-color:\n * radio-success-hover-inner-circle-color:\n * radio-success-hover-checked-background-color:\n * radio-success-hover-checked-border-color:\n * radio-success-active-border-color:\n * radio-success-active-inner-circle-color:\n * radio-success-active-background-color:\n * radio-success-active-checked-background-color:\n * radio-success-active-checked-border-color:\n * radio-success-disabled-background-color:\n * radio-success-disabled-border-color:\n * radio-success-disabled-text-color:\n * radio-success-disabled-checked-background-color:\n * radio-success-disabled-checked-border-color:\n * radio-success-disabled-checked-inner-circle-color:\n * radio-info-text-color:\n * radio-info-border-color:\n * radio-label-end-padding:\n * radio-info-background-color:\n * radio-info-checked-background-color:\n * radio-info-checked-border-color:\n * radio-info-inner-circle-color:\n * radio-info-focus-border-color:\n * radio-info-focus-inner-circle-color:\n * radio-info-focus-background-color:\n * radio-info-focus-checked-background-color:\n * radio-info-focus-checked-border-color:\n * radio-info-hover-background-color:\n * radio-info-hover-border-color:\n * radio-info-hover-inner-circle-color:\n * radio-info-hover-checked-background-color:\n * radio-info-hover-checked-border-color:\n * radio-info-active-border-color:\n * radio-info-active-inner-circle-color:\n * radio-info-active-background-color:\n * radio-info-active-checked-background-color:\n * radio-info-active-checked-border-color:\n * radio-info-disabled-background-color:\n * radio-info-disabled-border-color:\n * radio-info-disabled-text-color:\n * radio-info-disabled-checked-background-color:\n * radio-info-disabled-checked-border-color:\n * radio-info-disabled-checked-inner-circle-color:\n * radio-warning-text-color:\n * radio-warning-border-color:\n * radio-warning-background-color:\n * radio-warning-checked-background-color:\n * radio-warning-checked-border-color:\n * radio-warning-inner-circle-color:\n * radio-warning-focus-border-color:\n * radio-warning-focus-inner-circle-color:\n * radio-warning-focus-background-color:\n * radio-warning-focus-checked-background-color:\n * radio-warning-focus-checked-border-color:\n * radio-warning-hover-background-color:\n * radio-warning-hover-border-color:\n * radio-warning-hover-inner-circle-color:\n * radio-warning-hover-checked-background-color:\n * radio-warning-hover-checked-border-color:\n * radio-warning-active-border-color:\n * radio-warning-active-inner-circle-color:\n * radio-warning-active-background-color:\n * radio-warning-active-checked-background-color:\n * radio-warning-active-checked-border-color:\n * radio-warning-disabled-background-color:\n * radio-warning-disabled-border-color:\n * radio-warning-disabled-text-color:\n * radio-warning-disabled-checked-background-color:\n * radio-warning-disabled-checked-border-color:\n * radio-warning-disabled-checked-inner-circle-color:\n * radio-danger-text-color:\n * radio-danger-border-color:\n * radio-danger-background-color:\n * radio-danger-checked-background-color:\n * radio-danger-checked-border-color:\n * radio-danger-inner-circle-color:\n * radio-danger-focus-border-color:\n * radio-danger-focus-inner-circle-color:\n * radio-danger-focus-background-color:\n * radio-danger-focus-checked-background-color:\n * radio-danger-focus-checked-border-color:\n * radio-danger-hover-background-color:\n * radio-danger-hover-border-color:\n * radio-danger-hover-inner-circle-color:\n * radio-danger-hover-checked-background-color:\n * radio-danger-hover-checked-border-color:\n * radio-danger-active-border-color:\n * radio-danger-active-inner-circle-color:\n * radio-danger-active-background-color:\n * radio-danger-active-checked-background-color:\n * radio-danger-active-checked-border-color:\n * radio-danger-disabled-background-color:\n * radio-danger-disabled-border-color:\n * radio-danger-disabled-text-color:\n * radio-danger-disabled-checked-background-color:\n * radio-danger-disabled-checked-border-color:\n * radio-danger-disabled-checked-inner-circle-color:\n * radio-control-text-color:\n * radio-control-background-color:\n * radio-control-border-color:\n * radio-control-checked-background-color:\n * radio-control-checked-border-color:\n * radio-control-inner-circle-color:\n * radio-control-focus-border-color:\n * radio-control-focus-inner-circle-color:\n * radio-control-focus-background-color:\n * radio-control-focus-checked-background-color:\n * radio-control-focus-checked-border-color:\n * radio-control-hover-background-color:\n * radio-control-hover-border-color:\n * radio-control-hover-inner-circle-color:\n * radio-control-hover-checked-background-color:\n * radio-control-hover-checked-border-color:\n * radio-control-active-border-color:\n * radio-control-active-inner-circle-color:\n * radio-control-active-background-color:\n * radio-control-active-checked-background-color:\n * radio-control-active-checked-border-color:\n * radio-control-disabled-background-color:\n * radio-control-disabled-border-color:\n * radio-control-disabled-text-color:\n * radio-control-disabled-checked-background-color:\n * radio-control-disabled-checked-border-color:\n * radio-control-disabled-checked-inner-circle-color:\n * */\n@Component({\n selector: 'nb-radio',\n templateUrl: './radio.component.html',\n styleUrls: ['./radio.component.scss'],\n host: {\n '[class]': 'hostClasses()'\n }\n})\nexport class NbRadioComponent<T = unknown> {\n // The app's defaults for this type, which the inputs below start from.\n protected readonly nbDefaults = injectNbDefaults('radio')\n\n protected readonly focusOnClick = focusOnClick\n protected readonly statusService = inject(NbStatusService)\n protected readonly group = inject(NB_RADIO_GROUP, { optional: true })\n\n /** The native input's name; inside `nb-radio-group`, the group's name is used. */\n readonly name = input<string>()\n\n /**\n * Whether the radio is checked. Inside `nb-radio-group`, the group's value decides; a checked radio sets the\n * group's value when the group has none.\n */\n readonly checked = input<boolean, NbBooleanInput>(false, { transform: convertToBoolProperty })\n\n /** The value the group takes when the radio is checked. */\n readonly value = input<T>()\n\n /** Disables the radio. Inside `nb-radio-group`, the group's `disabled` takes precedence once it's set. */\n readonly disabled = input<boolean, NbBooleanInput>(false, { transform: convertToBoolProperty })\n\n /** `basic` (default), `primary`, `success`, `warning`, `danger`, `info` or `control`; in a group, the group's. */\n readonly status = input<NbComponentOrCustomStatus>('basic')\n\n /** `tiny`, `small`, `medium` (default), `large` or `giant`; in a group, the group's. */\n readonly sizeInput = input<NbComponentSize | undefined>(undefined, { alias: 'size' })\n /** The size in use: the input's, the app's default, or 'medium'. */\n readonly size = linkedSignal<NbComponentSize>(() => this.sizeInput() ?? this.nbDefaults().size ?? 'medium')\n\n /**\n * Emits whether the radio is checked as that changes, as a checkbox's `checkedChange` does: when the user checks it,\n * and when checking another radio of its group unchecks it. For the value, listen to the group's `valueChange`.\n */\n readonly checkedChange = output<boolean>()\n\n protected readonly checkedState = linkedSignal(() => this.checked())\n\n // The state the radio renders with: its own, or its group's.\n readonly isChecked = computed(() => (this.group ? this.group.selectedValue() === this.value() : this.checkedState()))\n readonly resolvedName = computed(() => (this.group ? this.group.resolvedName() : this.name()))\n readonly isDisabled = computed(() => this.group?.isDisabled() ?? this.disabled())\n readonly resolvedStatus = computed(() => (this.group ? this.group.resolvedStatus() : this.status()))\n readonly resolvedSize = computed(() => (this.group ? this.group.size() : this.size()))\n\n protected readonly hostClasses = computed(() => [\n this.statusService.getStatusClass(this.resolvedStatus()),\n `size-${this.resolvedSize()}`\n ])\n\n constructor() {\n // Changes other than the `checked` input's, so `[(checked)]` follows the group too.\n let last: boolean | undefined\n effect(() => {\n const checked = this.isChecked()\n untracked(() => {\n if (last !== undefined && checked !== last && checked !== this.checked()) {\n this.checkedChange.emit(checked)\n }\n last = checked\n })\n })\n }\n\n onChange(event: Event) {\n event.stopPropagation()\n this.checkedState.set(true)\n this.group?.select(this.value())\n }\n\n onClick(event: Event) {\n event.stopPropagation()\n }\n}\n","<label>\n <input type=\"radio\"\n class=\"native-input visually-hidden\"\n tabindex=\"0\"\n [name]=\"resolvedName()\"\n [value]=\"value()\"\n [checked]=\"isChecked()\"\n [disabled]=\"isDisabled()\"\n (change)=\"onChange($event)\"\n (click)=\"onClick($event); focusOnClick($event)\">\n <span class=\"outer-circle\"><span class=\"inner-circle\"></span></span>\n <span class=\"text\">\n <ng-content />\n </span>\n</label>\n","import {\n Component,\n computed,\n contentChildren,\n DestroyRef,\n ElementRef,\n forwardRef,\n inject,\n input,\n linkedSignal,\n output,\n PLATFORM_ID\n} from '@angular/core'\nimport { isPlatformBrowser } from '@angular/common'\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop'\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms'\nimport { fromEvent, merge } from 'rxjs'\nimport { filter, switchMap } from 'rxjs/operators'\n\nimport { injectNbDefaults, ɵconvertToBoolProperty as convertToBoolProperty, NbBooleanInput, NB_DOCUMENT, NbComponentOrCustomStatus, NbComponentSize } from '@liquid-js/lyr-core/base'\nimport { NbValidationDirective } from '@liquid-js/lyr-core/validation'\nimport { NB_RADIO_GROUP } from './radio-group-token'\nimport { NbRadioComponent } from './radio.component'\n\nlet lastRadioGroupId = 0\n\n/**\n * A group of `nb-radio`s, which holds the value of the checked one and binds to forms:\n *\n * ```html\n * <nb-radio-group [(ngModel)]=\"selectedOption\">\n * <nb-radio value=\"1\">Option 1</nb-radio>\n * <nb-radio value=\"2\">Option 2</nb-radio>\n * <nb-radio value=\"3\">Option 3</nb-radio>\n * </nb-radio-group>\n * ```\n *\n * Without forms, bind `value` and `valueChange`:\n *\n * ```html\n * <nb-radio-group [(value)]=\"selectedOption\">\n * <nb-radio value=\"1\">Option 1</nb-radio>\n * <nb-radio value=\"2\">Option 2</nb-radio>\n * <nb-radio value=\"3\">Option 3</nb-radio>\n * </nb-radio-group>\n * ```\n *\n * The radios share a native name, so the browser moves between them with the arrow keys: the group's own, or the\n * `name` input's. Two groups with the same `name` are one group to the browser, so leave it unset unless a form\n * needs it, e.g. for a group shown in two places.\n *\n * ```html\n * <nb-radio-group name=\"my-radio-group\">\n * ...\n * </nb-radio-group>\n * ```\n *\n * `status` colours the radios:\n *\n * @stacked-example(Statuses, radio/radio-statuses.component)\n *\n * `size` sizes them: `tiny`, `small`, `medium` (default), `large` or `giant`.\n * @stacked-example(Sizes, radio/radio-sizes.component)\n *\n * `disabled` disables the whole group:\n * @stacked-example(Disabled group, radio/radio-disabled-group.component)\n *\n * With `ngModel` and reactive forms:\n * @stacked-example(Radio Group with forms, radio/radio-form.component)\n */\n@Component({\n selector: 'nb-radio-group',\n // All of its content, so radios also come in nested control flow, e.g. a @for in an @if.\n template: '<ng-content />',\n host: {\n role: 'radiogroup'\n },\n providers: [\n { provide: NB_RADIO_GROUP, useExisting: forwardRef(() => NbRadioGroupComponent) },\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => NbRadioGroupComponent),\n multi: true\n }\n ]\n})\nexport class NbRadioGroupComponent<T = unknown> implements ControlValueAccessor {\n // The app's defaults for this type, which the inputs below start from.\n protected readonly nbDefaults = injectNbDefaults('radio')\n\n protected readonly hostElement = inject<ElementRef<HTMLElement>>(ElementRef)\n protected readonly platformId = inject(PLATFORM_ID)\n protected readonly document = inject(NB_DOCUMENT)\n\n protected onChange: (value: T) => void = () => {}\n protected onTouched: () => void = () => {}\n\n /** The value of the checked radio; a form's value takes over once it's written. */\n readonly value = input<T>()\n\n /** The radios' native name; the group gives them one of its own without it. */\n readonly name = input<string>()\n\n private readonly ownName = `nb-radio-group-${lastRadioGroupId++}`\n\n /** The radios' native name: `name`, or the group's own. */\n readonly resolvedName = computed(() => this.name() || this.ownName)\n\n /** Disables the radios. Unset by default, which leaves each radio's own `disabled`. */\n readonly disabled = input<boolean | undefined, NbBooleanInput>(undefined, { transform: convertToBoolProperty })\n\n protected readonly validation = inject(NbValidationDirective, { self: true, optional: true })\n\n /**\n * The radios' status: `basic` (default), `primary`, `success`, `warning`, `danger`, `info` or `control`. With\n * `nbValidation`, the validation status takes over while the control shows errors or success.\n */\n readonly status = input<NbComponentOrCustomStatus>('basic')\n\n /** The radios' size: `tiny`, `small`, `medium` (default), `large` or `giant`. */\n readonly sizeInput = input<NbComponentSize | undefined>(undefined, { alias: 'size' })\n /** The size in use: the input's, the app's default, or 'medium'. */\n readonly size = linkedSignal<NbComponentSize>(() => this.sizeInput() ?? this.nbDefaults().size ?? 'medium')\n\n // With `nbValidation`, the status it gives while the control shows errors or success.\n readonly resolvedStatus = computed(() => this.validation?.status() ?? this.status())\n\n /** Emits the value of the radio the user checks. */\n readonly valueChange = output<T>()\n\n // The radios in a group carry values of the group's type.\n readonly radios = contentChildren<NbRadioComponent<T>>(NbRadioComponent, { descendants: true })\n\n protected readonly valueState = linkedSignal<T | null | undefined>(() => this.value())\n\n /** Whether the radios are disabled: the `disabled` input, until a form changes it. */\n readonly isDisabled = linkedSignal(() => this.disabled())\n\n /**\n * The value of the checked radio: the `value` input or the form's value, or else the value of a radio marked\n * `checked`.\n */\n readonly selectedValue = computed(() => {\n const value = this.valueState()\n if (value != null) {\n return value\n }\n const checkedRadio = this.radios().find((radio) => radio.checked())\n return checkedRadio ? checkedRadio.value() : value\n })\n\n constructor() {\n if (isPlatformBrowser(this.platformId)) {\n this.subscribeOnRadiosBlur()\n }\n }\n\n registerOnChange(fn: (value: T) => void) {\n this.onChange = fn\n }\n\n registerOnTouched(fn: () => void) {\n this.onTouched = fn\n }\n\n writeValue(value: T | null) {\n this.valueState.set(value)\n }\n\n setDisabledState(isDisabled: boolean) {\n this.isDisabled.set(isDisabled)\n }\n\n /** Selects the radio with the given value, as a user checking it does: `valueChange` and the form are told. */\n select(value: T) {\n this.valueState.set(value)\n this.valueChange.emit(value)\n this.onChange(value)\n }\n\n // Marks the group touched when focus leaves it.\n protected subscribeOnRadiosBlur() {\n const hostElement = this.hostElement.nativeElement\n fromEvent<Event>(hostElement, 'focusin')\n .pipe(\n filter((event) => hostElement.contains(event.target as Node)),\n switchMap(() => merge(\n fromEvent<Event>(this.document, 'focusin'),\n fromEvent<Event>(this.document, 'click')\n )),\n filter((event) => !hostElement.contains(event.target as Node)),\n takeUntilDestroyed(inject(DestroyRef))\n )\n .subscribe(() => this.onTouched())\n }\n}\n","import { NgModule } from '@angular/core'\n\nimport { NbRadioComponent } from './radio.component'\nimport { NbRadioGroupComponent } from './radio-group.component'\n\n@NgModule({\n imports: [NbRadioComponent, NbRadioGroupComponent],\n exports: [NbRadioComponent, NbRadioGroupComponent]\n})\nexport class NbRadioModule {\n}\n"],"mappings":";;;;;;;;;AAOA,MAAa,iBAAiB,IAAI,eAAsC,gBAAgB;ACkRxF,IAAa,mBAAb,MAAa,iBAAgB;CAmDzB,cAAA;EAjDmB,KAAA,aAAa,iBAAiB,OAAO;EAErC,KAAA,eAAeA;EACf,KAAA,gBAAgB,OAAO,eAAe;EACtC,KAAA,QAAQ,OAAO,gBAAgB,EAAE,UAAU,KAAI,CAAE;EAG3D,KAAA,OAAO,MAAe,GAAA,YAAA,CAAA,QAAA,EAAA,WAAA,OAAA,CAAA,+BAAA,CAAA,CAAA;EAMtB,KAAA,UAAU,MAA+B,OAAK;GAAA,GAAA,YAAA,EAAA,WAAA,UAAA,+BAAA,CAAA;GAAI,WAAWC;EAAqB,CAAA;EAGlF,KAAA,QAAQ,MAAU,GAAA,YAAA,CAAA,QAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;EAGlB,KAAA,WAAW,MAA+B,OAAK;GAAA,GAAA,YAAA,EAAA,WAAA,WAAA,+BAAA,CAAA;GAAI,WAAWA;EAAqB,CAAA;EAGnF,KAAA,SAAS,MAAiC,SAA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AA;GAAA,CAAA;EAAA,CAAA;EAAA,aAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,aAAA;EAAA,CAAA;EAAA,QAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,GAAA,iBAAA,gBAAgB,GAAA;IAAI,aAAa;IAAM,UAAA;GAAA,CAAA;EAAA,CAAA;CAAA;AAAA,CAAA;AC1HlG,IAAa,gBAAb,MAAa,cAAa;CAAb;EAAA,KAAA,OAAA,GAAA,mBAAA;GAAA,YAAA;GAAA,SAAA;GAAA,UAAA;GAAA,MAAA;GAAa,MAAA,CAAA;GAAA,QAAA,GAAA,gBAAA;EAAA,CAAA;CAAA;CAAb;EAAA,KAAA,OAAA,GAAA,oBAAA;GAAA,YAAA;GAAA,SAAA;GAAA,UAAA;GAAA,MAAA;GAAa,SAAA,CAHZ,kBAAkB,qBAAqB;GAAA,SAAA,CACvC,kBAAkB,qBAAqB;EAAA,CAAA;CAAA;CAExC;EAAA,KAAA,OAAA,GAAA,oBAAA;GAAA,YAAA;GAAA,SAAA;GAAA,UAAA;GAAA,MAAA;EAAa,CAAA;CAAA;;AAAb,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAa,YAAA,CAAA;EAJzB,MAAA;EAAS,MAAA,CAAA;GACN,SAAS,CAAC,kBAAkB,qBAAqB;GACjD,SAAS,CAAC,kBAAkB,qBAAqB;EACpD,CAAA"}
|
|
1
|
+
{"version":3,"file":"liquid-js-lyr-core-radio.mjs","names":["focusOnClick","convertToBoolProperty","convertToBoolProperty"],"sources":["../../../packages/core/src/components/radio/radio-group-token.ts","../../../packages/core/src/components/radio/radio.component.ts","../../../packages/core/src/components/radio/radio.component.html","../../../packages/core/src/components/radio/radio-group.component.ts","../../../packages/core/src/components/radio/radio.module.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core'\n\nimport type { NbRadioGroupComponent } from './radio-group.component'\n\n/**\n * The radio group a radio belongs to. Radios read the group's name, value, disabled state, status and size from it.\n */\nexport const NB_RADIO_GROUP = new InjectionToken<NbRadioGroupComponent>('NB_RADIO_GROUP')\n","import { Component, computed, effect, inject, input, linkedSignal, output, untracked } from '@angular/core'\n\nimport { injectNbDefaults, NbStatusService, ɵconvertToBoolProperty as convertToBoolProperty, NbBooleanInput, ɵfocusOnClick as focusOnClick, NbComponentOrCustomStatus, NbComponentSize } from '@liquid-js/lyr-core/base'\nimport { NB_RADIO_GROUP } from './radio-group-token'\n\n/**\n * A radio button, styled like the design system's; a native `<input type=\"radio\">` underneath.\n *\n * @stacked-example(Showcase, radio/radio-showcase.component)\n *\n * ### Installation\n *\n * Import `NbRadioGroupComponent`, `NbRadioComponent` into your standalone component:\n * ```ts\n * @Component({\n * imports: [NbRadioGroupComponent, NbRadioComponent],\n * })\n * export class PageComponent { }\n * ```\n *\n * With NgModules:\n *\n * Import `NbRadioModule` to your feature module.\n *\n * ```ts\n * @NgModule({\n * imports: [\n * // ...\n * NbRadioModule,\n * ],\n * })\n * export class PageModule { }\n * ```\n *\n * ### Usage\n *\n * Radios go in an `nb-radio-group`, which holds the value and binds to forms:\n *\n * ```html\n * <nb-radio-group [(ngModel)]=\"selectedOption\">\n * <nb-radio value=\"1\">Option 1</nb-radio>\n * <nb-radio value=\"2\">Option 2</nb-radio>\n * <nb-radio value=\"3\">Option 3</nb-radio>\n * </nb-radio-group>\n * ```\n *\n * `disabled` disables single radios in a group:\n * @stacked-example(Disabled, radio/radio-disabled.component)\n * @styles\n *\n * radio-tiny-width:\n * radio-tiny-height:\n * radio-small-width:\n * radio-small-height:\n * radio-medium-width:\n * radio-medium-height:\n * radio-label-padding:\n * radio-large-width:\n * radio-large-height:\n * radio-giant-width:\n * radio-giant-height:\n * radio-border-style:\n * radio-border-width:\n * radio-text-font-family:\n * radio-text-padding:\n * radio-tiny-text-font-size:\n * radio-tiny-text-font-weight:\n * radio-tiny-text-line-height:\n * radio-small-text-font-size:\n * radio-small-text-font-weight:\n * radio-small-text-line-height:\n * radio-medium-text-font-size:\n * radio-medium-text-font-weight:\n * radio-medium-text-line-height:\n * radio-large-text-font-size:\n * radio-large-text-font-weight:\n * radio-large-text-line-height:\n * radio-giant-text-font-size:\n * radio-giant-text-font-weight:\n * radio-giant-text-line-height:\n * radio-outline-color:\n * radio-outline-width:\n * radio-basic-text-color:\n * radio-basic-border-color:\n * radio-basic-background-color:\n * radio-basic-checked-background-color:\n * radio-basic-checked-border-color:\n * radio-basic-inner-circle-color:\n * radio-basic-focus-border-color:\n * radio-basic-focus-inner-circle-color:\n * radio-basic-focus-background-color:\n * radio-basic-focus-checked-background-color:\n * radio-basic-focus-checked-border-color:\n * radio-basic-hover-background-color:\n * radio-basic-hover-border-color:\n * radio-basic-hover-inner-circle-color:\n * radio-basic-hover-checked-background-color:\n * radio-basic-hover-checked-border-color:\n * radio-basic-active-border-color:\n * radio-basic-active-inner-circle-color:\n * radio-basic-active-background-color:\n * radio-basic-active-checked-background-color:\n * radio-basic-active-checked-border-color:\n * radio-basic-disabled-background-color:\n * radio-basic-disabled-border-color:\n * radio-basic-disabled-text-color:\n * radio-basic-disabled-checked-background-color:\n * radio-basic-disabled-checked-border-color:\n * radio-basic-disabled-checked-inner-circle-color:\n * radio-primary-text-color:\n * radio-primary-border-color:\n * radio-primary-background-color:\n * radio-primary-checked-background-color:\n * radio-primary-checked-border-color:\n * radio-primary-inner-circle-color:\n * radio-primary-focus-border-color:\n * radio-primary-focus-inner-circle-color:\n * radio-primary-focus-background-color:\n * radio-primary-focus-checked-background-color:\n * radio-primary-focus-checked-border-color:\n * radio-primary-hover-background-color:\n * radio-primary-hover-border-color:\n * radio-primary-hover-inner-circle-color:\n * radio-primary-hover-checked-background-color:\n * radio-primary-hover-checked-border-color:\n * radio-primary-active-border-color:\n * radio-primary-active-inner-circle-color:\n * radio-primary-active-background-color:\n * radio-primary-active-checked-background-color:\n * radio-primary-active-checked-border-color:\n * radio-primary-disabled-background-color:\n * radio-primary-disabled-border-color:\n * radio-primary-disabled-text-color:\n * radio-primary-disabled-checked-background-color:\n * radio-primary-disabled-checked-border-color:\n * radio-primary-disabled-checked-inner-circle-color:\n * radio-success-text-color:\n * radio-success-border-color:\n * radio-success-background-color:\n * radio-success-checked-background-color:\n * radio-success-checked-border-color:\n * radio-success-inner-circle-color:\n * radio-success-focus-border-color:\n * radio-success-focus-inner-circle-color:\n * radio-success-focus-background-color:\n * radio-success-focus-checked-background-color:\n * radio-success-focus-checked-border-color:\n * radio-success-hover-background-color:\n * radio-success-hover-border-color:\n * radio-success-hover-inner-circle-color:\n * radio-success-hover-checked-background-color:\n * radio-success-hover-checked-border-color:\n * radio-success-active-border-color:\n * radio-success-active-inner-circle-color:\n * radio-success-active-background-color:\n * radio-success-active-checked-background-color:\n * radio-success-active-checked-border-color:\n * radio-success-disabled-background-color:\n * radio-success-disabled-border-color:\n * radio-success-disabled-text-color:\n * radio-success-disabled-checked-background-color:\n * radio-success-disabled-checked-border-color:\n * radio-success-disabled-checked-inner-circle-color:\n * radio-info-text-color:\n * radio-info-border-color:\n * radio-label-end-padding:\n * radio-info-background-color:\n * radio-info-checked-background-color:\n * radio-info-checked-border-color:\n * radio-info-inner-circle-color:\n * radio-info-focus-border-color:\n * radio-info-focus-inner-circle-color:\n * radio-info-focus-background-color:\n * radio-info-focus-checked-background-color:\n * radio-info-focus-checked-border-color:\n * radio-info-hover-background-color:\n * radio-info-hover-border-color:\n * radio-info-hover-inner-circle-color:\n * radio-info-hover-checked-background-color:\n * radio-info-hover-checked-border-color:\n * radio-info-active-border-color:\n * radio-info-active-inner-circle-color:\n * radio-info-active-background-color:\n * radio-info-active-checked-background-color:\n * radio-info-active-checked-border-color:\n * radio-info-disabled-background-color:\n * radio-info-disabled-border-color:\n * radio-info-disabled-text-color:\n * radio-info-disabled-checked-background-color:\n * radio-info-disabled-checked-border-color:\n * radio-info-disabled-checked-inner-circle-color:\n * radio-warning-text-color:\n * radio-warning-border-color:\n * radio-warning-background-color:\n * radio-warning-checked-background-color:\n * radio-warning-checked-border-color:\n * radio-warning-inner-circle-color:\n * radio-warning-focus-border-color:\n * radio-warning-focus-inner-circle-color:\n * radio-warning-focus-background-color:\n * radio-warning-focus-checked-background-color:\n * radio-warning-focus-checked-border-color:\n * radio-warning-hover-background-color:\n * radio-warning-hover-border-color:\n * radio-warning-hover-inner-circle-color:\n * radio-warning-hover-checked-background-color:\n * radio-warning-hover-checked-border-color:\n * radio-warning-active-border-color:\n * radio-warning-active-inner-circle-color:\n * radio-warning-active-background-color:\n * radio-warning-active-checked-background-color:\n * radio-warning-active-checked-border-color:\n * radio-warning-disabled-background-color:\n * radio-warning-disabled-border-color:\n * radio-warning-disabled-text-color:\n * radio-warning-disabled-checked-background-color:\n * radio-warning-disabled-checked-border-color:\n * radio-warning-disabled-checked-inner-circle-color:\n * radio-danger-text-color:\n * radio-danger-border-color:\n * radio-danger-background-color:\n * radio-danger-checked-background-color:\n * radio-danger-checked-border-color:\n * radio-danger-inner-circle-color:\n * radio-danger-focus-border-color:\n * radio-danger-focus-inner-circle-color:\n * radio-danger-focus-background-color:\n * radio-danger-focus-checked-background-color:\n * radio-danger-focus-checked-border-color:\n * radio-danger-hover-background-color:\n * radio-danger-hover-border-color:\n * radio-danger-hover-inner-circle-color:\n * radio-danger-hover-checked-background-color:\n * radio-danger-hover-checked-border-color:\n * radio-danger-active-border-color:\n * radio-danger-active-inner-circle-color:\n * radio-danger-active-background-color:\n * radio-danger-active-checked-background-color:\n * radio-danger-active-checked-border-color:\n * radio-danger-disabled-background-color:\n * radio-danger-disabled-border-color:\n * radio-danger-disabled-text-color:\n * radio-danger-disabled-checked-background-color:\n * radio-danger-disabled-checked-border-color:\n * radio-danger-disabled-checked-inner-circle-color:\n * radio-control-text-color:\n * radio-control-background-color:\n * radio-control-border-color:\n * radio-control-checked-background-color:\n * radio-control-checked-border-color:\n * radio-control-inner-circle-color:\n * radio-control-focus-border-color:\n * radio-control-focus-inner-circle-color:\n * radio-control-focus-background-color:\n * radio-control-focus-checked-background-color:\n * radio-control-focus-checked-border-color:\n * radio-control-hover-background-color:\n * radio-control-hover-border-color:\n * radio-control-hover-inner-circle-color:\n * radio-control-hover-checked-background-color:\n * radio-control-hover-checked-border-color:\n * radio-control-active-border-color:\n * radio-control-active-inner-circle-color:\n * radio-control-active-background-color:\n * radio-control-active-checked-background-color:\n * radio-control-active-checked-border-color:\n * radio-control-disabled-background-color:\n * radio-control-disabled-border-color:\n * radio-control-disabled-text-color:\n * radio-control-disabled-checked-background-color:\n * radio-control-disabled-checked-border-color:\n * radio-control-disabled-checked-inner-circle-color:\n * */\n@Component({\n selector: 'nb-radio',\n templateUrl: './radio.component.html',\n styleUrls: ['./radio.component.scss'],\n host: {\n '[class]': 'hostClasses()'\n }\n})\nexport class NbRadioComponent<T = unknown> {\n // The app's defaults for this type, which the inputs below start from.\n protected readonly nbDefaults = injectNbDefaults('radio')\n\n protected readonly focusOnClick = focusOnClick\n protected readonly statusService = inject(NbStatusService)\n protected readonly group = inject(NB_RADIO_GROUP, { optional: true })\n\n /** The native input's name; inside `nb-radio-group`, the group's name is used. */\n readonly name = input<string>()\n\n /**\n * Whether the radio is checked. Inside `nb-radio-group`, the group's value decides; a checked radio sets the\n * group's value when the group has none.\n */\n readonly checked = input<boolean, NbBooleanInput>(false, { transform: convertToBoolProperty })\n\n /** The value the group takes when the radio is checked. */\n readonly value = input<T>()\n\n /** Disables the radio. Inside `nb-radio-group`, the group's `disabled` takes precedence once it's set. */\n readonly disabled = input<boolean, NbBooleanInput>(false, { transform: convertToBoolProperty })\n\n /** `basic` (default), `primary`, `success`, `warning`, `danger`, `info` or `control`; in a group, the group's. */\n readonly status = input<NbComponentOrCustomStatus>('basic')\n\n /** `tiny`, `small`, `medium` (default), `large` or `giant`; in a group, the group's. */\n readonly sizeInput = input<NbComponentSize | undefined>(undefined, { alias: 'size' })\n /** The size in use: the input's, the app's default, or 'medium'. */\n readonly size = linkedSignal<NbComponentSize>(() => this.sizeInput() ?? this.nbDefaults().size ?? 'medium')\n\n /**\n * Emits whether the radio is checked as that changes, as a checkbox's `checkedChange` does: when the user checks it,\n * and when checking another radio of its group unchecks it. For the value, listen to the group's `valueChange`.\n */\n readonly checkedChange = output<boolean>()\n\n protected readonly checkedState = linkedSignal(() => this.checked())\n\n // The state the radio renders with: its own, or its group's.\n readonly isChecked = computed(() => (this.group ? this.group.selectedValue() === this.value() : this.checkedState()))\n readonly resolvedName = computed(() => (this.group ? this.group.resolvedName() : this.name()))\n readonly isDisabled = computed(() => this.group?.isDisabled() ?? this.disabled())\n readonly resolvedStatus = computed(() => (this.group ? this.group.resolvedStatus() : this.status()))\n readonly resolvedSize = computed(() => (this.group ? this.group.size() : this.size()))\n\n protected readonly hostClasses = computed(() => [\n this.statusService.getStatusClass(this.resolvedStatus()),\n `size-${this.resolvedSize()}`\n ])\n\n constructor() {\n // Changes other than the `checked` input's, so `[(checked)]` follows the group too.\n let last: boolean | undefined\n effect(() => {\n const checked = this.isChecked()\n untracked(() => {\n if (last !== undefined && checked !== last && checked !== this.checked()) {\n this.checkedChange.emit(checked)\n }\n last = checked\n })\n })\n }\n\n onChange(event: Event) {\n event.stopPropagation()\n this.checkedState.set(true)\n this.group?.select(this.value())\n }\n\n onClick(event: Event) {\n event.stopPropagation()\n }\n}\n","<label>\n <input type=\"radio\"\n class=\"native-input visually-hidden\"\n tabindex=\"0\"\n [name]=\"resolvedName()\"\n [value]=\"value()\"\n [checked]=\"isChecked()\"\n [disabled]=\"isDisabled()\"\n (change)=\"onChange($event)\"\n (click)=\"onClick($event); focusOnClick($event)\">\n <span class=\"outer-circle\"><span class=\"inner-circle\"></span></span>\n <span class=\"text\">\n <ng-content />\n </span>\n</label>\n","import {\n Component,\n computed,\n contentChildren,\n DestroyRef,\n ElementRef,\n forwardRef,\n inject,\n input,\n linkedSignal,\n output,\n PLATFORM_ID,\n untracked\n} from '@angular/core'\nimport { isPlatformBrowser } from '@angular/common'\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop'\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms'\nimport { fromEvent, merge } from 'rxjs'\nimport { filter, switchMap } from 'rxjs/operators'\n\nimport { injectNbDefaults, ɵconvertToBoolProperty as convertToBoolProperty, NbBooleanInput, NB_DOCUMENT, NbComponentOrCustomStatus, NbComponentSize } from '@liquid-js/lyr-core/base'\nimport { NbValidationDirective } from '@liquid-js/lyr-core/validation'\nimport { NB_RADIO_GROUP } from './radio-group-token'\nimport { NbRadioComponent } from './radio.component'\n\nlet lastRadioGroupId = 0\n\n/**\n * A group of `nb-radio`s, which holds the value of the checked one and binds to forms:\n *\n * ```html\n * <nb-radio-group [(ngModel)]=\"selectedOption\">\n * <nb-radio value=\"1\">Option 1</nb-radio>\n * <nb-radio value=\"2\">Option 2</nb-radio>\n * <nb-radio value=\"3\">Option 3</nb-radio>\n * </nb-radio-group>\n * ```\n *\n * Without forms, bind `value` and `valueChange`:\n *\n * ```html\n * <nb-radio-group [(value)]=\"selectedOption\">\n * <nb-radio value=\"1\">Option 1</nb-radio>\n * <nb-radio value=\"2\">Option 2</nb-radio>\n * <nb-radio value=\"3\">Option 3</nb-radio>\n * </nb-radio-group>\n * ```\n *\n * The radios share a native name, so the browser moves between them with the arrow keys: the group's own, or the\n * `name` input's. Two groups with the same `name` are one group to the browser, so leave it unset unless a form\n * needs it, e.g. for a group shown in two places.\n *\n * ```html\n * <nb-radio-group name=\"my-radio-group\">\n * ...\n * </nb-radio-group>\n * ```\n *\n * `status` colours the radios:\n *\n * @stacked-example(Statuses, radio/radio-statuses.component)\n *\n * `size` sizes them: `tiny`, `small`, `medium` (default), `large` or `giant`.\n * @stacked-example(Sizes, radio/radio-sizes.component)\n *\n * `disabled` disables the whole group:\n * @stacked-example(Disabled group, radio/radio-disabled-group.component)\n *\n * With `ngModel` and reactive forms:\n * @stacked-example(Radio Group with forms, radio/radio-form.component)\n */\n@Component({\n selector: 'nb-radio-group',\n // All of its content, so radios also come in nested control flow, e.g. a @for in an @if.\n template: '<ng-content />',\n host: {\n role: 'radiogroup'\n },\n providers: [\n { provide: NB_RADIO_GROUP, useExisting: forwardRef(() => NbRadioGroupComponent) },\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => NbRadioGroupComponent),\n multi: true\n }\n ]\n})\nexport class NbRadioGroupComponent<T = unknown> implements ControlValueAccessor {\n // The app's defaults for this type, which the inputs below start from.\n protected readonly nbDefaults = injectNbDefaults('radio')\n\n protected readonly hostElement = inject<ElementRef<HTMLElement>>(ElementRef)\n protected readonly platformId = inject(PLATFORM_ID)\n protected readonly document = inject(NB_DOCUMENT)\n\n protected onChange: (value: T) => void = () => {}\n protected onTouched: () => void = () => {}\n\n /** The value of the checked radio; a form's value takes over once it's written. */\n readonly value = input<T>()\n\n /** The radios' native name; the group gives them one of its own without it. */\n readonly name = input<string>()\n\n private readonly ownName = `nb-radio-group-${lastRadioGroupId++}`\n\n /** The radios' native name: `name`, or the group's own. */\n readonly resolvedName = computed(() => this.name() || this.ownName)\n\n /** Disables the radios. Unset by default, which leaves each radio's own `disabled`. */\n readonly disabled = input<boolean | undefined, NbBooleanInput>(undefined, { transform: convertToBoolProperty })\n\n protected readonly validation = inject(NbValidationDirective, { self: true, optional: true })\n\n /**\n * The radios' status: `basic` (default), `primary`, `success`, `warning`, `danger`, `info` or `control`. With\n * `nbValidation`, the validation status takes over while the control shows errors or success.\n */\n readonly status = input<NbComponentOrCustomStatus>('basic')\n\n /** The radios' size: `tiny`, `small`, `medium` (default), `large` or `giant`. */\n readonly sizeInput = input<NbComponentSize | undefined>(undefined, { alias: 'size' })\n /** The size in use: the input's, the app's default, or 'medium'. */\n readonly size = linkedSignal<NbComponentSize>(() => this.sizeInput() ?? this.nbDefaults().size ?? 'medium')\n\n // With `nbValidation`, the status it gives while the control shows errors or success.\n readonly resolvedStatus = computed(() => this.validation?.status() ?? this.status())\n\n /** Emits the value of the radio the user checks. */\n readonly valueChange = output<T>()\n\n // The radios in a group carry values of the group's type.\n readonly radios = contentChildren<NbRadioComponent<T>>(NbRadioComponent, { descendants: true })\n\n protected readonly valueState = linkedSignal<T | null | undefined>(() => this.value())\n\n /** Whether the radios are disabled: the `disabled` input, until a form changes it. */\n readonly isDisabled = linkedSignal(() => this.disabled())\n\n /**\n * The value of the checked radio: the `value` input or the form's value, or else the value of a radio marked\n * `checked`.\n */\n readonly selectedValue = computed(() => {\n const value = this.valueState()\n if (value != null) {\n return value\n }\n const checkedRadio = this.radios().find((radio) => radio.checked())\n return checkedRadio ? checkedRadio.value() : value\n })\n\n constructor() {\n if (isPlatformBrowser(this.platformId)) {\n this.subscribeOnRadiosBlur()\n }\n }\n\n registerOnChange(fn: (value: T) => void) {\n this.onChange = fn\n }\n\n registerOnTouched(fn: () => void) {\n this.onTouched = fn\n }\n\n // Untracked, as forms write values from wherever the app sets them, e.g. an effect that mustn't come to depend\n // on the control.\n writeValue(value: T | null) {\n untracked(() => this.valueState.set(value))\n }\n\n setDisabledState(isDisabled: boolean) {\n this.isDisabled.set(isDisabled)\n }\n\n /** Selects the radio with the given value, as a user checking it does: `valueChange` and the form are told. */\n select(value: T) {\n this.valueState.set(value)\n this.valueChange.emit(value)\n this.onChange(value)\n }\n\n // Marks the group touched when focus leaves it.\n protected subscribeOnRadiosBlur() {\n const hostElement = this.hostElement.nativeElement\n fromEvent<Event>(hostElement, 'focusin')\n .pipe(\n filter((event) => hostElement.contains(event.target as Node)),\n switchMap(() => merge(\n fromEvent<Event>(this.document, 'focusin'),\n fromEvent<Event>(this.document, 'click')\n )),\n filter((event) => !hostElement.contains(event.target as Node)),\n takeUntilDestroyed(inject(DestroyRef))\n )\n .subscribe(() => this.onTouched())\n }\n}\n","import { NgModule } from '@angular/core'\n\nimport { NbRadioComponent } from './radio.component'\nimport { NbRadioGroupComponent } from './radio-group.component'\n\n@NgModule({\n imports: [NbRadioComponent, NbRadioGroupComponent],\n exports: [NbRadioComponent, NbRadioGroupComponent]\n})\nexport class NbRadioModule {\n}\n"],"mappings":";;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,qBAAqB;GAAA,SAAA,CACvC,kBAAkB,qBAAqB;EAAA,CAAA;CAAA;CAExC;EAAA,KAAA,OAAA,GAAA,oBAAA;GAAA,YAAA;GAAA,SAAA;GAAA,UAAA;GAAA,MAAA;EAAa,CAAA;CAAA;;AAAb,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAa,YAAA,CAAA;EAJzB,MAAA;EAAS,MAAA,CAAA;GACN,SAAS,CAAC,kBAAkB,qBAAqB;GACjD,SAAS,CAAC,kBAAkB,qBAAqB;EACpD,CAAA"}
|
|
@@ -7,7 +7,7 @@ import { NbButtonModule } from "@liquid-js/lyr-core/button";
|
|
|
7
7
|
import { NbIconComponent, NbIconModule } from "@liquid-js/lyr-core/icon";
|
|
8
8
|
import { NbCheckboxComponent, NbCheckboxModule } from "@liquid-js/lyr-core/checkbox";
|
|
9
9
|
import { BehaviorSubject, EMPTY, Subject, fromEvent, merge } from "rxjs";
|
|
10
|
-
import { NB_DOCUMENT, NbLayoutDirectionService, NbStatusService, injectNbDefaults, injectNbTexts, ɵconvertToBoolProperty, ɵenableTransitionsAfterRender, ɵisComposing } from "@liquid-js/lyr-core/base";
|
|
10
|
+
import { NB_DOCUMENT, NbLayoutDirectionService, NbStatusService, injectNbDefaults, injectNbTexts, ɵconvertToBoolProperty, ɵenableTransitionsAfterRender, ɵisComposing, ɵsameControlValue } from "@liquid-js/lyr-core/base";
|
|
11
11
|
import { FormsModule, NG_VALUE_ACCESSOR } from "@angular/forms";
|
|
12
12
|
import { outputToObservable, takeUntilDestroyed, toObservable } from "@angular/core/rxjs-interop";
|
|
13
13
|
import { filter, map, skip, switchMap, take } from "rxjs/operators";
|
|
@@ -1630,7 +1630,10 @@ var NbSelectComponent = class NbSelectComponent {
|
|
|
1630
1630
|
this.opened = signal(false, ...ngDevMode ? [{ debugName: "opened" }] : /* istanbul ignore next */ []);
|
|
1631
1631
|
this.isOpen = this.opened.asReadonly();
|
|
1632
1632
|
this.isHidden = computed(() => !this.isOpen(), ...ngDevMode ? [{ debugName: "isHidden" }] : /* istanbul ignore next */ []);
|
|
1633
|
-
this.selectionModel = signal([],
|
|
1633
|
+
this.selectionModel = signal([], {
|
|
1634
|
+
...ngDevMode ? { debugName: "selectionModel" } : /* istanbul ignore next */ {},
|
|
1635
|
+
equal: (a, b) => a.length === b.length && a.every((option, index) => option === b[index])
|
|
1636
|
+
});
|
|
1634
1637
|
this.selectedValue = computed(() => {
|
|
1635
1638
|
const selection = this.selectionModel();
|
|
1636
1639
|
return this.multiple() ? this.optionValues(selection) : selection[0]?.value();
|
|
@@ -1776,15 +1779,17 @@ var NbSelectComponent = class NbSelectComponent {
|
|
|
1776
1779
|
this.isDisabled.set(isDisabled);
|
|
1777
1780
|
}
|
|
1778
1781
|
writeValue(value) {
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
this.
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1782
|
+
untracked(() => {
|
|
1783
|
+
if (!this.alive) return;
|
|
1784
|
+
if (this.canSelectValue()) {
|
|
1785
|
+
this.setSelection(value);
|
|
1786
|
+
this.queued = this.selectionModel().length < this.countValues(value);
|
|
1787
|
+
this.queue = this.queued ? value : void 0;
|
|
1788
|
+
} else {
|
|
1789
|
+
this.queued = true;
|
|
1790
|
+
this.queue = value;
|
|
1791
|
+
}
|
|
1792
|
+
});
|
|
1788
1793
|
}
|
|
1789
1794
|
handleOptionClick(option) {
|
|
1790
1795
|
this.queue = void 0;
|
|
@@ -3155,9 +3160,11 @@ var NbAutocompleteDirective = class NbAutocompleteDirective {
|
|
|
3155
3160
|
}
|
|
3156
3161
|
}
|
|
3157
3162
|
writeValue(value) {
|
|
3158
|
-
|
|
3159
|
-
|
|
3160
|
-
|
|
3163
|
+
untracked(() => {
|
|
3164
|
+
this.writtenValue = value;
|
|
3165
|
+
this.hasWrittenValue = true;
|
|
3166
|
+
this.handleInputValueUpdate(value);
|
|
3167
|
+
});
|
|
3161
3168
|
}
|
|
3162
3169
|
registerOnChange(fn) {
|
|
3163
3170
|
this._onChange = fn;
|
|
@@ -3763,7 +3770,10 @@ var NbTagListComponent = class NbTagListComponent {
|
|
|
3763
3770
|
}
|
|
3764
3771
|
}
|
|
3765
3772
|
writeValue(value) {
|
|
3766
|
-
|
|
3773
|
+
untracked(() => {
|
|
3774
|
+
const next = value ?? [];
|
|
3775
|
+
if (!ɵsameControlValue(this.value(), next)) this.value.set(next);
|
|
3776
|
+
});
|
|
3767
3777
|
}
|
|
3768
3778
|
registerOnChange(fn) {
|
|
3769
3779
|
this.onChange = fn;
|