@gilav21/shadcn-angular-rte 0.2.2 → 0.2.4
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/{gilav21-shadcn-angular-rte-docx-parser-CAPT-WC9.mjs → gilav21-shadcn-angular-rte-docx-parser-Yd5YQqOL.mjs} +2 -2
- package/fesm2022/{gilav21-shadcn-angular-rte-docx-parser-CAPT-WC9.mjs.map → gilav21-shadcn-angular-rte-docx-parser-Yd5YQqOL.mjs.map} +1 -1
- package/fesm2022/{gilav21-shadcn-angular-rte-gilav21-shadcn-angular-rte-CjHrbpSa.mjs → gilav21-shadcn-angular-rte-gilav21-shadcn-angular-rte-ATpviG2l.mjs} +439 -167
- package/fesm2022/gilav21-shadcn-angular-rte-gilav21-shadcn-angular-rte-ATpviG2l.mjs.map +1 -0
- package/fesm2022/{gilav21-shadcn-angular-rte-pdf-readable-JvCpuNQH.mjs → gilav21-shadcn-angular-rte-pdf-readable-BKYRkHec.mjs} +142 -192
- package/fesm2022/gilav21-shadcn-angular-rte-pdf-readable-BKYRkHec.mjs.map +1 -0
- package/fesm2022/gilav21-shadcn-angular-rte.mjs +1 -1
- package/package.json +1 -1
- package/styles.css +1 -1
- package/types/gilav21-shadcn-angular-rte.d.ts +40 -5
- package/types/gilav21-shadcn-angular-rte.d.ts.map +1 -1
- package/fesm2022/gilav21-shadcn-angular-rte-gilav21-shadcn-angular-rte-CjHrbpSa.mjs.map +0 -1
- package/fesm2022/gilav21-shadcn-angular-rte-pdf-readable-JvCpuNQH.mjs.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { isDevMode, inject, Injectable, input, computed, ChangeDetectionStrategy, Component, signal, ElementRef, DestroyRef, output, Injector, InjectionToken, effect, untracked, forwardRef, ViewChild, Directive, model, afterNextRender, Renderer2, viewChild,
|
|
2
|
+
import { isDevMode, inject, Injectable, input, computed, ChangeDetectionStrategy, Component, signal, ElementRef, DestroyRef, output, Injector, InjectionToken, effect, untracked, forwardRef, ViewChild, Directive, model, afterNextRender, afterRenderEffect, Renderer2, viewChild, contentChild, ApplicationRef, EnvironmentInjector, createComponent, HostListener, ViewContainerRef, ChangeDetectorRef, TemplateRef, PLATFORM_ID, NgZone, ViewChildren, Pipe } from '@angular/core';
|
|
3
3
|
import * as i1 from '@angular/forms';
|
|
4
4
|
import { FormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
5
5
|
import { DOCUMENT, NgComponentOutlet, NgTemplateOutlet, isPlatformBrowser, DatePipe } from '@angular/common';
|
|
@@ -682,8 +682,11 @@ function graphemeLength(text) {
|
|
|
682
682
|
const segmenter = graphemeSegmenter();
|
|
683
683
|
if (!segmenter)
|
|
684
684
|
return text.length;
|
|
685
|
+
// Walk the iterator rather than Array.from: this runs on every keystroke of a length-limited field, and
|
|
686
|
+
// materialising a Segment object per grapheme costs memory and about a third more time on a long string.
|
|
687
|
+
const segments = segmenter.segment(text)[Symbol.iterator]();
|
|
685
688
|
let count = 0;
|
|
686
|
-
|
|
689
|
+
while (!segments.next().done)
|
|
687
690
|
count++;
|
|
688
691
|
return count;
|
|
689
692
|
}
|
|
@@ -1963,7 +1966,7 @@ function stripCssComments(value) {
|
|
|
1963
1966
|
function decodeCssEscapes(value) {
|
|
1964
1967
|
if (!value.includes('\\'))
|
|
1965
1968
|
return value;
|
|
1966
|
-
return value.replaceAll(/\\([0-9a-fA-F]{1,6})[ \t\n]?|\\(.)/g, (
|
|
1969
|
+
return value.replaceAll(/\\([0-9a-fA-F]{1,6})[ \t\n]?|\\(.)/g, (...[, hex, literal]) => {
|
|
1967
1970
|
if (hex !== undefined) {
|
|
1968
1971
|
const code = Number.parseInt(hex, 16);
|
|
1969
1972
|
return code > 0 && code <= 0x10FFFF ? String.fromCodePoint(code) : '';
|
|
@@ -2191,7 +2194,7 @@ class RichTextSanitizerService {
|
|
|
2191
2194
|
'li': new Set(['data-task', 'data-checked']),
|
|
2192
2195
|
'details': new Set(['open']),
|
|
2193
2196
|
'col': new Set(['span', 'width']),
|
|
2194
|
-
'*': new Set(['data-mention', 'data-mention-id', 'data-tag', 'data-tag-id', 'style', 'dir']),
|
|
2197
|
+
'*': new Set(['data-mention', 'data-mention-id', 'data-tag', 'data-tag-id', 'data-entity-mode', 'style', 'dir']),
|
|
2195
2198
|
};
|
|
2196
2199
|
/** Allowed CSS properties for inline styles */
|
|
2197
2200
|
this.ALLOWED_STYLE_PROPERTIES = new Set([
|
|
@@ -3545,7 +3548,7 @@ class RichTextSanitizerService {
|
|
|
3545
3548
|
* don't require HTML entity encoding inside double-quoted attributes.
|
|
3546
3549
|
*/
|
|
3547
3550
|
normalizeStyleQuotes(html) {
|
|
3548
|
-
return html.replaceAll(/style="([^"]*)"/g, (
|
|
3551
|
+
return html.replaceAll(/style="([^"]*)"/g, (...[, styleContent]) => `style="${styleContent.replaceAll('"', "'")}"`);
|
|
3549
3552
|
}
|
|
3550
3553
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: RichTextSanitizerService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
3551
3554
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: RichTextSanitizerService, providedIn: 'root' }); }
|
|
@@ -5500,7 +5503,7 @@ class RichTextMarkdownService {
|
|
|
5500
5503
|
// fence before blockquote and list parsing baked those markers INTO the
|
|
5501
5504
|
// code, and each round-trip added another level -- the same compounding
|
|
5502
5505
|
// corruption the lift was introduced to stop, reintroduced for nesting.
|
|
5503
|
-
return markdown.replaceAll(CODE_FENCE_OPEN, '').replaceAll(CODE_FENCE_CLOSE, '').replaceAll(FENCE_PATTERN, (
|
|
5506
|
+
return markdown.replaceAll(CODE_FENCE_OPEN, '').replaceAll(CODE_FENCE_CLOSE, '').replaceAll(FENCE_PATTERN, (...[, prefix, , lang, code]) => {
|
|
5504
5507
|
const langAttr = lang ? ` data-language="${lang}" class="language-${lang}"` : '';
|
|
5505
5508
|
const token = `${prefix}${CODE_FENCE_OPEN}${store.length}${CODE_FENCE_CLOSE}`;
|
|
5506
5509
|
const body = stripBlockPrefix(code, prefix);
|
|
@@ -7412,7 +7415,7 @@ function trackRowspans(cells, carried) {
|
|
|
7412
7415
|
* "<code>x</code>".
|
|
7413
7416
|
*/
|
|
7414
7417
|
function resolveInlineCodeText(value, store) {
|
|
7415
|
-
return value.replaceAll(/(\d{1,9})/g, (
|
|
7418
|
+
return value.replaceAll(/(\d{1,9})/g, (...[, index]) => {
|
|
7416
7419
|
const parked = store[Number(index)] ?? '';
|
|
7417
7420
|
return parked.replace(/^<code>/, '').replace(/<\/code>$/, '');
|
|
7418
7421
|
});
|
|
@@ -7427,10 +7430,15 @@ function restoreParked(html, open, close, store, map = (s) => s) {
|
|
|
7427
7430
|
if (store.length === 0)
|
|
7428
7431
|
return html;
|
|
7429
7432
|
const pattern = new RegExp(String.raw `${open}(\d{1,9})${close}`, 'g');
|
|
7430
|
-
return html.replaceAll(pattern, (
|
|
7433
|
+
return html.replaceAll(pattern, (...[, index]) => map(store[Number(index)] ?? ''));
|
|
7431
7434
|
}
|
|
7432
7435
|
|
|
7433
7436
|
/** Word's namespaced wrapper elements, unwrapped so the text they hold stays. */
|
|
7437
|
+
/** A Map, not an object: the key is the pasted size attribute, and an object would resolve names like constructor through its prototype. */
|
|
7438
|
+
const FONT_SIZE_PX = new Map([
|
|
7439
|
+
['1', '10px'], ['2', '13px'], ['3', '16px'], ['4', '18px'],
|
|
7440
|
+
['5', '24px'], ['6', '32px'], ['7', '48px'],
|
|
7441
|
+
]);
|
|
7434
7442
|
const WORD_WRAPPER_TAGS = new Set(['o:p', 'w:sdtcontent', 'w:sdt', 'w:sdtpr', 'w:sdtendpr', 'o:oleobject']);
|
|
7435
7443
|
/**
|
|
7436
7444
|
* Normalizes pasted content from various sources (Word, Outlook, Google Docs, etc.)
|
|
@@ -7889,7 +7897,7 @@ class RichTextPasteNormalizerService {
|
|
|
7889
7897
|
const mapped = new Map();
|
|
7890
7898
|
for (const [prop, value] of styles) {
|
|
7891
7899
|
if (prop.startsWith('mso-')) {
|
|
7892
|
-
this.mapMsoProperty(prop, value, mapped
|
|
7900
|
+
this.mapMsoProperty(prop, value, mapped);
|
|
7893
7901
|
}
|
|
7894
7902
|
else if (!prop.startsWith('-')) {
|
|
7895
7903
|
this.mapStandardProperty(prop, value, mapped);
|
|
@@ -7966,7 +7974,7 @@ class RichTextPasteNormalizerService {
|
|
|
7966
7974
|
break;
|
|
7967
7975
|
}
|
|
7968
7976
|
}
|
|
7969
|
-
mapMsoProperty(prop, value, mapped
|
|
7977
|
+
mapMsoProperty(prop, value, mapped) {
|
|
7970
7978
|
if (!value)
|
|
7971
7979
|
return;
|
|
7972
7980
|
this.mapMsoFontProperty(prop, value, mapped);
|
|
@@ -8150,11 +8158,7 @@ class RichTextPasteNormalizerService {
|
|
|
8150
8158
|
styles.push(`font-family: ${face}`);
|
|
8151
8159
|
const size = font.getAttribute('size');
|
|
8152
8160
|
if (size) {
|
|
8153
|
-
const
|
|
8154
|
-
'1': '10px', '2': '13px', '3': '16px', '4': '18px',
|
|
8155
|
-
'5': '24px', '6': '32px', '7': '48px',
|
|
8156
|
-
};
|
|
8157
|
-
const mapped = sizeMap[size];
|
|
8161
|
+
const mapped = FONT_SIZE_PX.get(size);
|
|
8158
8162
|
if (mapped)
|
|
8159
8163
|
styles.push(`font-size: ${mapped}`);
|
|
8160
8164
|
}
|
|
@@ -9322,7 +9326,7 @@ const RICH_TEXT_LOCALES = {
|
|
|
9322
9326
|
characters: '{count} символов',
|
|
9323
9327
|
words: '{count} слов',
|
|
9324
9328
|
formattingOptions: 'Параметры форматирования',
|
|
9325
|
-
blockedImage: 'Изображение
|
|
9329
|
+
blockedImage: 'Изображение заблокировано политикой безопасности',
|
|
9326
9330
|
},
|
|
9327
9331
|
},
|
|
9328
9332
|
pt: {
|
|
@@ -11181,7 +11185,7 @@ function markdownToText(value) {
|
|
|
11181
11185
|
const fences = [];
|
|
11182
11186
|
let text = value
|
|
11183
11187
|
.replaceAll(/[\ue000\ue001]/g, '')
|
|
11184
|
-
.replace(FENCE, (
|
|
11188
|
+
.replace(FENCE, (...[, body]) => {
|
|
11185
11189
|
fences.push(body);
|
|
11186
11190
|
return `\ue000${fences.length - 1}\ue001`;
|
|
11187
11191
|
});
|
|
@@ -11191,7 +11195,7 @@ function markdownToText(value) {
|
|
|
11191
11195
|
for (const [pattern, replacement] of ENTITIES) {
|
|
11192
11196
|
text = text.replace(pattern, replacement);
|
|
11193
11197
|
}
|
|
11194
|
-
return text.replace(FENCE_TOKEN, (
|
|
11198
|
+
return text.replace(FENCE_TOKEN, (...[, index]) => fences[Number(index)] ?? '');
|
|
11195
11199
|
}
|
|
11196
11200
|
/**
|
|
11197
11201
|
* Collapse whitespace artefacts both paths can leave behind.
|
|
@@ -11359,6 +11363,13 @@ const RICH_TEXT_PROSE_CLASSES = [
|
|
|
11359
11363
|
'[&_details]:border [&_details]:border-border [&_details]:rounded-md [&_details]:my-2 [&_details]:overflow-hidden',
|
|
11360
11364
|
'[&_summary]:bg-muted/40 [&_summary]:px-3 [&_summary]:py-2 [&_summary]:cursor-pointer [&_summary]:font-medium',
|
|
11361
11365
|
'[&_details>:not(summary)]:px-3 [&_details>:not(summary)]:py-2',
|
|
11366
|
+
// Mention and tag chips are styled by the data attributes the sanitizer
|
|
11367
|
+
// keeps, not by a class: `class` never survives a sanitizing round trip
|
|
11368
|
+
// (setContent, paste, saved HTML), so a class-only chip lost its look.
|
|
11369
|
+
// The rule applies only to a chip with no `class` of its own (a live chip
|
|
11370
|
+
// carries its classes, so a consumer className or a link/text mode keeps its
|
|
11371
|
+
// look) and no `data-entity-mode` (how text/link modes survive the strip).
|
|
11372
|
+
'[&_:where(span,a):where([data-mention],[data-tag]):not([class],[data-entity-mode])]:bg-accent [&_:where(span,a):where([data-mention],[data-tag]):not([class],[data-entity-mode])]:text-accent-foreground [&_:where(span,a):where([data-mention],[data-tag]):not([class],[data-entity-mode])]:rounded [&_:where(span,a):where([data-mention],[data-tag]):not([class],[data-entity-mode])]:px-1',
|
|
11362
11373
|
'[&_hr]:border-t [&_hr]:border-border [&_hr]:my-4',
|
|
11363
11374
|
'[&_blockquote]:border-s-4 [&_blockquote]:border-border [&_blockquote]:ps-4 [&_blockquote]:py-1 [&_blockquote]:my-2 [&_blockquote]:text-muted-foreground [&_blockquote]:italic',
|
|
11364
11375
|
// Syntax highlighting. The classes are the ones the sanitizer has always
|
|
@@ -11589,7 +11600,7 @@ function formatRelativeTime(value, unit, locale, options) {
|
|
|
11589
11600
|
*/
|
|
11590
11601
|
function localeDigits(locale) {
|
|
11591
11602
|
const formatter = new Intl.NumberFormat(locale, { useGrouping: false });
|
|
11592
|
-
return Array.from({ length: 10 }, (
|
|
11603
|
+
return Array.from({ length: 10 }, (...[, digit]) => formatter.format(digit));
|
|
11593
11604
|
}
|
|
11594
11605
|
/**
|
|
11595
11606
|
* Rewrite a locale's digits as ASCII so the result can be parsed as a number.
|
|
@@ -12224,6 +12235,8 @@ class RichTextEditorComponent extends RichTextEditorAddonHost {
|
|
|
12224
12235
|
this.findScrollHandler = null;
|
|
12225
12236
|
this.snapshots = [];
|
|
12226
12237
|
this.historyIndex = -1;
|
|
12238
|
+
this.inputModeRestoreTimer = null;
|
|
12239
|
+
this.savedInputMode = '';
|
|
12227
12240
|
this.historyDebounceTimer = null;
|
|
12228
12241
|
this.shortcutHandle = null;
|
|
12229
12242
|
this.keydownInterceptors = new Set();
|
|
@@ -14131,20 +14144,16 @@ class RichTextEditorComponent extends RichTextEditorAddonHost {
|
|
|
14131
14144
|
executeInlineFormatCommand(command, mentionTargets) {
|
|
14132
14145
|
switch (command) {
|
|
14133
14146
|
case 'bold':
|
|
14134
|
-
this.
|
|
14135
|
-
this.toggleMentionStyle(mentionTargets, 'fontWeight', 'bold', 'normal');
|
|
14147
|
+
this.toggleChipStyle(mentionTargets, 'bold', 'fontWeight', 'bold');
|
|
14136
14148
|
return true;
|
|
14137
14149
|
case 'italic':
|
|
14138
|
-
this.
|
|
14139
|
-
this.toggleMentionStyle(mentionTargets, 'fontStyle', 'italic', 'normal');
|
|
14150
|
+
this.toggleChipStyle(mentionTargets, 'italic', 'fontStyle', 'italic');
|
|
14140
14151
|
return true;
|
|
14141
14152
|
case 'underline':
|
|
14142
|
-
this.
|
|
14143
|
-
this.toggleMentionTextDecoration(mentionTargets, 'underline');
|
|
14153
|
+
this.toggleChipDecoration(mentionTargets, 'underline', 'underline');
|
|
14144
14154
|
return true;
|
|
14145
14155
|
case 'strikethrough':
|
|
14146
|
-
this.
|
|
14147
|
-
this.toggleMentionTextDecoration(mentionTargets, 'line-through');
|
|
14156
|
+
this.toggleChipDecoration(mentionTargets, 'strikeThrough', 'line-through');
|
|
14148
14157
|
return true;
|
|
14149
14158
|
case 'clear':
|
|
14150
14159
|
this.clearFormatting(mentionTargets);
|
|
@@ -14375,18 +14384,34 @@ class RichTextEditorComponent extends RichTextEditorAddonHost {
|
|
|
14375
14384
|
return;
|
|
14376
14385
|
this.flushPendingHistoryPush();
|
|
14377
14386
|
const editor = this.editorDiv?.nativeElement;
|
|
14378
|
-
const prevInputMode = editor?.inputMode;
|
|
14379
14387
|
if (editor) {
|
|
14388
|
+
// A burst keeps the value from before its first insert: a second
|
|
14389
|
+
// insert would otherwise capture our own temporary 'none'.
|
|
14390
|
+
if (this.inputModeRestoreTimer === null) {
|
|
14391
|
+
this.savedInputMode = editor.inputMode;
|
|
14392
|
+
}
|
|
14393
|
+
else {
|
|
14394
|
+
clearTimeout(this.inputModeRestoreTimer);
|
|
14395
|
+
}
|
|
14380
14396
|
editor.inputMode = 'none';
|
|
14381
14397
|
}
|
|
14382
|
-
|
|
14383
|
-
|
|
14384
|
-
|
|
14385
|
-
|
|
14386
|
-
|
|
14398
|
+
try {
|
|
14399
|
+
insert();
|
|
14400
|
+
this.pushHistory();
|
|
14401
|
+
const selection = this.document.getSelection();
|
|
14402
|
+
if (selection && selection.rangeCount > 0) {
|
|
14403
|
+
this.savedRange = selection.getRangeAt(0).cloneRange();
|
|
14404
|
+
}
|
|
14387
14405
|
}
|
|
14388
|
-
|
|
14389
|
-
|
|
14406
|
+
finally {
|
|
14407
|
+
// A throwing insert must still schedule the restore, or the editor
|
|
14408
|
+
// keeps 'none' and the next insert saves that as the original.
|
|
14409
|
+
if (editor) {
|
|
14410
|
+
this.inputModeRestoreTimer = setTimeout(() => {
|
|
14411
|
+
this.inputModeRestoreTimer = null;
|
|
14412
|
+
editor.inputMode = this.savedInputMode;
|
|
14413
|
+
}, 100);
|
|
14414
|
+
}
|
|
14390
14415
|
}
|
|
14391
14416
|
}
|
|
14392
14417
|
/** Commit addon DOM edits to the model + flush pending history (addon host surface). */
|
|
@@ -14815,13 +14840,24 @@ class RichTextEditorComponent extends RichTextEditorAddonHost {
|
|
|
14815
14840
|
this.flushPendingHistoryPush();
|
|
14816
14841
|
this.restoreSelection();
|
|
14817
14842
|
const mentionTargets = this.getMentionElementsInSelection();
|
|
14843
|
+
// Chromium rewrites the family it writes into `face` (quotes dropped), so
|
|
14844
|
+
// the command's own elements are told apart by what changed across the
|
|
14845
|
+
// exec -- a new element, or a `face` that moved -- not by the text.
|
|
14846
|
+
const facesBefore = new Map(Array.from(this.editorDiv?.nativeElement.querySelectorAll('font[face]') ?? [])
|
|
14847
|
+
.map((font) => [font, font.getAttribute('face')]));
|
|
14818
14848
|
this.execEditorCommand('fontName', family);
|
|
14819
14849
|
const styled = [];
|
|
14820
14850
|
if (this.editorDiv?.nativeElement) {
|
|
14821
|
-
//
|
|
14822
|
-
//
|
|
14851
|
+
// Splitting a pre-existing <font> leaves clones of it on both sides
|
|
14852
|
+
// of the selection; those are new elements but not the command's, so
|
|
14853
|
+
// only fonts the selection actually covers take the new family.
|
|
14854
|
+
const selection = this.document.getSelection();
|
|
14855
|
+
const range = selection && selection.rangeCount > 0 && this.editorDiv.nativeElement.contains(selection.getRangeAt(0).commonAncestorContainer)
|
|
14856
|
+
? selection.getRangeAt(0)
|
|
14857
|
+
: null;
|
|
14823
14858
|
const fontElements = Array.from(this.editorDiv.nativeElement.querySelectorAll('font[face]'))
|
|
14824
|
-
.filter((font) =>
|
|
14859
|
+
.filter((font) => (!range || range.intersectsNode(font))
|
|
14860
|
+
&& (facesBefore.get(font) !== font.getAttribute('face') || this.isSameFontFamily(font.getAttribute('face'), family)));
|
|
14825
14861
|
for (const font of fontElements) {
|
|
14826
14862
|
const el = font;
|
|
14827
14863
|
const span = this.document.createElement('span');
|
|
@@ -14838,6 +14874,15 @@ class RichTextEditorComponent extends RichTextEditorAddonHost {
|
|
|
14838
14874
|
this.reSaveLiveSelection(styled);
|
|
14839
14875
|
this.pushHistory();
|
|
14840
14876
|
}
|
|
14877
|
+
/**
|
|
14878
|
+
* A `<font>` already carrying the requested family is left unchanged by
|
|
14879
|
+
* `fontName`, so "did its face move" cannot find it; the sanitizer drops
|
|
14880
|
+
* `<font>`, so it must still become a styled span.
|
|
14881
|
+
*/
|
|
14882
|
+
isSameFontFamily(face, family) {
|
|
14883
|
+
const normalize = (value) => value.replaceAll(/["']/g, '').trim().toLowerCase();
|
|
14884
|
+
return face !== null && normalize(face) === normalize(family);
|
|
14885
|
+
}
|
|
14841
14886
|
getCaretOffset(element) {
|
|
14842
14887
|
const selection = this.document.getSelection();
|
|
14843
14888
|
if (!selection?.anchorNode)
|
|
@@ -17343,21 +17388,59 @@ class RichTextEditorComponent extends RichTextEditorAddonHost {
|
|
|
17343
17388
|
});
|
|
17344
17389
|
return result;
|
|
17345
17390
|
}
|
|
17346
|
-
|
|
17347
|
-
|
|
17348
|
-
|
|
17391
|
+
/**
|
|
17392
|
+
* Run a toggling `execCommand` and leave every chip in the selection in the
|
|
17393
|
+
* state the command gave the surrounding text: after a toggle a chip has the
|
|
17394
|
+
* same effective state as the text around it.
|
|
17395
|
+
*
|
|
17396
|
+
* That state is read BEFORE the exec, from the command, not from the chip's
|
|
17397
|
+
* own inline style: a chip can be bold only through a `<b>` ancestor (no
|
|
17398
|
+
* inline style), or carry an inline bold inside a partly-bold selection, and
|
|
17399
|
+
* Chromium also strips a chip's matching inline style when the command turns
|
|
17400
|
+
* the format off, so anything read afterwards reports "off". When the
|
|
17401
|
+
* selection holds nothing but chips (non-editable, so the command has no
|
|
17402
|
+
* text to act on and reports "off") or there is no `queryCommandState`, the
|
|
17403
|
+
* chip's own style is the only state there is.
|
|
17404
|
+
*/
|
|
17405
|
+
toggleChipsWithCommand(commandId, chips, chipHasFormat, setChipFormat) {
|
|
17406
|
+
const textHadFormat = this.selectionHoldsTextOutsideChips() ? this.queryEditorCommandState(commandId) : undefined;
|
|
17407
|
+
const turnOn = chips.map((chip) => !(textHadFormat ?? chipHasFormat(chip)));
|
|
17408
|
+
this.execEditorCommand(commandId);
|
|
17409
|
+
chips.forEach((chip, i) => setChipFormat(chip, turnOn[i]));
|
|
17410
|
+
}
|
|
17411
|
+
/**
|
|
17412
|
+
* Decided on the range, not on `Selection.toString()`: that string follows
|
|
17413
|
+
* rendered text (`text-transform`, a partly selected chip), so comparing it
|
|
17414
|
+
* with a chip's `textContent` misreads a chips-only selection as having text.
|
|
17415
|
+
*/
|
|
17416
|
+
selectionHoldsTextOutsideChips() {
|
|
17417
|
+
const editor = this.getEditorElement();
|
|
17418
|
+
const selection = this.document.getSelection();
|
|
17419
|
+
if (!editor || !selection || selection.rangeCount === 0)
|
|
17420
|
+
return false;
|
|
17421
|
+
const range = selection.getRangeAt(0);
|
|
17422
|
+
const walker = this.document.createTreeWalker(editor, NodeFilter.SHOW_TEXT);
|
|
17423
|
+
for (let node = walker.nextNode(); node; node = walker.nextNode()) {
|
|
17424
|
+
if (!range.intersectsNode(node) || node.parentElement?.closest('[data-mention], [data-tag]'))
|
|
17425
|
+
continue;
|
|
17426
|
+
const from = node === range.startContainer ? range.startOffset : 0;
|
|
17427
|
+
const to = node === range.endContainer ? range.endOffset : node.data.length;
|
|
17428
|
+
if (node.data.slice(from, to).trim() !== '')
|
|
17429
|
+
return true;
|
|
17349
17430
|
}
|
|
17431
|
+
return false;
|
|
17350
17432
|
}
|
|
17351
|
-
|
|
17352
|
-
|
|
17353
|
-
|
|
17354
|
-
|
|
17355
|
-
|
|
17356
|
-
|
|
17357
|
-
|
|
17358
|
-
|
|
17359
|
-
|
|
17360
|
-
|
|
17433
|
+
toggleChipStyle(chips, commandId, prop, onValue) {
|
|
17434
|
+
this.toggleChipsWithCommand(commandId, chips, (chip) => chip.style[prop] === onValue, (chip, on) => { chip.style[prop] = on ? onValue : 'normal'; });
|
|
17435
|
+
}
|
|
17436
|
+
toggleChipDecoration(chips, commandId, decoration) {
|
|
17437
|
+
this.toggleChipsWithCommand(commandId, chips, (chip) => chip.style.textDecoration.includes(decoration), (chip, on) => { chip.style.textDecoration = this.withTextDecoration(chip.style.textDecoration, decoration, on); });
|
|
17438
|
+
}
|
|
17439
|
+
withTextDecoration(current, decoration, on) {
|
|
17440
|
+
const present = current.includes(decoration);
|
|
17441
|
+
if (on === present)
|
|
17442
|
+
return current;
|
|
17443
|
+
return on ? `${current} ${decoration}`.trim() : current.replace(decoration, '').trim();
|
|
17361
17444
|
}
|
|
17362
17445
|
setMentionStyle(elements, prop, value) {
|
|
17363
17446
|
for (const el of elements) {
|
|
@@ -17482,9 +17565,10 @@ class RichTextEditorComponent extends RichTextEditorAddonHost {
|
|
|
17482
17565
|
const doc = this.document;
|
|
17483
17566
|
return doc.execCommand?.(commandId, false, value) ?? false;
|
|
17484
17567
|
}
|
|
17568
|
+
/** `undefined` when the environment has no `queryCommandState`. */
|
|
17485
17569
|
queryEditorCommandState(commandId) {
|
|
17486
17570
|
const doc = this.document;
|
|
17487
|
-
return doc.queryCommandState?.(commandId)
|
|
17571
|
+
return doc.queryCommandState?.(commandId);
|
|
17488
17572
|
}
|
|
17489
17573
|
focusEditor() {
|
|
17490
17574
|
this.editorDiv?.nativeElement?.focus();
|
|
@@ -19311,15 +19395,6 @@ class RichTextEditorComponent extends RichTextEditorAddonHost {
|
|
|
19311
19395
|
.replaceAll(/<\/(p|div|li|h[1-6]|blockquote|pre|tr)>/gi, '\n');
|
|
19312
19396
|
return this.sanitizer.stripTags(blockAware);
|
|
19313
19397
|
}
|
|
19314
|
-
isSelectionInsideEditor() {
|
|
19315
|
-
const selection = this.document.getSelection();
|
|
19316
|
-
const editor = this.getEditorElement();
|
|
19317
|
-
if (!selection || selection.rangeCount === 0 || !editor) {
|
|
19318
|
-
return false;
|
|
19319
|
-
}
|
|
19320
|
-
const range = selection.getRangeAt(0);
|
|
19321
|
-
return editor.contains(range.startContainer) && editor.contains(range.endContainer);
|
|
19322
|
-
}
|
|
19323
19398
|
computeDelta(prev, current) {
|
|
19324
19399
|
const prevLines = prev.split('\n');
|
|
19325
19400
|
const curLines = current.split('\n');
|
|
@@ -19342,20 +19417,15 @@ class RichTextEditorComponent extends RichTextEditorAddonHost {
|
|
|
19342
19417
|
continue;
|
|
19343
19418
|
}
|
|
19344
19419
|
if (foundPrev === -1) {
|
|
19345
|
-
ops.push('
|
|
19420
|
+
ops.push('+' + curLines[ci]);
|
|
19346
19421
|
pi++;
|
|
19347
19422
|
ci++;
|
|
19348
19423
|
continue;
|
|
19349
19424
|
}
|
|
19350
|
-
this.pushRemovedOps(ops, pi, foundPrev);
|
|
19351
19425
|
ops.push('=' + foundPrev);
|
|
19352
19426
|
pi = foundPrev + 1;
|
|
19353
19427
|
ci++;
|
|
19354
19428
|
}
|
|
19355
|
-
while (pi < prevLines.length) {
|
|
19356
|
-
ops.push('-' + pi);
|
|
19357
|
-
pi++;
|
|
19358
|
-
}
|
|
19359
19429
|
while (ci < curLines.length) {
|
|
19360
19430
|
ops.push('+' + curLines[ci]);
|
|
19361
19431
|
ci++;
|
|
@@ -19383,11 +19453,6 @@ class RichTextEditorComponent extends RichTextEditorAddonHost {
|
|
|
19383
19453
|
ops.push('+' + curLines[i]);
|
|
19384
19454
|
}
|
|
19385
19455
|
}
|
|
19386
|
-
pushRemovedOps(ops, start, end) {
|
|
19387
|
-
for (let i = start; i < end; i++) {
|
|
19388
|
-
ops.push('-' + i);
|
|
19389
|
-
}
|
|
19390
|
-
}
|
|
19391
19456
|
applyDelta(base, delta) {
|
|
19392
19457
|
if (!delta)
|
|
19393
19458
|
return base;
|
|
@@ -19446,10 +19511,17 @@ class RichTextEditorComponent extends RichTextEditorAddonHost {
|
|
|
19446
19511
|
this.lastReconstructedHtml = html;
|
|
19447
19512
|
return html;
|
|
19448
19513
|
}
|
|
19514
|
+
/**
|
|
19515
|
+
* Append the current content as a history entry. An entry's delta is
|
|
19516
|
+
* computed against the entry it is appended to (the one at `historyIndex`),
|
|
19517
|
+
* and the redo tail is dropped before that base is trusted: read from the
|
|
19518
|
+
* tail, the base would be a discarded future entry and the delta would
|
|
19519
|
+
* reconstruct on top of the wrong one.
|
|
19520
|
+
*/
|
|
19449
19521
|
pushHistory() {
|
|
19450
19522
|
const currentHtml = this.htmlContent();
|
|
19451
|
-
const lastEntry = this.snapshots.
|
|
19452
|
-
const lastHtml = lastEntry ? this.reconstructHtmlCached(this.
|
|
19523
|
+
const lastEntry = this.snapshots[this.historyIndex];
|
|
19524
|
+
const lastHtml = lastEntry ? this.reconstructHtmlCached(this.historyIndex) : '';
|
|
19453
19525
|
if (lastEntry && lastHtml === currentHtml) {
|
|
19454
19526
|
return;
|
|
19455
19527
|
}
|
|
@@ -19774,6 +19846,10 @@ class RichTextEditorComponent extends RichTextEditorAddonHost {
|
|
|
19774
19846
|
clearTimeout(this.historyDebounceTimer);
|
|
19775
19847
|
this.historyDebounceTimer = null;
|
|
19776
19848
|
}
|
|
19849
|
+
if (this.inputModeRestoreTimer !== null) {
|
|
19850
|
+
clearTimeout(this.inputModeRestoreTimer);
|
|
19851
|
+
this.inputModeRestoreTimer = null;
|
|
19852
|
+
}
|
|
19777
19853
|
this.releaseTableDragListeners();
|
|
19778
19854
|
this.cancelPendingFind();
|
|
19779
19855
|
this.teardownFindOverlay();
|
|
@@ -20744,6 +20820,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
|
|
|
20744
20820
|
}], propDecorators: { class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
20745
20821
|
|
|
20746
20822
|
class DialogContentComponent {
|
|
20823
|
+
static { this.idSeq = 0; }
|
|
20747
20824
|
constructor() {
|
|
20748
20825
|
this.dialog = inject(DIALOG, { optional: true });
|
|
20749
20826
|
this.el = inject(ElementRef);
|
|
@@ -20768,6 +20845,14 @@ class DialogContentComponent {
|
|
|
20768
20845
|
this.t = this.i18n.t;
|
|
20769
20846
|
this.dir = this.i18n.dir;
|
|
20770
20847
|
this.classes = computed(() => cn('fixed z-50 grid w-full max-w-[calc(100vw-2rem)] sm:max-w-lg border bg-background shadow-lg duration-200 sm:rounded-lg', this.class()), ...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
|
|
20848
|
+
/**
|
|
20849
|
+
* `id` of this panel's own title, for `aria-labelledby`; null while it has none. The title is rendered
|
|
20850
|
+
* either from the `title` input or projected as a `<ui-dialog-title>`, so it is found in the DOM after
|
|
20851
|
+
* render and given an id, which covers both modes.
|
|
20852
|
+
*/
|
|
20853
|
+
this.titleId = signal(null, ...(ngDevMode ? [{ debugName: "titleId" }] : /* istanbul ignore next */ []));
|
|
20854
|
+
/** `id` of this panel's own description, for `aria-describedby`; null while it has none. */
|
|
20855
|
+
this.descriptionId = signal(null, ...(ngDevMode ? [{ debugName: "descriptionId" }] : /* istanbul ignore next */ []));
|
|
20771
20856
|
effect(() => {
|
|
20772
20857
|
if (this.dialog?.open()) {
|
|
20773
20858
|
this.previousActiveElement = this.document.activeElement;
|
|
@@ -20777,6 +20862,30 @@ class DialogContentComponent {
|
|
|
20777
20862
|
this.previousActiveElement.focus();
|
|
20778
20863
|
}
|
|
20779
20864
|
});
|
|
20865
|
+
afterRenderEffect(() => {
|
|
20866
|
+
// The inputs are read so a title or description set after the dialog opened is picked up too.
|
|
20867
|
+
this.title();
|
|
20868
|
+
this.description();
|
|
20869
|
+
if (!this.dialog?.open())
|
|
20870
|
+
return;
|
|
20871
|
+
const panel = this.el.nativeElement.querySelector('[data-slot="dialog-content"]');
|
|
20872
|
+
this.titleId.set(panel ? this.ownId(panel, 'dialog-title') : null);
|
|
20873
|
+
this.descriptionId.set(panel ? this.ownId(panel, 'dialog-description') : null);
|
|
20874
|
+
});
|
|
20875
|
+
}
|
|
20876
|
+
/**
|
|
20877
|
+
* The id of the `slot` element that belongs to `panel` itself, giving it one if it has none. A dialog
|
|
20878
|
+
* nested inside this one has a title of its own that this panel must never take as its name, so only
|
|
20879
|
+
* elements whose nearest panel is this one count.
|
|
20880
|
+
*/
|
|
20881
|
+
ownId(panel, slot) {
|
|
20882
|
+
// Array.from, not a spread: a consumer's `lib` may omit dom.iterable (Storybook's does), and a
|
|
20883
|
+
// NodeList is only iterable with it.
|
|
20884
|
+
const own = Array.from(panel.querySelectorAll(`[data-slot="${slot}"]`)).find(el => el.closest('[data-slot="dialog-content"]') === panel);
|
|
20885
|
+
if (!own)
|
|
20886
|
+
return null;
|
|
20887
|
+
own.id ||= `${slot}-${++DialogContentComponent.idSeq}`;
|
|
20888
|
+
return own.id;
|
|
20780
20889
|
}
|
|
20781
20890
|
ngAfterViewInit() {
|
|
20782
20891
|
if (this.dialog?.open()) {
|
|
@@ -20816,7 +20925,7 @@ class DialogContentComponent {
|
|
|
20816
20925
|
trapTabKey(event, this.contentEl);
|
|
20817
20926
|
}
|
|
20818
20927
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: DialogContentComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
20819
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: DialogContentComponent, isStandalone: true, selector: "ui-dialog-content", inputs: { class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, description: { classPropertyName: "description", publicName: "description", isSignal: true, isRequired: false, transformFunction: null }, locale: { classPropertyName: "locale", publicName: "locale", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "contents" }, ngImport: i0, template: "@if (dialog?.open()) {\n <div class=\"fixed inset-0 z-50 flex items-center justify-center\" [attr.dir]=\"dir()\">\n <!-- Overlay -->\n <button\n type=\"button\"\n class=\"fixed inset-0 bg-black/80 animate-in fade-in-0\"\n [attr.data-slot]=\"'dialog-overlay'\"\n [attr.aria-label]=\"t().close\"\n (click)=\"onOverlayClick()\"\n ></button>\n <!-- Content -->\n <div\n #contentEl\n [class]=\"classes()\"\n [attr.data-slot]=\"'dialog-content'\"\n (keydown)=\"onKeydown($event)\"\n tabindex=\"-1\"\n >\n @if (title()) {\n <ui-dialog-header>\n <ui-dialog-title>{{ title() }}</ui-dialog-title>\n @if (description()) {\n <ui-dialog-description>{{ description() }}</ui-dialog-description>\n }\n </ui-dialog-header>\n }\n <ng-content />\n <!-- Close button -->\n <button\n type=\"button\"\n class=\"absolute end-4 top-4 inline-flex items-center justify-center rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none pointer-coarse:end-0.5 pointer-coarse:top-0.5 pointer-coarse:size-11\"\n [attr.aria-label]=\"t().close\"\n (click)=\"close()\"\n >\n <svg class=\"h-4 w-4\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M6 18L18 6M6 6l12 12\" />\n </svg>\n <span class=\"sr-only\">{{ t().close }}</span>\n </button>\n </div>\n </div>\n}\n", styles: [":host{--_d: var(--density-dialog, var(--density, 1))}@layer components{[data-slot=dialog-content]{gap:calc(.75rem * var(--_d));padding:calc(1rem * var(--_d))}@media(min-width:640px){[data-slot=dialog-content]{gap:calc(1rem * var(--_d));padding:calc(1.5rem * var(--_d))}}}\n"], dependencies: [{ kind: "component", type: DialogHeaderComponent, selector: "ui-dialog-header", inputs: ["class"] }, { kind: "component", type: DialogTitleComponent, selector: "ui-dialog-title", inputs: ["class"] }, { kind: "component", type: DialogDescriptionComponent, selector: "ui-dialog-description", inputs: ["class"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
20928
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: DialogContentComponent, isStandalone: true, selector: "ui-dialog-content", inputs: { class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, description: { classPropertyName: "description", publicName: "description", isSignal: true, isRequired: false, transformFunction: null }, locale: { classPropertyName: "locale", publicName: "locale", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "contents" }, ngImport: i0, template: "@if (dialog?.open()) {\n <div class=\"fixed inset-0 z-50 flex items-center justify-center\" [attr.dir]=\"dir()\">\n <!-- Overlay -->\n <button\n type=\"button\"\n class=\"fixed inset-0 bg-black/80 animate-in fade-in-0\"\n [attr.data-slot]=\"'dialog-overlay'\"\n [attr.aria-label]=\"t().close\"\n (click)=\"onOverlayClick()\"\n ></button>\n <!-- Content -->\n <div\n #contentEl\n [class]=\"classes()\"\n role=\"dialog\"\n aria-modal=\"true\"\n [attr.aria-labelledby]=\"titleId()\"\n [attr.aria-describedby]=\"descriptionId()\"\n [attr.data-slot]=\"'dialog-content'\"\n (keydown)=\"onKeydown($event)\"\n tabindex=\"-1\"\n >\n @if (title()) {\n <ui-dialog-header>\n <ui-dialog-title>{{ title() }}</ui-dialog-title>\n @if (description()) {\n <ui-dialog-description>{{ description() }}</ui-dialog-description>\n }\n </ui-dialog-header>\n }\n <ng-content />\n <!-- Close button -->\n <button\n type=\"button\"\n class=\"absolute end-4 top-4 inline-flex items-center justify-center rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none pointer-coarse:end-0.5 pointer-coarse:top-0.5 pointer-coarse:size-11\"\n [attr.aria-label]=\"t().close\"\n (click)=\"close()\"\n >\n <svg class=\"h-4 w-4\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M6 18L18 6M6 6l12 12\" />\n </svg>\n <span class=\"sr-only\">{{ t().close }}</span>\n </button>\n </div>\n </div>\n}\n", styles: [":host{--_d: var(--density-dialog, var(--density, 1))}@layer components{[data-slot=dialog-content]{gap:calc(.75rem * var(--_d));padding:calc(1rem * var(--_d))}@media(min-width:640px){[data-slot=dialog-content]{gap:calc(1rem * var(--_d));padding:calc(1.5rem * var(--_d))}}}\n"], dependencies: [{ kind: "component", type: DialogHeaderComponent, selector: "ui-dialog-header", inputs: ["class"] }, { kind: "component", type: DialogTitleComponent, selector: "ui-dialog-title", inputs: ["class"] }, { kind: "component", type: DialogDescriptionComponent, selector: "ui-dialog-description", inputs: ["class"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
20820
20929
|
}
|
|
20821
20930
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: DialogContentComponent, decorators: [{
|
|
20822
20931
|
type: Component,
|
|
@@ -20824,7 +20933,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
|
|
|
20824
20933
|
DialogHeaderComponent,
|
|
20825
20934
|
DialogTitleComponent,
|
|
20826
20935
|
DialogDescriptionComponent,
|
|
20827
|
-
], host: { class: 'contents' }, template: "@if (dialog?.open()) {\n <div class=\"fixed inset-0 z-50 flex items-center justify-center\" [attr.dir]=\"dir()\">\n <!-- Overlay -->\n <button\n type=\"button\"\n class=\"fixed inset-0 bg-black/80 animate-in fade-in-0\"\n [attr.data-slot]=\"'dialog-overlay'\"\n [attr.aria-label]=\"t().close\"\n (click)=\"onOverlayClick()\"\n ></button>\n <!-- Content -->\n <div\n #contentEl\n [class]=\"classes()\"\n [attr.data-slot]=\"'dialog-content'\"\n (keydown)=\"onKeydown($event)\"\n tabindex=\"-1\"\n >\n @if (title()) {\n <ui-dialog-header>\n <ui-dialog-title>{{ title() }}</ui-dialog-title>\n @if (description()) {\n <ui-dialog-description>{{ description() }}</ui-dialog-description>\n }\n </ui-dialog-header>\n }\n <ng-content />\n <!-- Close button -->\n <button\n type=\"button\"\n class=\"absolute end-4 top-4 inline-flex items-center justify-center rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none pointer-coarse:end-0.5 pointer-coarse:top-0.5 pointer-coarse:size-11\"\n [attr.aria-label]=\"t().close\"\n (click)=\"close()\"\n >\n <svg class=\"h-4 w-4\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M6 18L18 6M6 6l12 12\" />\n </svg>\n <span class=\"sr-only\">{{ t().close }}</span>\n </button>\n </div>\n </div>\n}\n", styles: [":host{--_d: var(--density-dialog, var(--density, 1))}@layer components{[data-slot=dialog-content]{gap:calc(.75rem * var(--_d));padding:calc(1rem * var(--_d))}@media(min-width:640px){[data-slot=dialog-content]{gap:calc(1rem * var(--_d));padding:calc(1.5rem * var(--_d))}}}\n"] }]
|
|
20936
|
+
], host: { class: 'contents' }, template: "@if (dialog?.open()) {\n <div class=\"fixed inset-0 z-50 flex items-center justify-center\" [attr.dir]=\"dir()\">\n <!-- Overlay -->\n <button\n type=\"button\"\n class=\"fixed inset-0 bg-black/80 animate-in fade-in-0\"\n [attr.data-slot]=\"'dialog-overlay'\"\n [attr.aria-label]=\"t().close\"\n (click)=\"onOverlayClick()\"\n ></button>\n <!-- Content -->\n <div\n #contentEl\n [class]=\"classes()\"\n role=\"dialog\"\n aria-modal=\"true\"\n [attr.aria-labelledby]=\"titleId()\"\n [attr.aria-describedby]=\"descriptionId()\"\n [attr.data-slot]=\"'dialog-content'\"\n (keydown)=\"onKeydown($event)\"\n tabindex=\"-1\"\n >\n @if (title()) {\n <ui-dialog-header>\n <ui-dialog-title>{{ title() }}</ui-dialog-title>\n @if (description()) {\n <ui-dialog-description>{{ description() }}</ui-dialog-description>\n }\n </ui-dialog-header>\n }\n <ng-content />\n <!-- Close button -->\n <button\n type=\"button\"\n class=\"absolute end-4 top-4 inline-flex items-center justify-center rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none pointer-coarse:end-0.5 pointer-coarse:top-0.5 pointer-coarse:size-11\"\n [attr.aria-label]=\"t().close\"\n (click)=\"close()\"\n >\n <svg class=\"h-4 w-4\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M6 18L18 6M6 6l12 12\" />\n </svg>\n <span class=\"sr-only\">{{ t().close }}</span>\n </button>\n </div>\n </div>\n}\n", styles: [":host{--_d: var(--density-dialog, var(--density, 1))}@layer components{[data-slot=dialog-content]{gap:calc(.75rem * var(--_d));padding:calc(1rem * var(--_d))}@media(min-width:640px){[data-slot=dialog-content]{gap:calc(1rem * var(--_d));padding:calc(1.5rem * var(--_d))}}}\n"] }]
|
|
20828
20937
|
}], ctorParameters: () => [], propDecorators: { class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], description: [{ type: i0.Input, args: [{ isSignal: true, alias: "description", required: false }] }], locale: [{ type: i0.Input, args: [{ isSignal: true, alias: "locale", required: false }] }] } });
|
|
20829
20938
|
|
|
20830
20939
|
class DialogFooterComponent {
|
|
@@ -20875,8 +20984,10 @@ class UiRippleDirective {
|
|
|
20875
20984
|
return;
|
|
20876
20985
|
const host = this.el.nativeElement;
|
|
20877
20986
|
const rect = host.getBoundingClientRect();
|
|
20878
|
-
|
|
20879
|
-
const
|
|
20987
|
+
// A keyboard-initiated click has no pointer position (detail 0, coords 0,0).
|
|
20988
|
+
const noPointer = event.detail === 0 && event.clientX === 0 && event.clientY === 0;
|
|
20989
|
+
const x = noPointer ? rect.width / 2 : event.clientX - rect.left;
|
|
20990
|
+
const y = noPointer ? rect.height / 2 : event.clientY - rect.top;
|
|
20880
20991
|
const diameter = Math.max(rect.width, rect.height) * 2;
|
|
20881
20992
|
const ripple = this.renderer.createElement('span');
|
|
20882
20993
|
this.renderer.setStyle(ripple, 'position', 'absolute');
|
|
@@ -20993,6 +21104,8 @@ class SpinnerComponent {
|
|
|
20993
21104
|
* rendered instead.
|
|
20994
21105
|
*/
|
|
20995
21106
|
this.variant = input('ring', ...(ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []));
|
|
21107
|
+
/** Accessible name announced by assistive technology (applies to every variant). Set it to say what is loading, or to localize it. */
|
|
21108
|
+
this.label = input('Loading', ...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
20996
21109
|
this.contentWrapper = viewChild('contentWrapper', ...(ngDevMode ? [{ debugName: "contentWrapper" }] : /* istanbul ignore next */ []));
|
|
20997
21110
|
this._hasCustomContent = signal(false, ...(ngDevMode ? [{ debugName: "_hasCustomContent" }] : /* istanbul ignore next */ []));
|
|
20998
21111
|
this.hasCustomContent = this._hasCustomContent.asReadonly();
|
|
@@ -21020,12 +21133,12 @@ class SpinnerComponent {
|
|
|
21020
21133
|
this._hasCustomContent.set((this.contentWrapper()?.nativeElement?.children?.length ?? 0) > 0);
|
|
21021
21134
|
}
|
|
21022
21135
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: SpinnerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
21023
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: SpinnerComponent, isStandalone: true, selector: "ui-spinner", inputs: { class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, customSize: { classPropertyName: "customSize", publicName: "customSize", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "contents" }, viewQueries: [{ propertyName: "contentWrapper", first: true, predicate: ["contentWrapper"], descendants: true, isSignal: true }], ngImport: i0, template: "<div #contentWrapper>\n <ng-content />\n</div>\n@if (!hasCustomContent()) {\n @if (variant() === 'ring') {\n <output class=\"inline-flex\" aria-label=\"
|
|
21136
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: SpinnerComponent, isStandalone: true, selector: "ui-spinner", inputs: { class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, customSize: { classPropertyName: "customSize", publicName: "customSize", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "contents" }, viewQueries: [{ propertyName: "contentWrapper", first: true, predicate: ["contentWrapper"], descendants: true, isSignal: true }], ngImport: i0, template: "<div #contentWrapper>\n <ng-content />\n</div>\n@if (!hasCustomContent()) {\n @if (variant() === 'ring') {\n <output class=\"inline-flex\" [attr.aria-label]=\"label()\" [attr.data-slot]=\"'spinner'\">\n <svg\n [class]=\"classes()\"\n [style]=\"customStyles()\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"M21 12a9 9 0 1 1-6.219-8.56\"/>\n </svg>\n </output>\n } @else if (variant() === 'dots') {\n <output class=\"flex items-center gap-1\" [attr.aria-label]=\"label()\" [attr.data-slot]=\"'spinner'\">\n <div [class]=\"cn(dotClass(), 'rounded-full bg-current animate-bounce [animation-delay:-0.3s]')\"></div>\n <div [class]=\"cn(dotClass(), 'rounded-full bg-current animate-bounce [animation-delay:-0.15s]')\"></div>\n <div [class]=\"cn(dotClass(), 'rounded-full bg-current animate-bounce')\"></div>\n </output>\n } @else if (variant() === 'bars') {\n <output class=\"flex items-center gap-0.5\" [attr.aria-label]=\"label()\" [attr.data-slot]=\"'spinner'\">\n @for (delay of barDelays; track delay) {\n <div\n [class]=\"cn(barClass(), 'bg-current rounded-sm animate-pulse')\"\n [style.animation-delay]=\"delay\"\n ></div>\n }\n </output>\n } @else if (variant() === 'pulse') {\n <output\n [class]=\"cn(pulseClass(), 'block rounded-full bg-current animate-pulse')\"\n [attr.aria-label]=\"label()\"\n [attr.data-slot]=\"'spinner'\"\n ></output>\n }\n}\n", changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
21024
21137
|
}
|
|
21025
21138
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: SpinnerComponent, decorators: [{
|
|
21026
21139
|
type: Component,
|
|
21027
|
-
args: [{ selector: 'ui-spinner', changeDetection: ChangeDetectionStrategy.OnPush, host: { class: 'contents' }, template: "<div #contentWrapper>\n <ng-content />\n</div>\n@if (!hasCustomContent()) {\n @if (variant() === 'ring') {\n <output class=\"inline-flex\" aria-label=\"
|
|
21028
|
-
}], propDecorators: { class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], customSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "customSize", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], contentWrapper: [{ type: i0.ViewChild, args: ['contentWrapper', { isSignal: true }] }] } });
|
|
21140
|
+
args: [{ selector: 'ui-spinner', changeDetection: ChangeDetectionStrategy.OnPush, host: { class: 'contents' }, template: "<div #contentWrapper>\n <ng-content />\n</div>\n@if (!hasCustomContent()) {\n @if (variant() === 'ring') {\n <output class=\"inline-flex\" [attr.aria-label]=\"label()\" [attr.data-slot]=\"'spinner'\">\n <svg\n [class]=\"classes()\"\n [style]=\"customStyles()\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"M21 12a9 9 0 1 1-6.219-8.56\"/>\n </svg>\n </output>\n } @else if (variant() === 'dots') {\n <output class=\"flex items-center gap-1\" [attr.aria-label]=\"label()\" [attr.data-slot]=\"'spinner'\">\n <div [class]=\"cn(dotClass(), 'rounded-full bg-current animate-bounce [animation-delay:-0.3s]')\"></div>\n <div [class]=\"cn(dotClass(), 'rounded-full bg-current animate-bounce [animation-delay:-0.15s]')\"></div>\n <div [class]=\"cn(dotClass(), 'rounded-full bg-current animate-bounce')\"></div>\n </output>\n } @else if (variant() === 'bars') {\n <output class=\"flex items-center gap-0.5\" [attr.aria-label]=\"label()\" [attr.data-slot]=\"'spinner'\">\n @for (delay of barDelays; track delay) {\n <div\n [class]=\"cn(barClass(), 'bg-current rounded-sm animate-pulse')\"\n [style.animation-delay]=\"delay\"\n ></div>\n }\n </output>\n } @else if (variant() === 'pulse') {\n <output\n [class]=\"cn(pulseClass(), 'block rounded-full bg-current animate-pulse')\"\n [attr.aria-label]=\"label()\"\n [attr.data-slot]=\"'spinner'\"\n ></output>\n }\n}\n" }]
|
|
21141
|
+
}], propDecorators: { class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], customSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "customSize", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], contentWrapper: [{ type: i0.ViewChild, args: ['contentWrapper', { isSignal: true }] }] } });
|
|
21029
21142
|
|
|
21030
21143
|
/**
|
|
21031
21144
|
* PageSpinner - Full page loading overlay
|
|
@@ -21047,7 +21160,7 @@ class PageSpinnerComponent {
|
|
|
21047
21160
|
this.classes = computed(() => cn('fixed inset-0 z-50 flex items-center justify-center bg-background/80 backdrop-blur-sm', this.class()), ...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
|
|
21048
21161
|
}
|
|
21049
21162
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: PageSpinnerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
21050
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: PageSpinnerComponent, isStandalone: true, selector: "ui-page-spinner", inputs: { class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, message: { classPropertyName: "message", publicName: "message", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "contents" }, ngImport: i0, template: "<div [class]=\"classes()\" [attr.data-slot]=\"'page-spinner'\">\n <div class=\"flex flex-col items-center gap-4\">\n <ui-spinner size=\"page\" />\n @if (message()) {\n <p class=\"text-sm text-muted-foreground animate-pulse motion-reduce:animate-none\">{{ message() }}</p>\n }\n </div>\n</div>\n", dependencies: [{ kind: "component", type: SpinnerComponent, selector: "ui-spinner", inputs: ["class", "size", "customSize", "variant"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
21163
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: PageSpinnerComponent, isStandalone: true, selector: "ui-page-spinner", inputs: { class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, message: { classPropertyName: "message", publicName: "message", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "contents" }, ngImport: i0, template: "<div [class]=\"classes()\" [attr.data-slot]=\"'page-spinner'\">\n <div class=\"flex flex-col items-center gap-4\">\n <ui-spinner size=\"page\" />\n @if (message()) {\n <p class=\"text-sm text-muted-foreground animate-pulse motion-reduce:animate-none\">{{ message() }}</p>\n }\n </div>\n</div>\n", dependencies: [{ kind: "component", type: SpinnerComponent, selector: "ui-spinner", inputs: ["class", "size", "customSize", "variant", "label"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
21051
21164
|
}
|
|
21052
21165
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: PageSpinnerComponent, decorators: [{
|
|
21053
21166
|
type: Component,
|
|
@@ -21069,7 +21182,7 @@ class SkeletonComponent {
|
|
|
21069
21182
|
* entirely under `prefers-reduced-motion: reduce`.
|
|
21070
21183
|
*/
|
|
21071
21184
|
this.variant = input('pulse', ...(ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []));
|
|
21072
|
-
this.classes = computed(() => cn('rounded-md', this.variant() === 'pulse' && 'animate-pulse bg-primary/10', this.variant() === 'shimmer' && 'animate-shimmer', this.class()), ...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
|
|
21185
|
+
this.classes = computed(() => cn('block rounded-md', this.variant() === 'pulse' && 'animate-pulse bg-primary/10', this.variant() === 'shimmer' && 'animate-shimmer', this.class()), ...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
|
|
21073
21186
|
}
|
|
21074
21187
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: SkeletonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
21075
21188
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.22", type: SkeletonComponent, isStandalone: true, selector: "ui-skeleton", inputs: { class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "classes()", "attr.data-slot": "\"skeleton\"" } }, ngImport: i0, template: ``, isInline: true, styles: [":host.animate-shimmer{background:#f6f7f8;background:linear-gradient(to right,#f6f7f8 8%,#edeef1 18%,#f6f7f8 33%);background-size:800px 104px;animation:shimmer 2s linear infinite forwards}.dark .animate-shimmer{background:#1e293b;background:linear-gradient(to right,#1e293b 8%,#0f172a 18%,#1e293b 33%);background-size:800px 104px}@keyframes shimmer{0%{background-position:-800px 0}to{background-position:800px 0}}@media(prefers-reduced-motion:reduce){:host.animate-shimmer,.animate-shimmer{animation:none}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
@@ -21176,7 +21289,7 @@ class ButtonComponent {
|
|
|
21176
21289
|
this.classes = computed(() => cn(buttonVariants({ variant: this.variant(), size: this.size() }), this.loading() && 'relative', this.class()), ...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
|
|
21177
21290
|
}
|
|
21178
21291
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: ButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
21179
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: ButtonComponent, isStandalone: true, selector: "ui-button", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, ariaExpanded: { classPropertyName: "ariaExpanded", publicName: "aria-expanded", isSignal: true, isRequired: false, transformFunction: null }, ariaPressed: { classPropertyName: "ariaPressed", publicName: "aria-pressed", isSignal: true, isRequired: false, transformFunction: null }, ariaHaspopup: { classPropertyName: "ariaHaspopup", publicName: "aria-haspopup", isSignal: true, isRequired: false, transformFunction: null }, ariaControls: { classPropertyName: "ariaControls", publicName: "aria-controls", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, ripple: { classPropertyName: "ripple", publicName: "ripple", isSignal: true, isRequired: false, transformFunction: null }, rippleColor: { classPropertyName: "rippleColor", publicName: "rippleColor", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, skeleton: { classPropertyName: "skeleton", publicName: "skeleton", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { clicked: "clicked" }, host: { properties: { "class": "\"contents\"", "attr.data-size": "size()", "attr.aria-label": "null", "attr.aria-expanded": "null", "attr.aria-pressed": "null", "attr.aria-controls": "null", "attr.aria-haspopup": "null" } }, ngImport: i0, template: "@if (skeleton()) {\n <ui-skeleton class=\"h-9 w-24 rounded-md\" />\n} @else {\n <button\n uiRipple\n [uiRippleDisabled]=\"!ripple()\"\n [uiRippleColor]=\"rippleColor()\"\n [class]=\"classes()\"\n [disabled]=\"disabled() || loading()\"\n [type]=\"type()\"\n [attr.data-slot]=\"'button'\"\n [attr.aria-label]=\"resolvedAriaLabel()\"\n [attr.aria-expanded]=\"ariaExpanded() ?? null\"\n [attr.aria-pressed]=\"ariaPressed() ?? null\"\n [attr.aria-controls]=\"ariaControls() || null\"\n [attr.aria-haspopup]=\"ariaHaspopup() ?? null\"\n (click)=\"clicked.emit($event)\"\n >\n @if (loading()) {\n <div class=\"absolute inset-0 flex items-center justify-center\" aria-hidden=\"true\">\n <ui-spinner size=\"xs\" />\n </div>\n }\n @if (label()) {\n {{ label() }}\n } @else {\n <ng-content />\n }\n </button>\n}\n", styles: [":host{--_d: var(--density-button, var(--density, 1))}@layer components{[data-slot=button]{height:calc(2.25rem * var(--_d));padding-inline:calc(1rem * var(--_d))}:host([data-size=\"sm\"]) [data-slot=button]{height:calc(2rem * var(--_d));padding-inline:calc(.75rem * var(--_d))}:host([data-size=\"lg\"]) [data-slot=button]{height:calc(2.5rem * var(--_d));padding-inline:calc(2rem * var(--_d))}:host([data-size=\"icon\"]) [data-slot=button]{height:calc(2.25rem * var(--_d));width:calc(2.25rem * var(--_d));padding:0}:host([data-size=\"icon-sm\"]) [data-slot=button]{height:calc(2rem * var(--_d));width:calc(2rem * var(--_d));padding:0}:host([data-size=\"icon-lg\"]) [data-slot=button]{height:calc(2.5rem * var(--_d));width:calc(2.5rem * var(--_d));padding:0}}\n"], dependencies: [{ kind: "directive", type: UiRippleDirective, selector: "[uiRipple]", inputs: ["uiRippleColor", "uiRippleDuration", "uiRippleDisabled"] }, { kind: "component", type: SpinnerComponent, selector: "ui-spinner", inputs: ["class", "size", "customSize", "variant"] }, { kind: "component", type: SkeletonComponent, selector: "ui-skeleton", inputs: ["class", "variant"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
21292
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: ButtonComponent, isStandalone: true, selector: "ui-button", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, ariaExpanded: { classPropertyName: "ariaExpanded", publicName: "aria-expanded", isSignal: true, isRequired: false, transformFunction: null }, ariaPressed: { classPropertyName: "ariaPressed", publicName: "aria-pressed", isSignal: true, isRequired: false, transformFunction: null }, ariaHaspopup: { classPropertyName: "ariaHaspopup", publicName: "aria-haspopup", isSignal: true, isRequired: false, transformFunction: null }, ariaControls: { classPropertyName: "ariaControls", publicName: "aria-controls", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, ripple: { classPropertyName: "ripple", publicName: "ripple", isSignal: true, isRequired: false, transformFunction: null }, rippleColor: { classPropertyName: "rippleColor", publicName: "rippleColor", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, skeleton: { classPropertyName: "skeleton", publicName: "skeleton", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { clicked: "clicked" }, host: { properties: { "class": "\"contents\"", "attr.data-size": "size()", "attr.aria-label": "null", "attr.aria-expanded": "null", "attr.aria-pressed": "null", "attr.aria-controls": "null", "attr.aria-haspopup": "null" } }, ngImport: i0, template: "@if (skeleton()) {\n <ui-skeleton class=\"h-9 w-24 rounded-md\" />\n} @else {\n <button\n uiRipple\n [uiRippleDisabled]=\"!ripple()\"\n [uiRippleColor]=\"rippleColor()\"\n [class]=\"classes()\"\n [disabled]=\"disabled() || loading()\"\n [type]=\"type()\"\n [attr.data-slot]=\"'button'\"\n [attr.aria-label]=\"resolvedAriaLabel()\"\n [attr.aria-expanded]=\"ariaExpanded() ?? null\"\n [attr.aria-pressed]=\"ariaPressed() ?? null\"\n [attr.aria-controls]=\"ariaControls() || null\"\n [attr.aria-haspopup]=\"ariaHaspopup() ?? null\"\n (click)=\"clicked.emit($event)\"\n >\n @if (loading()) {\n <div class=\"absolute inset-0 flex items-center justify-center\" aria-hidden=\"true\">\n <ui-spinner size=\"xs\" />\n </div>\n }\n @if (label()) {\n {{ label() }}\n } @else {\n <ng-content />\n }\n </button>\n}\n", styles: [":host{--_d: var(--density-button, var(--density, 1))}@layer components{[data-slot=button]{height:calc(2.25rem * var(--_d));padding-inline:calc(1rem * var(--_d))}:host([data-size=\"sm\"]) [data-slot=button]{height:calc(2rem * var(--_d));padding-inline:calc(.75rem * var(--_d))}:host([data-size=\"lg\"]) [data-slot=button]{height:calc(2.5rem * var(--_d));padding-inline:calc(2rem * var(--_d))}:host([data-size=\"icon\"]) [data-slot=button]{height:calc(2.25rem * var(--_d));width:calc(2.25rem * var(--_d));padding:0}:host([data-size=\"icon-sm\"]) [data-slot=button]{height:calc(2rem * var(--_d));width:calc(2rem * var(--_d));padding:0}:host([data-size=\"icon-lg\"]) [data-slot=button]{height:calc(2.5rem * var(--_d));width:calc(2.5rem * var(--_d));padding:0}}\n"], dependencies: [{ kind: "directive", type: UiRippleDirective, selector: "[uiRipple]", inputs: ["uiRippleColor", "uiRippleDuration", "uiRippleDisabled"] }, { kind: "component", type: SpinnerComponent, selector: "ui-spinner", inputs: ["class", "size", "customSize", "variant", "label"] }, { kind: "component", type: SkeletonComponent, selector: "ui-skeleton", inputs: ["class", "variant"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
21180
21293
|
}
|
|
21181
21294
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: ButtonComponent, decorators: [{
|
|
21182
21295
|
type: Component,
|
|
@@ -21577,7 +21690,14 @@ class AlertDialogContentComponent {
|
|
|
21577
21690
|
this.actionClick = output();
|
|
21578
21691
|
/** The cancel button was pressed. Same simple-mode-only rules as {@link actionClick}. */
|
|
21579
21692
|
this.cancelClick = output();
|
|
21580
|
-
this.classes = computed(() => cn('fixed z-50 grid w-full max-w-[calc(100vw-2rem)] sm:max-w-lg
|
|
21693
|
+
this.classes = computed(() => cn('fixed z-50 grid w-full max-w-[calc(100vw-2rem)] sm:max-w-lg border bg-background shadow-lg duration-200 sm:rounded-lg', this.class()), ...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
|
|
21694
|
+
/**
|
|
21695
|
+
* The two places a title can come from: the one this component renders for the `title` input, and one the
|
|
21696
|
+
* author projects. Read by the naming effect so it runs again when either appears, which a title rendered
|
|
21697
|
+
* after the dialog opened (behind an `@if`, say) otherwise never triggers.
|
|
21698
|
+
*/
|
|
21699
|
+
this.ownTitle = viewChild(AlertDialogTitleComponent, ...(ngDevMode ? [{ debugName: "ownTitle" }] : /* istanbul ignore next */ []));
|
|
21700
|
+
this.projectedTitle = contentChild(AlertDialogTitleComponent, ...(ngDevMode ? [{ debugName: "projectedTitle" }] : /* istanbul ignore next */ []));
|
|
21581
21701
|
effect(() => {
|
|
21582
21702
|
if (this.alertDialog?.open()) {
|
|
21583
21703
|
this.previousActiveElement = this.document.activeElement;
|
|
@@ -21590,6 +21710,8 @@ class AlertDialogContentComponent {
|
|
|
21590
21710
|
afterRenderEffect(() => {
|
|
21591
21711
|
if (!this.alertDialog?.open())
|
|
21592
21712
|
return;
|
|
21713
|
+
this.ownTitle();
|
|
21714
|
+
this.projectedTitle();
|
|
21593
21715
|
const host = this.el.nativeElement;
|
|
21594
21716
|
const titleEl = host.querySelector('[data-slot="alert-dialog-title"]');
|
|
21595
21717
|
if (!titleEl)
|
|
@@ -21622,7 +21744,7 @@ class AlertDialogContentComponent {
|
|
|
21622
21744
|
trapTabKey(event, this.contentEl);
|
|
21623
21745
|
}
|
|
21624
21746
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: AlertDialogContentComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
21625
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: AlertDialogContentComponent, isStandalone: true, selector: "ui-alert-dialog-content", inputs: { class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, description: { classPropertyName: "description", publicName: "description", isSignal: true, isRequired: false, transformFunction: null }, actionText: { classPropertyName: "actionText", publicName: "actionText", isSignal: true, isRequired: false, transformFunction: null }, cancelText: { classPropertyName: "cancelText", publicName: "cancelText", isSignal: true, isRequired: false, transformFunction: null }, locale: { classPropertyName: "locale", publicName: "locale", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { actionClick: "actionClick", cancelClick: "cancelClick" }, host: { classAttribute: "contents" }, ngImport: i0, template: `
|
|
21747
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: AlertDialogContentComponent, isStandalone: true, selector: "ui-alert-dialog-content", inputs: { class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, description: { classPropertyName: "description", publicName: "description", isSignal: true, isRequired: false, transformFunction: null }, actionText: { classPropertyName: "actionText", publicName: "actionText", isSignal: true, isRequired: false, transformFunction: null }, cancelText: { classPropertyName: "cancelText", publicName: "cancelText", isSignal: true, isRequired: false, transformFunction: null }, locale: { classPropertyName: "locale", publicName: "locale", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { actionClick: "actionClick", cancelClick: "cancelClick" }, host: { classAttribute: "contents" }, queries: [{ propertyName: "projectedTitle", first: true, predicate: AlertDialogTitleComponent, descendants: true, isSignal: true }], viewQueries: [{ propertyName: "ownTitle", first: true, predicate: AlertDialogTitleComponent, descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
21626
21748
|
@if (alertDialog?.open()) {
|
|
21627
21749
|
<div
|
|
21628
21750
|
class="fixed inset-0 z-50 flex items-center justify-center"
|
|
@@ -21659,22 +21781,18 @@ class AlertDialogContentComponent {
|
|
|
21659
21781
|
</div>
|
|
21660
21782
|
</div>
|
|
21661
21783
|
}
|
|
21662
|
-
`, isInline: true, dependencies: [{ kind: "component", type: AlertDialogHeaderComponent, selector: "ui-alert-dialog-header", inputs: ["class"] }, { kind: "component", type: AlertDialogTitleComponent, selector: "ui-alert-dialog-title", inputs: ["class"] }, { kind: "component", type: AlertDialogDescriptionComponent, selector: "ui-alert-dialog-description", inputs: ["class"] }, { kind: "component", type: AlertDialogFooterComponent, selector: "ui-alert-dialog-footer", inputs: ["class"] }, { kind: "component", type: AlertDialogActionComponent, selector: "ui-alert-dialog-action", inputs: ["class"] }, { kind: "component", type: AlertDialogCancelComponent, selector: "ui-alert-dialog-cancel", inputs: ["class"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
21784
|
+
`, isInline: true, styles: [":host{--_d: var(--density-alert-dialog, var(--density, 1))}@layer components{[data-slot=alert-dialog-content]{gap:calc(.75rem * var(--_d));padding:calc(1rem * var(--_d))}@media(min-width:640px){[data-slot=alert-dialog-content]{gap:calc(1rem * var(--_d));padding:calc(1.5rem * var(--_d))}}}\n"], dependencies: [{ kind: "component", type: AlertDialogHeaderComponent, selector: "ui-alert-dialog-header", inputs: ["class"] }, { kind: "component", type: AlertDialogTitleComponent, selector: "ui-alert-dialog-title", inputs: ["class"] }, { kind: "component", type: AlertDialogDescriptionComponent, selector: "ui-alert-dialog-description", inputs: ["class"] }, { kind: "component", type: AlertDialogFooterComponent, selector: "ui-alert-dialog-footer", inputs: ["class"] }, { kind: "component", type: AlertDialogActionComponent, selector: "ui-alert-dialog-action", inputs: ["class"] }, { kind: "component", type: AlertDialogCancelComponent, selector: "ui-alert-dialog-cancel", inputs: ["class"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
21663
21785
|
}
|
|
21664
21786
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: AlertDialogContentComponent, decorators: [{
|
|
21665
21787
|
type: Component,
|
|
21666
|
-
args: [{
|
|
21667
|
-
selector: 'ui-alert-dialog-content',
|
|
21668
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
21669
|
-
imports: [
|
|
21788
|
+
args: [{ selector: 'ui-alert-dialog-content', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
|
|
21670
21789
|
AlertDialogHeaderComponent,
|
|
21671
21790
|
AlertDialogTitleComponent,
|
|
21672
21791
|
AlertDialogDescriptionComponent,
|
|
21673
21792
|
AlertDialogFooterComponent,
|
|
21674
21793
|
AlertDialogActionComponent,
|
|
21675
21794
|
AlertDialogCancelComponent,
|
|
21676
|
-
],
|
|
21677
|
-
template: `
|
|
21795
|
+
], template: `
|
|
21678
21796
|
@if (alertDialog?.open()) {
|
|
21679
21797
|
<div
|
|
21680
21798
|
class="fixed inset-0 z-50 flex items-center justify-center"
|
|
@@ -21711,10 +21829,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
|
|
|
21711
21829
|
</div>
|
|
21712
21830
|
</div>
|
|
21713
21831
|
}
|
|
21714
|
-
`,
|
|
21715
|
-
|
|
21716
|
-
}]
|
|
21717
|
-
}], ctorParameters: () => [], propDecorators: { class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], description: [{ type: i0.Input, args: [{ isSignal: true, alias: "description", required: false }] }], actionText: [{ type: i0.Input, args: [{ isSignal: true, alias: "actionText", required: false }] }], cancelText: [{ type: i0.Input, args: [{ isSignal: true, alias: "cancelText", required: false }] }], locale: [{ type: i0.Input, args: [{ isSignal: true, alias: "locale", required: false }] }], actionClick: [{ type: i0.Output, args: ["actionClick"] }], cancelClick: [{ type: i0.Output, args: ["cancelClick"] }] } });
|
|
21832
|
+
`, host: { class: 'contents' }, styles: [":host{--_d: var(--density-alert-dialog, var(--density, 1))}@layer components{[data-slot=alert-dialog-content]{gap:calc(.75rem * var(--_d));padding:calc(1rem * var(--_d))}@media(min-width:640px){[data-slot=alert-dialog-content]{gap:calc(1rem * var(--_d));padding:calc(1.5rem * var(--_d))}}}\n"] }]
|
|
21833
|
+
}], ctorParameters: () => [], propDecorators: { class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], description: [{ type: i0.Input, args: [{ isSignal: true, alias: "description", required: false }] }], actionText: [{ type: i0.Input, args: [{ isSignal: true, alias: "actionText", required: false }] }], cancelText: [{ type: i0.Input, args: [{ isSignal: true, alias: "cancelText", required: false }] }], locale: [{ type: i0.Input, args: [{ isSignal: true, alias: "locale", required: false }] }], actionClick: [{ type: i0.Output, args: ["actionClick"] }], cancelClick: [{ type: i0.Output, args: ["cancelClick"] }], ownTitle: [{ type: i0.ViewChild, args: [i0.forwardRef(() => AlertDialogTitleComponent), { isSignal: true }] }], projectedTitle: [{ type: i0.ContentChild, args: [i0.forwardRef(() => AlertDialogTitleComponent), { isSignal: true }] }] } });
|
|
21718
21834
|
|
|
21719
21835
|
class ConfirmDialogComponent {
|
|
21720
21836
|
/**
|
|
@@ -23006,7 +23122,9 @@ function paramsFor(el, trigger) {
|
|
|
23006
23122
|
return readActions(el).find((a) => a.trigger === trigger)?.params ?? {};
|
|
23007
23123
|
}
|
|
23008
23124
|
function deliver(options, event) {
|
|
23009
|
-
|
|
23125
|
+
// The id comes from untrusted content: only the app's own handlers may run, never inherited names like __proto__ or constructor.
|
|
23126
|
+
if (Object.hasOwn(options.handlers, event.actionId))
|
|
23127
|
+
options.handlers[event.actionId]?.(event);
|
|
23010
23128
|
options.handlers['*']?.(event);
|
|
23011
23129
|
}
|
|
23012
23130
|
function emit(options, el, attr, trigger, domEvent, phase) {
|
|
@@ -24966,6 +25084,7 @@ class PopoverContentComponent {
|
|
|
24966
25084
|
this.popover = inject(POPOVER, { optional: true });
|
|
24967
25085
|
this.document = inject(DOCUMENT);
|
|
24968
25086
|
this.hostEl = inject(ElementRef);
|
|
25087
|
+
this.cdr = inject(ChangeDetectorRef);
|
|
24969
25088
|
/** Extra classes merged onto the panel. Keep a width constraint viewport-aware (`max-w-[calc(100vw-2rem)]`), since the panel is positioned, not laid out by its parent. */
|
|
24970
25089
|
this.class = input('', ...(ngDevMode ? [{ debugName: "class" }] : /* istanbul ignore next */ []));
|
|
24971
25090
|
/** Alignment along the chosen {@link side}'s edge: `'start'`, `'center'` or `'end'`. May be flipped at runtime when {@link avoidCollisions} is on. */
|
|
@@ -25006,15 +25125,24 @@ class PopoverContentComponent {
|
|
|
25006
25125
|
*/
|
|
25007
25126
|
this.triggerRectSig = signal(null, ...(ngDevMode ? [{ debugName: "triggerRectSig" }] : /* istanbul ignore next */ []));
|
|
25008
25127
|
this.adjustedPosition = signal({ side: 'bottom', align: 'center', offsetX: 0, offsetY: 0 }, ...(ngDevMode ? [{ debugName: "adjustedPosition" }] : /* istanbul ignore next */ []));
|
|
25128
|
+
/**
|
|
25129
|
+
* Width of the trigger, exposed to the content as `--trigger-width` so a
|
|
25130
|
+
* panel can match it (`class="w-(--trigger-width)"`). Re-read on every
|
|
25131
|
+
* open, as the trigger can resize between opens.
|
|
25132
|
+
*/
|
|
25133
|
+
this.triggerWidth = computed(() => {
|
|
25134
|
+
if (!this.popover?.open())
|
|
25135
|
+
return null;
|
|
25136
|
+
const rect = this.triggerRectSig() ?? this.popover.getTriggerRect();
|
|
25137
|
+
return rect ? `${rect.width}px` : null;
|
|
25138
|
+
}, ...(ngDevMode ? [{ debugName: "triggerWidth" }] : /* istanbul ignore next */ []));
|
|
25009
25139
|
this.positionStyles = computed(() => {
|
|
25010
25140
|
const pos = this.adjustedPosition();
|
|
25011
25141
|
if (this.strategy() === 'fixed') {
|
|
25012
25142
|
return this.computeFixedStyles(pos);
|
|
25013
25143
|
}
|
|
25014
|
-
|
|
25015
|
-
|
|
25016
|
-
}
|
|
25017
|
-
return '';
|
|
25144
|
+
const offset = `--popover-offset:${this.sideOffset()}px;`;
|
|
25145
|
+
return pos.offsetX === 0 ? offset : `${offset}transform: translateX(${pos.offsetX}px);`;
|
|
25018
25146
|
}, ...(ngDevMode ? [{ debugName: "positionStyles" }] : /* istanbul ignore next */ []));
|
|
25019
25147
|
this.classes = computed(() => {
|
|
25020
25148
|
const pos = this.adjustedPosition();
|
|
@@ -25026,10 +25154,10 @@ class PopoverContentComponent {
|
|
|
25026
25154
|
end: 'right-0',
|
|
25027
25155
|
};
|
|
25028
25156
|
const sideClasses = {
|
|
25029
|
-
top: 'bottom-full mb-
|
|
25030
|
-
bottom: 'top-full mt-
|
|
25031
|
-
left: 'right-full me-
|
|
25032
|
-
right: 'left-full ms-
|
|
25157
|
+
top: 'bottom-full mb-[var(--popover-offset,4px)]',
|
|
25158
|
+
bottom: 'top-full mt-[var(--popover-offset,4px)]',
|
|
25159
|
+
left: 'right-full me-[var(--popover-offset,4px)] top-0',
|
|
25160
|
+
right: 'left-full ms-[var(--popover-offset,4px)] top-0',
|
|
25033
25161
|
};
|
|
25034
25162
|
const isFixed = this.strategy() === 'fixed';
|
|
25035
25163
|
return cn(isFixed ? 'z-50 w-72 max-w-[calc(100vw-16px)] rounded-md border bg-popover text-popover-foreground shadow-md outline-none' :
|
|
@@ -25230,21 +25358,48 @@ class PopoverContentComponent {
|
|
|
25230
25358
|
}
|
|
25231
25359
|
this.adjustCollisionPosition(this.contentEl.nativeElement);
|
|
25232
25360
|
}
|
|
25361
|
+
/**
|
|
25362
|
+
* Invariant: with `avoidCollisions` on, a fixed top/bottom panel never sits over its trigger
|
|
25363
|
+
* when the opposite side has more room. The absolute strategy flips through
|
|
25364
|
+
* `adjustCollisionPosition`; here the clamp below would otherwise pin an overflowing panel to
|
|
25365
|
+
* the viewport edge on top of the trigger. Flips when the opposite side fits the panel, or —
|
|
25366
|
+
* when neither fits — when it is simply the roomier one; the clamp then trims what is left.
|
|
25367
|
+
* Returns whether the side changed (the styles are re-rendered, so the caller re-measures).
|
|
25368
|
+
*/
|
|
25369
|
+
flipFixedSide(rect, vh) {
|
|
25370
|
+
const side = this.adjustedPosition().side;
|
|
25371
|
+
if (!this.avoidCollisions() || (side !== 'top' && side !== 'bottom'))
|
|
25372
|
+
return false;
|
|
25373
|
+
const overflows = side === 'top' ? rect.top < 0 : rect.bottom > vh;
|
|
25374
|
+
const triggerRect = this.popover?.getTriggerRect();
|
|
25375
|
+
if (!overflows || !triggerRect)
|
|
25376
|
+
return false;
|
|
25377
|
+
const boundary = { top: 0, bottom: vh };
|
|
25378
|
+
const opposite = side === 'top' ? 'bottom' : 'top';
|
|
25379
|
+
const roomThere = this.getAvailableSpace(opposite, triggerRect, boundary);
|
|
25380
|
+
const roomHere = this.getAvailableSpace(side, triggerRect, boundary);
|
|
25381
|
+
if (roomThere < rect.height + this.sideOffset() && roomThere <= roomHere)
|
|
25382
|
+
return false;
|
|
25383
|
+
this.adjustedPosition.update(pos => ({ ...pos, side: opposite }));
|
|
25384
|
+
this.cdr.detectChanges();
|
|
25385
|
+
return true;
|
|
25386
|
+
}
|
|
25233
25387
|
adjustFixedPosition(el) {
|
|
25234
|
-
|
|
25388
|
+
let rect = el.getBoundingClientRect();
|
|
25235
25389
|
const vw = globalThis.window.innerWidth;
|
|
25236
25390
|
const vh = globalThis.window.innerHeight;
|
|
25391
|
+
if (this.flipFixedSide(rect, vh))
|
|
25392
|
+
rect = el.getBoundingClientRect();
|
|
25237
25393
|
const needsHorizontalFix = rect.right > vw || rect.left < 0;
|
|
25238
25394
|
const needsVerticalFix = rect.bottom > vh || rect.top < 0;
|
|
25239
|
-
if (needsHorizontalFix)
|
|
25240
|
-
|
|
25241
|
-
|
|
25242
|
-
|
|
25243
|
-
|
|
25244
|
-
|
|
25245
|
-
|
|
25246
|
-
|
|
25247
|
-
}
|
|
25395
|
+
if (!needsHorizontalFix && !needsVerticalFix)
|
|
25396
|
+
return;
|
|
25397
|
+
// The measured rect already includes the placement transform (translateX/Y(-50%|-100%)),
|
|
25398
|
+
// so pin both axes from it and drop the transform; fixing one axis alone would leave the
|
|
25399
|
+
// other shifted by the transform that is being removed.
|
|
25400
|
+
el.style.left = `${Math.max(8, Math.min(rect.left, vw - rect.width - 8))}px`;
|
|
25401
|
+
el.style.top = `${Math.max(8, Math.min(rect.top, vh - rect.height - 8))}px`;
|
|
25402
|
+
el.style.transform = 'none';
|
|
25248
25403
|
}
|
|
25249
25404
|
adjustCollisionPosition(content) {
|
|
25250
25405
|
const contentRect = content.getBoundingClientRect();
|
|
@@ -25303,21 +25458,37 @@ class PopoverContentComponent {
|
|
|
25303
25458
|
return '';
|
|
25304
25459
|
const currentSide = this.avoidCollisions() ? pos.side : this.side();
|
|
25305
25460
|
const currentAlign = this.avoidCollisions() ? pos.align : this.align();
|
|
25306
|
-
const top
|
|
25307
|
-
|
|
25308
|
-
left = Math.max(8, Math.min(left, globalThis.window.innerWidth - 8));
|
|
25461
|
+
const { top, left, transform } = this.computeFixedAnchor(currentSide, currentAlign, triggerRect);
|
|
25462
|
+
const clampedLeft = Math.max(8, Math.min(left, globalThis.window.innerWidth - 8));
|
|
25309
25463
|
const clampedTop = Math.max(8, Math.min(top, globalThis.window.innerHeight - 8));
|
|
25310
25464
|
// `inset:auto;margin:0;overflow:visible` neutralize the UA `[popover]`
|
|
25311
25465
|
// defaults (centered via inset:0 + margin:auto, overflow:auto) so our
|
|
25312
25466
|
// own fixed coordinates and layout apply when promoted to the top layer.
|
|
25313
|
-
|
|
25314
|
-
|
|
25315
|
-
|
|
25316
|
-
|
|
25317
|
-
|
|
25318
|
-
|
|
25467
|
+
return `position:fixed;inset:auto;margin:0;overflow:visible;top:${clampedTop}px;left:${clampedLeft}px;transform:${transform};`;
|
|
25468
|
+
}
|
|
25469
|
+
/**
|
|
25470
|
+
* The panel's anchor point and the transform that pulls the panel's matching edge onto it.
|
|
25471
|
+
* The transform is what lets the panel sit *before* the anchor (above or left of it) without
|
|
25472
|
+
* knowing its own size: `top` places the panel's bottom edge on the point, `left` its right edge.
|
|
25473
|
+
*/
|
|
25474
|
+
computeFixedAnchor(side, align, triggerRect) {
|
|
25475
|
+
const offset = this.sideOffset();
|
|
25476
|
+
const shift = { start: 0, center: -50, end: -100 }[align];
|
|
25477
|
+
if (side === 'top' || side === 'bottom') {
|
|
25478
|
+
const top = side === 'bottom' ? triggerRect.bottom + offset : triggerRect.top - offset;
|
|
25479
|
+
return {
|
|
25480
|
+
top,
|
|
25481
|
+
left: this.computeFixedLeft(align, triggerRect),
|
|
25482
|
+
transform: `translate(${shift}%, ${side === 'top' ? -100 : 0}%)`,
|
|
25483
|
+
};
|
|
25319
25484
|
}
|
|
25320
|
-
|
|
25485
|
+
const crossAxis = { start: triggerRect.top, center: triggerRect.top + triggerRect.height / 2, end: triggerRect.bottom }[align];
|
|
25486
|
+
const isLeft = side === 'left';
|
|
25487
|
+
return {
|
|
25488
|
+
top: crossAxis,
|
|
25489
|
+
left: isLeft ? triggerRect.left - offset : triggerRect.right + offset,
|
|
25490
|
+
transform: `translate(${isLeft ? -100 : 0}%, ${shift}%)`,
|
|
25491
|
+
};
|
|
25321
25492
|
}
|
|
25322
25493
|
computeFixedLeft(align, triggerRect) {
|
|
25323
25494
|
if (align === 'start')
|
|
@@ -25333,6 +25504,7 @@ class PopoverContentComponent {
|
|
|
25333
25504
|
#contentEl
|
|
25334
25505
|
[class]="classes()"
|
|
25335
25506
|
[style]="positionStyles()"
|
|
25507
|
+
[style.--trigger-width]="triggerWidth()"
|
|
25336
25508
|
[style.visibility]="strategy() === 'fixed' && !portalReady() ? 'hidden' : null"
|
|
25337
25509
|
[attr.data-state]="popover?.open() ? 'open' : 'closed'"
|
|
25338
25510
|
[attr.data-slot]="'popover-content'"
|
|
@@ -25350,6 +25522,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
|
|
|
25350
25522
|
#contentEl
|
|
25351
25523
|
[class]="classes()"
|
|
25352
25524
|
[style]="positionStyles()"
|
|
25525
|
+
[style.--trigger-width]="triggerWidth()"
|
|
25353
25526
|
[style.visibility]="strategy() === 'fixed' && !portalReady() ? 'hidden' : null"
|
|
25354
25527
|
[attr.data-state]="popover?.open() ? 'open' : 'closed'"
|
|
25355
25528
|
[attr.data-slot]="'popover-content'"
|
|
@@ -27726,7 +27899,9 @@ class InputComponent {
|
|
|
27726
27899
|
this.labelIsActive = computed(() => this.isFocused() || !!this.value(), ...(ngDevMode ? [{ debugName: "labelIsActive" }] : /* istanbul ignore next */ []));
|
|
27727
27900
|
this.classes = computed(() => cn(inputVariants({ variant: this.effectiveVariant() }), this.class()), ...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
|
|
27728
27901
|
this.containerClasses = computed(() => cn('relative flex w-full items-center rounded-lg border border-input shadow-xs', 'transition-[color,box-shadow]', 'has-[input:focus-visible]:border-ring has-[input:focus-visible]:ring-[3px] has-[input:focus-visible]:ring-ring/50', 'dark:bg-input/30 bg-transparent', this.isDisabled() && 'opacity-50 pointer-events-none cursor-not-allowed', this.class()), ...(ngDevMode ? [{ debugName: "containerClasses" }] : /* istanbul ignore next */ []));
|
|
27729
|
-
this.innerClasses = computed(() => cn(inputVariants({ variant: 'ghost' }), 'flex-1 h-full'
|
|
27902
|
+
this.innerClasses = computed(() => cn(inputVariants({ variant: 'ghost' }), 'flex-1 h-full',
|
|
27903
|
+
// Ghost is flush (px-0); without a prefix the text would sit on the border. `\_` keeps Tailwind from reading `_` as a space, and String.raw keeps the single backslash its class scanner needs in source.
|
|
27904
|
+
!this.prefix() && String.raw `ps-[calc(0.75rem*var(--\_d))]`), ...(ngDevMode ? [{ debugName: "innerClasses" }] : /* istanbul ignore next */ []));
|
|
27730
27905
|
this.floatingLabelClasses = computed(() => cn('pointer-events-none absolute select-none text-muted-foreground transition-all duration-150',
|
|
27731
27906
|
// Resting = uniform placeholder; on float it transforms to the (optionally
|
|
27732
27907
|
// dev-customized via labelClass) heading font.
|
|
@@ -27788,7 +27963,7 @@ class InputComponent {
|
|
|
27788
27963
|
useExisting: forwardRef(() => InputComponent),
|
|
27789
27964
|
multi: true,
|
|
27790
27965
|
},
|
|
27791
|
-
], viewQueries: [{ propertyName: "inputRef", first: true, predicate: ["inputRef"], descendants: true, isSignal: true }], ngImport: i0, template: "@if (skeleton()) {\n <ui-skeleton class=\"h-9 w-full rounded-md\" />\n} @else if (isFloating()) {\n <div class=\"relative\" [attr.data-slot]=\"'input-floating'\" [attr.data-variant]=\"effectiveVariant()\">\n <input\n [class]=\"classes()\"\n [type]=\"type()\"\n [disabled]=\"isDisabled()\"\n [placeholder]=\"labelIsActive() ? placeholder() : ''\"\n [attr.id]=\"resolvedId()\"\n [attr.name]=\"name()\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-labelledby]=\"ariaLabelledby()\"\n [attr.aria-describedby]=\"ariaDescribedby()\"\n [attr.inputmode]=\"inputMode()\"\n [attr.lang]=\"lang()\"\n [attr.data-slot]=\"'input'\"\n #inputRef\n [ngModel]=\"value()\"\n (ngModelChange)=\"onValueChange($event)\"\n (focus)=\"onFocus()\"\n (blur)=\"onBlur()\"\n />\n <label [for]=\"resolvedId()\" [class]=\"floatingLabelClasses()\" [attr.data-active]=\"labelIsActive() ? '' : null\">{{ label() }}</label>\n </div>\n} @else if (needsContainer()) {\n <div [class]=\"containerClasses()\" [attr.data-slot]=\"'input-container'\">\n @if (prefix()) {\n <span class=\"text-muted-foreground flex shrink-0 items-center ps-3 pe-1 text-sm select-none\">{{ prefix() }}</span>\n }\n <input\n [class]=\"innerClasses()\"\n [type]=\"type()\"\n [disabled]=\"isDisabled()\"\n [placeholder]=\"placeholder()\"\n [attr.id]=\"resolvedId()\"\n [attr.name]=\"name()\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-labelledby]=\"ariaLabelledby()\"\n [attr.aria-describedby]=\"ariaDescribedby()\"\n [attr.inputmode]=\"inputMode()\"\n [attr.lang]=\"lang()\"\n [attr.data-slot]=\"'input'\"\n #inputRef\n [ngModel]=\"value()\"\n (ngModelChange)=\"onValueChange($event)\"\n (focus)=\"onFocus()\"\n (blur)=\"onBlur()\"\n />\n @if (clearable() && value()) {\n <button\n type=\"button\"\n (click)=\"clearValue()\"\n tabindex=\"-1\"\n class=\"flex shrink-0 items-center justify-center pe-2 text-muted-foreground hover:text-foreground\"\n aria-label=\"Clear\"\n >\n <ui-icon name=\"x\" class=\"size-3.5\" />\n </button>\n }\n @if (loading()) {\n <div class=\"flex shrink-0 items-center pe-2 pointer-events-none\">\n <ui-spinner size=\"xs\" />\n </div>\n }\n @if (suffix() && !loading()) {\n <span class=\"text-muted-foreground flex shrink-0 items-center ps-1 pe-3 text-sm select-none\">{{ suffix() }}</span>\n }\n </div>\n} @else {\n <input\n [class]=\"classes()\"\n [type]=\"type()\"\n [disabled]=\"isDisabled()\"\n [placeholder]=\"placeholder()\"\n [attr.id]=\"resolvedId()\"\n [attr.name]=\"name()\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-labelledby]=\"ariaLabelledby()\"\n [attr.aria-describedby]=\"ariaDescribedby()\"\n [attr.inputmode]=\"inputMode()\"\n [attr.lang]=\"lang()\"\n [attr.data-slot]=\"'input'\"\n #inputRef\n [ngModel]=\"value()\"\n (ngModelChange)=\"onValueChange($event)\"\n (focus)=\"onFocus()\"\n (blur)=\"onBlur()\"\n />\n}\n", styles: [":host{--_d: var(--density-input, var(--density, 1))}@layer components{[data-slot=input]{height:calc(2.25rem * var(--_d));padding-inline:calc(.75rem * var(--_d));padding-block:calc(.25rem * var(--_d))}[data-slot=input-container]{height:calc(2.25rem * var(--_d))}[data-slot=input-floating]{padding-top:calc(1.5rem * var(--_d))}[data-slot=input-floating]>label{inset-inline-start:calc(.75rem * var(--_d));top:calc(2.625rem * var(--_d));transform:translateY(-50%)}[data-slot=input-floating][data-variant=underline]>label,[data-slot=input-floating][data-variant=ghost]>label{inset-inline-start:0}[data-slot=input-floating]>label[data-active]{inset-inline-start:0;top:calc(1.125rem * var(--_d));transform:translateY(-100%)}}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: SpinnerComponent, selector: "ui-spinner", inputs: ["class", "size", "customSize", "variant"] }, { kind: "component", type: SkeletonComponent, selector: "ui-skeleton", inputs: ["class", "variant"] }, { kind: "component", type: IconComponent, selector: "ui-icon", inputs: ["name", "class", "size", "weight", "strokeWidth", "color", "fillColor"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
27966
|
+
], viewQueries: [{ propertyName: "inputRef", first: true, predicate: ["inputRef"], descendants: true, isSignal: true }], ngImport: i0, template: "@if (skeleton()) {\n <ui-skeleton class=\"h-9 w-full rounded-md\" />\n} @else if (isFloating()) {\n <div class=\"relative\" [attr.data-slot]=\"'input-floating'\" [attr.data-variant]=\"effectiveVariant()\">\n <input\n [class]=\"classes()\"\n [type]=\"type()\"\n [disabled]=\"isDisabled()\"\n [placeholder]=\"labelIsActive() ? placeholder() : ''\"\n [attr.id]=\"resolvedId()\"\n [attr.name]=\"name()\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-labelledby]=\"ariaLabelledby()\"\n [attr.aria-describedby]=\"ariaDescribedby()\"\n [attr.inputmode]=\"inputMode()\"\n [attr.lang]=\"lang()\"\n [attr.data-slot]=\"'input'\"\n #inputRef\n [ngModel]=\"value()\"\n (ngModelChange)=\"onValueChange($event)\"\n (focus)=\"onFocus()\"\n (blur)=\"onBlur()\"\n />\n <label [for]=\"resolvedId()\" [class]=\"floatingLabelClasses()\" [attr.data-active]=\"labelIsActive() ? '' : null\">{{ label() }}</label>\n </div>\n} @else if (needsContainer()) {\n <div [class]=\"containerClasses()\" [attr.data-slot]=\"'input-container'\">\n @if (prefix()) {\n <span class=\"text-muted-foreground flex shrink-0 items-center ps-3 pe-1 text-sm select-none\">{{ prefix() }}</span>\n }\n <input\n [class]=\"innerClasses()\"\n [type]=\"type()\"\n [disabled]=\"isDisabled()\"\n [placeholder]=\"placeholder()\"\n [attr.id]=\"resolvedId()\"\n [attr.name]=\"name()\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-labelledby]=\"ariaLabelledby()\"\n [attr.aria-describedby]=\"ariaDescribedby()\"\n [attr.inputmode]=\"inputMode()\"\n [attr.lang]=\"lang()\"\n [attr.data-slot]=\"'input'\"\n #inputRef\n [ngModel]=\"value()\"\n (ngModelChange)=\"onValueChange($event)\"\n (focus)=\"onFocus()\"\n (blur)=\"onBlur()\"\n />\n @if (clearable() && value()) {\n <button\n type=\"button\"\n (click)=\"clearValue()\"\n tabindex=\"-1\"\n class=\"flex shrink-0 items-center justify-center pe-2 text-muted-foreground hover:text-foreground\"\n aria-label=\"Clear\"\n >\n <ui-icon name=\"x\" class=\"size-3.5\" />\n </button>\n }\n @if (loading()) {\n <div class=\"flex shrink-0 items-center pe-2 pointer-events-none\">\n <ui-spinner size=\"xs\" />\n </div>\n }\n @if (suffix() && !loading()) {\n <span class=\"text-muted-foreground flex shrink-0 items-center ps-1 pe-3 text-sm select-none\">{{ suffix() }}</span>\n }\n </div>\n} @else {\n <input\n [class]=\"classes()\"\n [type]=\"type()\"\n [disabled]=\"isDisabled()\"\n [placeholder]=\"placeholder()\"\n [attr.id]=\"resolvedId()\"\n [attr.name]=\"name()\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-labelledby]=\"ariaLabelledby()\"\n [attr.aria-describedby]=\"ariaDescribedby()\"\n [attr.inputmode]=\"inputMode()\"\n [attr.lang]=\"lang()\"\n [attr.data-slot]=\"'input'\"\n #inputRef\n [ngModel]=\"value()\"\n (ngModelChange)=\"onValueChange($event)\"\n (focus)=\"onFocus()\"\n (blur)=\"onBlur()\"\n />\n}\n", styles: [":host{--_d: var(--density-input, var(--density, 1))}@layer components{[data-slot=input]{height:calc(2.25rem * var(--_d));padding-inline:calc(.75rem * var(--_d));padding-block:calc(.25rem * var(--_d))}[data-slot=input-container]{height:calc(2.25rem * var(--_d))}[data-slot=input-floating]{padding-top:calc(1.5rem * var(--_d))}[data-slot=input-floating]>label{inset-inline-start:calc(.75rem * var(--_d));top:calc(2.625rem * var(--_d));transform:translateY(-50%)}[data-slot=input-floating][data-variant=underline]>label,[data-slot=input-floating][data-variant=ghost]>label{inset-inline-start:0}[data-slot=input-floating]>label[data-active]{inset-inline-start:0;top:calc(1.125rem * var(--_d));transform:translateY(-100%)}}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: SpinnerComponent, selector: "ui-spinner", inputs: ["class", "size", "customSize", "variant", "label"] }, { kind: "component", type: SkeletonComponent, selector: "ui-skeleton", inputs: ["class", "variant"] }, { kind: "component", type: IconComponent, selector: "ui-icon", inputs: ["name", "class", "size", "weight", "strokeWidth", "color", "fillColor"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
27792
27967
|
}
|
|
27793
27968
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: InputComponent, decorators: [{
|
|
27794
27969
|
type: Component,
|
|
@@ -27841,7 +28016,7 @@ class TabsComponent {
|
|
|
27841
28016
|
* projected `<ui-tabs-trigger>` computes its own and honours a `class` input, which this does not.
|
|
27842
28017
|
*/
|
|
27843
28018
|
triggerClasses(value) {
|
|
27844
|
-
return cn('inline-flex items-center justify-center whitespace-nowrap rounded-md
|
|
28019
|
+
return cn('inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50', this.activeTab() === value
|
|
27845
28020
|
? 'bg-background text-foreground shadow'
|
|
27846
28021
|
: 'hover:bg-background/50');
|
|
27847
28022
|
}
|
|
@@ -27875,6 +28050,44 @@ class TabsComponent {
|
|
|
27875
28050
|
this.activeTab.set(value);
|
|
27876
28051
|
this.tabChange.emit(value);
|
|
27877
28052
|
}
|
|
28053
|
+
/**
|
|
28054
|
+
* WAI-ARIA tabs keyboard support, shared by both modes' trigger buttons. Left/Right move to the
|
|
28055
|
+
* neighbouring enabled tab (wrapping, and swapped in RTL) and Home/End jump to the first/last
|
|
28056
|
+
* enabled one; the target is focused and activated via {@link selectTab} (automatic activation),
|
|
28057
|
+
* so {@link tabChange} fires without a synthetic click. Other keys, and any key with a
|
|
28058
|
+
* modifier (Alt+Left is browser Back, Ctrl+Arrow is word navigation), are left alone.
|
|
28059
|
+
*/
|
|
28060
|
+
onTabKeydown(event) {
|
|
28061
|
+
if (event.altKey || event.ctrlKey || event.metaKey || event.shiftKey)
|
|
28062
|
+
return;
|
|
28063
|
+
const current = event.currentTarget;
|
|
28064
|
+
const tablist = current.closest('[role="tablist"]');
|
|
28065
|
+
if (!tablist)
|
|
28066
|
+
return;
|
|
28067
|
+
const enabled = Array.from(tablist.querySelectorAll('[role="tab"]:not(:disabled)'));
|
|
28068
|
+
const from = enabled.indexOf(current);
|
|
28069
|
+
const target = this.keyTarget(event.key, from, enabled.length, getComputedStyle(tablist).direction === 'rtl');
|
|
28070
|
+
if (from < 0 || target === null)
|
|
28071
|
+
return;
|
|
28072
|
+
event.preventDefault();
|
|
28073
|
+
enabled[target].focus();
|
|
28074
|
+
const value = enabled[target].dataset['value'];
|
|
28075
|
+
if (value !== undefined)
|
|
28076
|
+
this.selectTab(value);
|
|
28077
|
+
}
|
|
28078
|
+
keyTarget(key, from, count, rtl) {
|
|
28079
|
+
const forward = rtl ? 'ArrowLeft' : 'ArrowRight';
|
|
28080
|
+
const backward = rtl ? 'ArrowRight' : 'ArrowLeft';
|
|
28081
|
+
if (key === 'Home')
|
|
28082
|
+
return 0;
|
|
28083
|
+
if (key === 'End')
|
|
28084
|
+
return count - 1;
|
|
28085
|
+
if (key === forward)
|
|
28086
|
+
return (from + 1) % count;
|
|
28087
|
+
if (key === backward)
|
|
28088
|
+
return (from - 1 + count) % count;
|
|
28089
|
+
return null;
|
|
28090
|
+
}
|
|
27878
28091
|
/**
|
|
27879
28092
|
* The `id` given to that tab's trigger button, which its panel points `aria-labelledby` at.
|
|
27880
28093
|
* Namespaced per `<ui-tabs>` instance so several tab sets can reuse the same values. Used only
|
|
@@ -27900,9 +28113,12 @@ class TabsComponent {
|
|
|
27900
28113
|
[attr.aria-selected]="activeTab() === tab.value"
|
|
27901
28114
|
[attr.data-state]="activeTab() === tab.value ? 'active' : 'inactive'"
|
|
27902
28115
|
[attr.tabindex]="activeTab() === tab.value ? 0 : -1"
|
|
28116
|
+
[attr.data-slot]="'tabs-trigger'"
|
|
28117
|
+
[attr.data-value]="tab.value"
|
|
27903
28118
|
[disabled]="tab.disabled"
|
|
27904
28119
|
[class]="triggerClasses(tab.value)"
|
|
27905
28120
|
(click)="selectTab(tab.value)"
|
|
28121
|
+
(keydown)="onTabKeydown($event)"
|
|
27906
28122
|
>
|
|
27907
28123
|
{{ tab.label }}
|
|
27908
28124
|
</button>
|
|
@@ -27926,17 +28142,11 @@ class TabsComponent {
|
|
|
27926
28142
|
<ng-content />
|
|
27927
28143
|
}
|
|
27928
28144
|
</div>
|
|
27929
|
-
`, isInline: true, dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: NgComponentOutlet, selector: "[ngComponentOutlet]", inputs: ["ngComponentOutlet", "ngComponentOutletInputs", "ngComponentOutletInjector", "ngComponentOutletEnvironmentInjector", "ngComponentOutletContent", "ngComponentOutletNgModule"], exportAs: ["ngComponentOutlet"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
28145
|
+
`, isInline: true, styles: [":host{--_d: var(--density-tabs, var(--density, 1))}@layer components{[data-slot=tabs-trigger]{padding-inline:calc(.75rem * var(--_d));padding-block:calc(.25rem * var(--_d))}}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: NgComponentOutlet, selector: "[ngComponentOutlet]", inputs: ["ngComponentOutlet", "ngComponentOutletInputs", "ngComponentOutletInjector", "ngComponentOutletEnvironmentInjector", "ngComponentOutletContent", "ngComponentOutletNgModule"], exportAs: ["ngComponentOutlet"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
27930
28146
|
}
|
|
27931
28147
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: TabsComponent, decorators: [{
|
|
27932
28148
|
type: Component,
|
|
27933
|
-
args: [{
|
|
27934
|
-
selector: 'ui-tabs',
|
|
27935
|
-
standalone: true,
|
|
27936
|
-
imports: [NgTemplateOutlet, NgComponentOutlet],
|
|
27937
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
27938
|
-
providers: [{ provide: TABS, useExisting: forwardRef(() => TabsComponent) }],
|
|
27939
|
-
template: `
|
|
28149
|
+
args: [{ selector: 'ui-tabs', standalone: true, imports: [NgTemplateOutlet, NgComponentOutlet], changeDetection: ChangeDetectionStrategy.OnPush, providers: [{ provide: TABS, useExisting: forwardRef(() => TabsComponent) }], template: `
|
|
27940
28150
|
<div [class]="classes()" [attr.data-slot]="'tabs'">
|
|
27941
28151
|
@if (tabs().length > 0) {
|
|
27942
28152
|
<!-- Simple mode: auto-generate tabs -->
|
|
@@ -27948,9 +28158,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
|
|
|
27948
28158
|
[attr.aria-selected]="activeTab() === tab.value"
|
|
27949
28159
|
[attr.data-state]="activeTab() === tab.value ? 'active' : 'inactive'"
|
|
27950
28160
|
[attr.tabindex]="activeTab() === tab.value ? 0 : -1"
|
|
28161
|
+
[attr.data-slot]="'tabs-trigger'"
|
|
28162
|
+
[attr.data-value]="tab.value"
|
|
27951
28163
|
[disabled]="tab.disabled"
|
|
27952
28164
|
[class]="triggerClasses(tab.value)"
|
|
27953
28165
|
(click)="selectTab(tab.value)"
|
|
28166
|
+
(keydown)="onTabKeydown($event)"
|
|
27954
28167
|
>
|
|
27955
28168
|
{{ tab.label }}
|
|
27956
28169
|
</button>
|
|
@@ -27974,9 +28187,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
|
|
|
27974
28187
|
<ng-content />
|
|
27975
28188
|
}
|
|
27976
28189
|
</div>
|
|
27977
|
-
`,
|
|
27978
|
-
host: { '[class]': '"contents"' },
|
|
27979
|
-
}]
|
|
28190
|
+
`, host: { '[class]': '"contents"' }, styles: [":host{--_d: var(--density-tabs, var(--density, 1))}@layer components{[data-slot=tabs-trigger]{padding-inline:calc(.75rem * var(--_d));padding-block:calc(.25rem * var(--_d))}}\n"] }]
|
|
27980
28191
|
}], propDecorators: { defaultValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "defaultValue", required: false }] }], class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], tabs: [{ type: i0.Input, args: [{ isSignal: true, alias: "tabs", required: false }] }], tabChange: [{ type: i0.Output, args: ["tabChange"] }] } });
|
|
27981
28192
|
|
|
27982
28193
|
class TabsListComponent {
|
|
@@ -27997,7 +28208,7 @@ class TabsListComponent {
|
|
|
27997
28208
|
this.skeleton = input(false, ...(ngDevMode ? [{ debugName: "skeleton" }] : /* istanbul ignore next */ []));
|
|
27998
28209
|
/** How many placeholder bars {@link skeleton} renders — set it to the tab count you expect so the bar doesn't resize on load. Ignored unless `skeleton` is `true`. */
|
|
27999
28210
|
this.skeletonCount = input(3, ...(ngDevMode ? [{ debugName: "skeletonCount" }] : /* istanbul ignore next */ []));
|
|
28000
|
-
this.skeletonItems = computed(() => Array.from({ length: this.skeletonCount() }, (
|
|
28211
|
+
this.skeletonItems = computed(() => Array.from({ length: this.skeletonCount() }, (...[, i]) => i), ...(ngDevMode ? [{ debugName: "skeletonItems" }] : /* istanbul ignore next */ []));
|
|
28001
28212
|
this.skeletonClasses = computed(() => cn(this.classes(), 'gap-1'), ...(ngDevMode ? [{ debugName: "skeletonClasses" }] : /* istanbul ignore next */ []));
|
|
28002
28213
|
this.classes = computed(() => cn('inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground', this.class()), ...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
|
|
28003
28214
|
}
|
|
@@ -28077,6 +28288,10 @@ class TabsTriggerComponent {
|
|
|
28077
28288
|
this.tabs.selectTab(this.value());
|
|
28078
28289
|
}
|
|
28079
28290
|
}
|
|
28291
|
+
/** Arrow/Home/End navigation between triggers; delegated to the parent `<ui-tabs>`. */
|
|
28292
|
+
onKeydown(event) {
|
|
28293
|
+
this.tabs?.onTabKeydown(event);
|
|
28294
|
+
}
|
|
28080
28295
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: TabsTriggerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
28081
28296
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.22", type: TabsTriggerComponent, isStandalone: true, selector: "ui-tabs-trigger", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: true, transformFunction: null }, class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "\"contents\"" } }, ngImport: i0, template: `
|
|
28082
28297
|
<button
|
|
@@ -28089,7 +28304,9 @@ class TabsTriggerComponent {
|
|
|
28089
28304
|
[attr.tabindex]="isActive() ? 0 : -1"
|
|
28090
28305
|
[class]="classes()"
|
|
28091
28306
|
[attr.data-slot]="'tabs-trigger'"
|
|
28307
|
+
[attr.data-value]="value()"
|
|
28092
28308
|
(click)="select()"
|
|
28309
|
+
(keydown)="onKeydown($event)"
|
|
28093
28310
|
>
|
|
28094
28311
|
<ng-content />
|
|
28095
28312
|
</button>
|
|
@@ -28108,7 +28325,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
|
|
|
28108
28325
|
[attr.tabindex]="isActive() ? 0 : -1"
|
|
28109
28326
|
[class]="classes()"
|
|
28110
28327
|
[attr.data-slot]="'tabs-trigger'"
|
|
28328
|
+
[attr.data-value]="value()"
|
|
28111
28329
|
(click)="select()"
|
|
28330
|
+
(keydown)="onKeydown($event)"
|
|
28112
28331
|
>
|
|
28113
28332
|
<ng-content />
|
|
28114
28333
|
</button>
|
|
@@ -29217,6 +29436,14 @@ class ColorPickerComponent {
|
|
|
29217
29436
|
this.commitHsv();
|
|
29218
29437
|
this.onTouched();
|
|
29219
29438
|
}
|
|
29439
|
+
ngOnDestroy() {
|
|
29440
|
+
// A drag still going when the picker is destroyed would keep listening on the window (and
|
|
29441
|
+
// calling into a destroyed picker) until the next pointer-up; the copy badge timer likewise.
|
|
29442
|
+
this.dragCleanup?.();
|
|
29443
|
+
this.dragCleanup = null;
|
|
29444
|
+
if (this.copyTimer)
|
|
29445
|
+
clearTimeout(this.copyTimer);
|
|
29446
|
+
}
|
|
29220
29447
|
startAreaDrag(clientX, clientY) {
|
|
29221
29448
|
this.isDragging = true;
|
|
29222
29449
|
this.updateFromAreaPosition(clientX, clientY);
|
|
@@ -29473,7 +29700,7 @@ class ColorPickerComponent {
|
|
|
29473
29700
|
useExisting: forwardRef(() => ColorPickerComponent),
|
|
29474
29701
|
multi: true,
|
|
29475
29702
|
},
|
|
29476
|
-
], viewQueries: [{ propertyName: "colorArea", first: true, predicate: ["colorArea"], descendants: true, isSignal: true }, { propertyName: "imageFile", first: true, predicate: ["imageFile"], descendants: true, isSignal: true }], ngImport: i0, template: "<ng-template #colorPanel>\n <div class=\"flex flex-col gap-3\">\n\n @if (enableEyedropper() || enableImagePick()) {\n <div class=\"flex items-center justify-end gap-1\">\n @if (enableEyedropper()) {\n <ui-eyedropper\n variant=\"icon\"\n [fallbackTarget]=\"fallbackTarget()\"\n (colorPick)=\"onEyedropperPick($event)\"\n uiTooltip=\"Pick color from screen\"\n />\n }\n @if (enableImagePick()) {\n <button\n type=\"button\"\n class=\"inline-flex h-9 w-9 items-center justify-center rounded-md border border-input bg-background text-sm font-medium ring-offset-background transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2\"\n (click)=\"openImagePicker()\"\n [attr.aria-label]=\"t().pickColorFromImage\"\n data-slot=\"image-pick-trigger\"\n uiTooltip=\"Pick color from image\"\n >\n <ui-icon name=\"pipette-image\" class=\"h-4 w-4\" />\n </button>\n <input\n #imageFile\n type=\"file\"\n accept=\"image/*\"\n hidden\n (change)=\"onImageSelected($event)\"\n />\n }\n </div>\n }\n\n <div\n #colorArea\n class=\"relative h-32 w-full cursor-crosshair rounded-md outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2\"\n style=\"touch-action: none\"\n [style.background]=\"areaBackground()\"\n tabindex=\"0\"\n role=\"slider\"\n [attr.aria-label]=\"t().saturationValue\"\n [attr.aria-valuenow]=\"saturation()\"\n [attr.aria-valuemin]=\"0\"\n [attr.aria-valuemax]=\"100\"\n [attr.aria-valuetext]=\"'S ' + saturation() + '%, V ' + hsvValue() + '%'\"\n (mousedown)=\"onAreaMouseDown($event)\"\n (touchstart)=\"onAreaTouchStart($event)\"\n (keydown)=\"onAreaKeyDown($event)\"\n >\n <div\n class=\"absolute h-4 w-4 -translate-x-1/2 -translate-y-1/2 rounded-full border-2 border-white shadow-sm pointer-events-none\"\n [style.left.%]=\"saturation()\"\n [style.top.%]=\"100 - hsvValue()\"\n [style.backgroundColor]=\"currentColor()\"\n ></div>\n </div>\n\n <div class=\"space-y-1\">\n <label for=\"ui-color-picker-hue\" class=\"text-xs text-muted-foreground\">Hue</label>\n <input\n id=\"ui-color-picker-hue\"\n type=\"range\"\n min=\"0\"\n max=\"360\"\n [value]=\"hue()\"\n (input)=\"onHueChange($event)\"\n [attr.aria-label]=\"t().hue\"\n class=\"w-full h-3 rounded-md cursor-pointer appearance-none\"\n [style.background]=\"hueGradient\"\n />\n </div>\n\n @if (alpha()) {\n <div class=\"space-y-1\">\n <label for=\"ui-color-picker-alpha\" class=\"text-xs text-muted-foreground\">Alpha</label>\n <div class=\"relative h-3 w-full rounded-md ui-color-picker-checker\">\n <input\n id=\"ui-color-picker-alpha\"\n type=\"range\"\n min=\"0\"\n max=\"100\"\n step=\"1\"\n [value]=\"alphaValue() * 100\"\n (input)=\"onAlphaChange($event)\"\n [attr.aria-label]=\"t().alpha\"\n class=\"absolute inset-0 w-full h-3 rounded-md cursor-pointer appearance-none\"\n [style.background]=\"alphaGradient()\"\n />\n </div>\n </div>\n }\n\n @if (showRecent() && recents().length > 0) {\n <fieldset class=\"space-y-1 border-0 p-0 m-0\">\n <legend class=\"text-xs text-muted-foreground p-0\">{{ t().recent }}</legend>\n <ul class=\"flex flex-wrap gap-1 list-none p-0 m-0\" [attr.aria-label]=\"t().recentColors\">\n @for (color of recents(); track color) {\n <li>\n <button\n type=\"button\"\n class=\"aspect-square w-6 rounded border cursor-pointer hover:scale-110 transition-transform ui-color-picker-checker\"\n [style.backgroundColor]=\"color\"\n (click)=\"selectPreset(color)\"\n [attr.aria-label]=\"'Apply recent ' + color\"\n ></button>\n </li>\n }\n </ul>\n </fieldset>\n }\n\n @if (extractedPalette().length > 0) {\n <fieldset class=\"space-y-1 border-0 p-0 m-0\">\n <div class=\"flex items-center justify-between\">\n <legend class=\"text-xs text-muted-foreground p-0\">From image</legend>\n <button\n type=\"button\"\n class=\"text-xs text-muted-foreground hover:text-foreground\"\n (click)=\"clearExtractedPalette()\"\n >Clear</button>\n </div>\n <ul class=\"flex flex-wrap gap-1 list-none p-0 m-0\" [attr.aria-label]=\"t().extractedPalette\">\n @for (color of extractedPalette(); track color) {\n <li>\n <button\n type=\"button\"\n class=\"aspect-square w-6 rounded border cursor-pointer hover:scale-110 transition-transform\"\n [style.backgroundColor]=\"color\"\n (click)=\"applyExtracted(color)\"\n [attr.aria-label]=\"'Apply extracted ' + color\"\n ></button>\n </li>\n }\n </ul>\n </fieldset>\n }\n\n @if (presets().length > 0) {\n <fieldset class=\"space-y-1 border-0 p-0 m-0\">\n <legend class=\"text-xs text-muted-foreground p-0\">Presets</legend>\n <div class=\"flex flex-wrap gap-1\">\n @for (color of presets(); track color) {\n <button\n type=\"button\"\n data-color-btn\n class=\"aspect-square w-6 rounded border cursor-pointer hover:scale-110 transition-transform\"\n [style.backgroundColor]=\"color\"\n [class.ring-2]=\"currentColor() === color\"\n [class.ring-primary]=\"currentColor() === color\"\n (click)=\"selectPreset(color)\"\n [attr.aria-label]=\"'Select ' + color\"\n ></button>\n }\n </div>\n </fieldset>\n }\n\n @if (showHarmonies()) {\n <fieldset class=\"space-y-1 border-0 p-0 m-0\">\n <legend class=\"text-xs text-muted-foreground p-0\">Harmonies</legend>\n <div class=\"space-y-1\">\n @for (group of harmonyGroups(); track group.label) {\n <div class=\"flex items-center gap-2\">\n <span\n class=\"w-20 text-[10px] text-muted-foreground cursor-help underline decoration-dotted underline-offset-2\"\n [uiTooltip]=\"group.hint\"\n >{{ group.label }}</span>\n <div class=\"flex items-center gap-1\">\n @for (color of group.swatches; track color) {\n <button\n type=\"button\"\n class=\"relative aspect-square w-5 rounded border cursor-pointer hover:scale-110 transition-transform\"\n [style.backgroundColor]=\"color\"\n (click)=\"copyHarmony(color)\"\n [uiTooltip]=\"copiedHarmony() === color ? 'Copied ' + color : 'Click to copy ' + color\"\n [attr.aria-label]=\"'Copy ' + color\"\n >\n @if (copiedHarmony() === color) {\n <span class=\"absolute inset-0 flex items-center justify-center rounded bg-foreground/80 text-background\">\n <ui-icon name=\"check\" class=\"h-3 w-3\" />\n </span>\n }\n </button>\n }\n @if (copiedHarmony(); as copied) {\n @if (groupContains(group, copied)) {\n <span class=\"ml-1 inline-flex items-center gap-1 rounded bg-green-500/15 px-1.5 py-0.5 text-[10px] font-medium text-green-700 dark:text-green-300\">\n <ui-icon name=\"check\" class=\"h-3 w-3\" />\n {{ copied }}\n </span>\n }\n }\n </div>\n </div>\n }\n </div>\n </fieldset>\n }\n\n @if (showContrast() && contrastBadge(); as badge) {\n <div class=\"mt-3 flex items-center justify-between gap-2 rounded-md border border-input px-2 py-1.5\">\n <div class=\"flex items-center gap-2 min-w-0\">\n <button\n type=\"button\"\n class=\"flex flex-col items-center gap-0.5 rounded p-1 transition focus:outline-none\"\n [class.ring-2]=\"compareActive() === 'a'\"\n [class.ring-ring]=\"compareActive() === 'a'\"\n (click)=\"setCompareSlot('a')\"\n uiTooltip=\"Edit color A with the picker above\"\n [attr.aria-label]=\"t().editColorA\"\n >\n <span\n class=\"block h-6 w-6 rounded border\"\n [style.backgroundColor]=\"compareAHex()\"\n ></span>\n <span class=\"font-mono text-[9px] text-muted-foreground\">{{ compareAHex() }}</span>\n </button>\n <span class=\"text-xs text-muted-foreground shrink-0\">vs</span>\n <button\n type=\"button\"\n class=\"flex flex-col items-center gap-0.5 rounded p-1 transition focus:outline-none\"\n [class.ring-2]=\"compareActive() === 'b'\"\n [class.ring-ring]=\"compareActive() === 'b'\"\n (click)=\"setCompareSlot('b')\"\n uiTooltip=\"Edit color B with the picker above\"\n [attr.aria-label]=\"t().editColorB\"\n >\n <span\n class=\"block h-6 w-6 rounded border\"\n [style.backgroundColor]=\"compareBHex()\"\n ></span>\n <span class=\"font-mono text-[9px] text-muted-foreground\">{{ compareBHex() }}</span>\n </button>\n </div>\n <div class=\"flex items-center gap-2 shrink-0\">\n <span class=\"font-mono text-xs\">{{ contrastRatioDisplay() }}:1</span>\n <span\n class=\"rounded px-1.5 py-0.5 text-[10px] font-semibold\"\n [class.bg-green-500]=\"badge.pass\"\n [class.text-white]=\"badge.pass\"\n [class.bg-destructive]=\"!badge.pass\"\n [class.text-destructive-foreground]=\"!badge.pass\"\n >{{ badge.label }}</span>\n </div>\n </div>\n }\n\n <ui-tabs [defaultValue]=\"formats()[0]\">\n <ui-tabs-list class=\"flex justify-start w-full h-8 gap-1\">\n @for (fmt of formats(); track fmt) {\n <ui-tabs-trigger [value]=\"fmt\" class=\"text-xs uppercase\">{{ fmt }}</ui-tabs-trigger>\n }\n </ui-tabs-list>\n\n @if (formats().includes('hex')) {\n <ui-tabs-content value=\"hex\" class=\"mt-2\">\n <div class=\"flex items-center gap-1\">\n <ui-input\n type=\"text\"\n [ngModel]=\"formatValues().hex\"\n (ngModelChange)=\"onHexInput($event)\"\n placeholder=\"#000000\"\n class=\"h-8 text-xs font-mono flex-1\"\n />\n <button\n type=\"button\"\n class=\"inline-flex h-8 w-8 pointer-coarse:size-11 items-center justify-center rounded-md text-muted-foreground hover:text-foreground\"\n (click)=\"copy('hex')\"\n [attr.aria-label]=\"t().copyHex\"\n >\n <ui-icon [name]=\"copiedFormat() === 'hex' ? 'check' : 'copy'\" class=\"h-4 w-4\" />\n </button>\n </div>\n </ui-tabs-content>\n }\n\n @if (formats().includes('rgb')) {\n <ui-tabs-content value=\"rgb\" class=\"mt-2\">\n <div class=\"space-y-2\">\n <div class=\"grid grid-cols-3 gap-2\">\n <div>\n <span class=\"text-xs text-muted-foreground\" aria-hidden=\"true\">R</span>\n <ui-input\n type=\"number\"\n min=\"0\"\n max=\"255\"\n [ngModel]=\"rgb().r\"\n (ngModelChange)=\"onRgbChange('r', $event)\"\n [attr.aria-label]=\"t().red\"\n class=\"h-8 text-xs\"\n />\n </div>\n <div>\n <span class=\"text-xs text-muted-foreground\" aria-hidden=\"true\">G</span>\n <ui-input\n type=\"number\"\n min=\"0\"\n max=\"255\"\n [ngModel]=\"rgb().g\"\n (ngModelChange)=\"onRgbChange('g', $event)\"\n [attr.aria-label]=\"t().green\"\n class=\"h-8 text-xs\"\n />\n </div>\n <div>\n <span class=\"text-xs text-muted-foreground\" aria-hidden=\"true\">B</span>\n <ui-input\n type=\"number\"\n min=\"0\"\n max=\"255\"\n [ngModel]=\"rgb().b\"\n (ngModelChange)=\"onRgbChange('b', $event)\"\n [attr.aria-label]=\"t().blue\"\n class=\"h-8 text-xs\"\n />\n </div>\n </div>\n <div class=\"flex items-center gap-1\">\n <span class=\"flex-1 truncate text-xs font-mono text-muted-foreground\">{{ formatValues().rgb }}</span>\n <button\n type=\"button\"\n class=\"inline-flex h-7 w-7 pointer-coarse:size-11 items-center justify-center rounded-md text-muted-foreground hover:text-foreground\"\n (click)=\"copy('rgb')\"\n [attr.aria-label]=\"t().copyRgb\"\n >\n <ui-icon [name]=\"copiedFormat() === 'rgb' ? 'check' : 'copy'\" class=\"h-4 w-4\" />\n </button>\n </div>\n </div>\n </ui-tabs-content>\n }\n\n @if (formats().includes('hsl')) {\n <ui-tabs-content value=\"hsl\" class=\"mt-2\">\n <div class=\"space-y-2\">\n <div class=\"grid grid-cols-3 gap-2\">\n <div>\n <span class=\"text-xs text-muted-foreground\" aria-hidden=\"true\">H</span>\n <ui-input\n type=\"number\"\n min=\"0\"\n max=\"360\"\n [ngModel]=\"hsl().h\"\n (ngModelChange)=\"onHslHueChange($event)\"\n [attr.aria-label]=\"t().hue\"\n class=\"h-8 text-xs\"\n />\n </div>\n <div>\n <span class=\"text-xs text-muted-foreground\" aria-hidden=\"true\">S</span>\n <ui-input\n type=\"number\"\n min=\"0\"\n max=\"100\"\n [ngModel]=\"hsl().s\"\n (ngModelChange)=\"onHslChange('s', $event)\"\n [attr.aria-label]=\"t().saturation\"\n class=\"h-8 text-xs\"\n />\n </div>\n <div>\n <span class=\"text-xs text-muted-foreground\" aria-hidden=\"true\">L</span>\n <ui-input\n type=\"number\"\n min=\"0\"\n max=\"100\"\n [ngModel]=\"hsl().l\"\n (ngModelChange)=\"onHslChange('l', $event)\"\n [attr.aria-label]=\"t().lightness\"\n class=\"h-8 text-xs\"\n />\n </div>\n </div>\n <div class=\"flex items-center gap-1\">\n <span class=\"flex-1 truncate text-xs font-mono text-muted-foreground\">{{ formatValues().hsl }}</span>\n <button\n type=\"button\"\n class=\"inline-flex h-7 w-7 pointer-coarse:size-11 items-center justify-center rounded-md text-muted-foreground hover:text-foreground\"\n (click)=\"copy('hsl')\"\n [attr.aria-label]=\"t().copyHsl\"\n >\n <ui-icon [name]=\"copiedFormat() === 'hsl' ? 'check' : 'copy'\" class=\"h-4 w-4\" />\n </button>\n </div>\n </div>\n </ui-tabs-content>\n }\n\n @if (formats().includes('oklch')) {\n <ui-tabs-content value=\"oklch\" class=\"mt-2\">\n <div class=\"flex items-center gap-1\">\n <span class=\"flex-1 truncate text-xs font-mono text-muted-foreground\">{{ formatValues().oklch }}</span>\n <button\n type=\"button\"\n class=\"inline-flex h-7 w-7 pointer-coarse:size-11 items-center justify-center rounded-md text-muted-foreground hover:text-foreground\"\n (click)=\"copy('oklch')\"\n [attr.aria-label]=\"t().copyOklch\"\n >\n <ui-icon [name]=\"copiedFormat() === 'oklch' ? 'check' : 'copy'\" class=\"h-4 w-4\" />\n </button>\n </div>\n </ui-tabs-content>\n }\n </ui-tabs>\n </div>\n</ng-template>\n\n@if (inline()) {\n <ng-container [ngTemplateOutlet]=\"colorPanel\" />\n} @else {\n <ui-popover [open]=\"open()\" (openChange)=\"open.set($event)\" [attr.dir]=\"dir()\">\n <ui-popover-trigger>\n <ng-content select=\"[colorPickerTrigger]\" />\n @if (!hasTrigger()) {\n <button\n type=\"button\"\n [class]=\"triggerClasses()\"\n [disabled]=\"isDisabled()\"\n [attr.data-slot]=\"'color-picker-trigger'\"\n >\n <span\n class=\"h-6 w-6 rounded border ui-color-picker-checker\"\n [style.backgroundColor]=\"currentColor()\"\n ></span>\n <span class=\"flex-1 text-start text-sm truncate font-mono\">{{ currentColor() || 'Select color' }}</span>\n <ui-icon name=\"chevron-down\" class=\"h-4 w-4 opacity-50\" />\n </button>\n }\n </ui-popover-trigger>\n <ui-popover-content class=\"w-72 p-3\" align=\"start\" [restoreFocus]=\"false\">\n <ng-container [ngTemplateOutlet]=\"colorPanel\" />\n </ui-popover-content>\n </ui-popover>\n}\n", styles: [":host{--_d: var(--density-picker, var(--density, 1))}@layer components{[data-slot=color-picker-trigger]{height:calc(2.5rem * var(--_d));padding-inline:calc(.75rem * var(--_d));padding-block:calc(.5rem * var(--_d));gap:calc(.5rem * var(--_d))}.ui-color-picker-checker{background-image:linear-gradient(45deg,hsl(0 0% 80%) 25%,transparent 25%),linear-gradient(-45deg,hsl(0 0% 80%) 25%,transparent 25%),linear-gradient(45deg,transparent 75%,hsl(0 0% 80%) 75%),linear-gradient(-45deg,transparent 75%,hsl(0 0% 80%) 75%);background-size:8px 8px;background-position:0 0,0 4px,4px -4px,-4px 0}}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: PopoverComponent, selector: "ui-popover", inputs: ["class", "open", "closeOnScroll"], outputs: ["openChange"] }, { kind: "component", type: PopoverTriggerComponent, selector: "ui-popover-trigger", inputs: ["class"] }, { kind: "component", type: PopoverContentComponent, selector: "ui-popover-content", inputs: ["class", "align", "side", "sideOffset", "avoidCollisions", "restoreFocus", "strategy"] }, { kind: "component", type: InputComponent, selector: "ui-input", inputs: ["type", "placeholder", "disabled", "class", "elementId", "name", "ariaLabel", "ariaLabelledby", "ariaDescribedby", "variant", "loading", "skeleton", "autofocus", "clearable", "floating", "label", "labelClass", "inputMode", "lang", "prefix", "suffix", "value"], outputs: ["valueChange"] }, { kind: "component", type: TabsComponent, selector: "ui-tabs", inputs: ["defaultValue", "class", "tabs"], outputs: ["tabChange"] }, { kind: "component", type: TabsListComponent, selector: "ui-tabs-list", inputs: ["class", "ariaLabel", "skeleton", "skeletonCount"] }, { kind: "component", type: TabsTriggerComponent, selector: "ui-tabs-trigger", inputs: ["value", "class"] }, { kind: "component", type: TabsContentComponent, selector: "ui-tabs-content", inputs: ["value", "class"] }, { kind: "component", type: IconComponent, selector: "ui-icon", inputs: ["name", "class", "size", "weight", "strokeWidth", "color", "fillColor"] }, { kind: "component", type: EyedropperComponent, selector: "ui-eyedropper", inputs: ["class", "disabled", "label", "variant", "locale", "fallbackTarget"], outputs: ["colorPick", "pickStart", "pickCancel"] }, { kind: "directive", type: TooltipDirective, selector: "[uiTooltip]", inputs: ["uiTooltip", "tooltipSide", "tooltipDisabled"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
29703
|
+
], viewQueries: [{ propertyName: "colorArea", first: true, predicate: ["colorArea"], descendants: true, isSignal: true }, { propertyName: "imageFile", first: true, predicate: ["imageFile"], descendants: true, isSignal: true }], ngImport: i0, template: "<ng-template #colorPanel>\n <div class=\"flex flex-col gap-3\">\n\n @if (enableEyedropper() || enableImagePick()) {\n <div class=\"flex items-center justify-end gap-1\">\n @if (enableEyedropper()) {\n <ui-eyedropper\n variant=\"icon\"\n [fallbackTarget]=\"fallbackTarget()\"\n (colorPick)=\"onEyedropperPick($event)\"\n uiTooltip=\"Pick color from screen\"\n />\n }\n @if (enableImagePick()) {\n <button\n type=\"button\"\n class=\"inline-flex h-9 w-9 items-center justify-center rounded-md border border-input bg-background text-sm font-medium ring-offset-background transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2\"\n (click)=\"openImagePicker()\"\n [attr.aria-label]=\"t().pickColorFromImage\"\n data-slot=\"image-pick-trigger\"\n uiTooltip=\"Pick color from image\"\n >\n <ui-icon name=\"pipette-image\" class=\"h-4 w-4\" />\n </button>\n <input\n #imageFile\n type=\"file\"\n accept=\"image/*\"\n hidden\n (change)=\"onImageSelected($event)\"\n />\n }\n </div>\n }\n\n <div\n #colorArea\n class=\"relative h-32 w-full cursor-crosshair rounded-md outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2\"\n style=\"touch-action: none\"\n [style.background]=\"areaBackground()\"\n tabindex=\"0\"\n role=\"slider\"\n [attr.aria-label]=\"t().saturationValue\"\n [attr.aria-valuenow]=\"saturation()\"\n [attr.aria-valuemin]=\"0\"\n [attr.aria-valuemax]=\"100\"\n [attr.aria-valuetext]=\"'S ' + saturation() + '%, V ' + hsvValue() + '%'\"\n (mousedown)=\"onAreaMouseDown($event)\"\n (touchstart)=\"onAreaTouchStart($event)\"\n (keydown)=\"onAreaKeyDown($event)\"\n >\n <div\n class=\"absolute h-4 w-4 -translate-x-1/2 -translate-y-1/2 rounded-full border-2 border-white shadow-sm pointer-events-none\"\n [style.left.%]=\"saturation()\"\n [style.top.%]=\"100 - hsvValue()\"\n [style.backgroundColor]=\"currentColor()\"\n ></div>\n </div>\n\n <div class=\"space-y-1\">\n <label for=\"ui-color-picker-hue\" class=\"text-xs text-muted-foreground\">Hue</label>\n <input\n id=\"ui-color-picker-hue\"\n type=\"range\"\n min=\"0\"\n max=\"360\"\n [value]=\"hue()\"\n (input)=\"onHueChange($event)\"\n [attr.aria-label]=\"t().hue\"\n class=\"w-full h-3 rounded-md cursor-pointer appearance-none\"\n [style.background]=\"hueGradient\"\n />\n </div>\n\n @if (alpha()) {\n <div class=\"space-y-1\">\n <label for=\"ui-color-picker-alpha\" class=\"text-xs text-muted-foreground\">Alpha</label>\n <div class=\"relative h-3 w-full rounded-md ui-color-picker-checker\">\n <input\n id=\"ui-color-picker-alpha\"\n type=\"range\"\n min=\"0\"\n max=\"100\"\n step=\"1\"\n [value]=\"alphaValue() * 100\"\n (input)=\"onAlphaChange($event)\"\n [attr.aria-label]=\"t().alpha\"\n class=\"absolute inset-0 w-full h-3 rounded-md cursor-pointer appearance-none\"\n [style.background]=\"alphaGradient()\"\n />\n </div>\n </div>\n }\n\n @if (showRecent() && recents().length > 0) {\n <fieldset class=\"space-y-1 border-0 p-0 m-0\">\n <legend class=\"text-xs text-muted-foreground p-0\">{{ t().recent }}</legend>\n <ul class=\"flex flex-wrap gap-1 list-none p-0 m-0\" [attr.aria-label]=\"t().recentColors\">\n @for (color of recents(); track color) {\n <li>\n <button\n type=\"button\"\n class=\"aspect-square w-6 rounded border cursor-pointer hover:scale-110 transition-transform ui-color-picker-checker\"\n [style.backgroundColor]=\"color\"\n (click)=\"selectPreset(color)\"\n [attr.aria-label]=\"'Apply recent ' + color\"\n ></button>\n </li>\n }\n </ul>\n </fieldset>\n }\n\n @if (extractedPalette().length > 0) {\n <fieldset class=\"space-y-1 border-0 p-0 m-0\">\n <div class=\"flex items-center justify-between\">\n <legend class=\"text-xs text-muted-foreground p-0\">From image</legend>\n <button\n type=\"button\"\n class=\"text-xs text-muted-foreground hover:text-foreground\"\n (click)=\"clearExtractedPalette()\"\n >Clear</button>\n </div>\n <ul class=\"flex flex-wrap gap-1 list-none p-0 m-0\" [attr.aria-label]=\"t().extractedPalette\">\n @for (color of extractedPalette(); track color) {\n <li>\n <button\n type=\"button\"\n class=\"aspect-square w-6 rounded border cursor-pointer hover:scale-110 transition-transform\"\n [style.backgroundColor]=\"color\"\n (click)=\"applyExtracted(color)\"\n [attr.aria-label]=\"'Apply extracted ' + color\"\n ></button>\n </li>\n }\n </ul>\n </fieldset>\n }\n\n @if (presets().length > 0) {\n <fieldset class=\"space-y-1 border-0 p-0 m-0\">\n <legend class=\"text-xs text-muted-foreground p-0\">Presets</legend>\n <div class=\"flex flex-wrap gap-1\">\n @for (color of presets(); track color) {\n <button\n type=\"button\"\n data-color-btn\n class=\"aspect-square w-6 rounded border cursor-pointer hover:scale-110 transition-transform\"\n [style.backgroundColor]=\"color\"\n [class.ring-2]=\"currentColor() === color\"\n [class.ring-primary]=\"currentColor() === color\"\n (click)=\"selectPreset(color)\"\n [attr.aria-label]=\"'Select ' + color\"\n ></button>\n }\n </div>\n </fieldset>\n }\n\n @if (showHarmonies()) {\n <fieldset class=\"space-y-1 border-0 p-0 m-0\">\n <legend class=\"text-xs text-muted-foreground p-0\">Harmonies</legend>\n <div class=\"space-y-1\">\n @for (group of harmonyGroups(); track group.label) {\n <div class=\"flex items-center gap-2\">\n <span\n class=\"w-20 text-[10px] text-muted-foreground cursor-help underline decoration-dotted underline-offset-2\"\n [uiTooltip]=\"group.hint\"\n >{{ group.label }}</span>\n <div class=\"flex items-center gap-1\">\n @for (color of group.swatches; track color) {\n <button\n type=\"button\"\n class=\"relative aspect-square w-5 rounded border cursor-pointer hover:scale-110 transition-transform\"\n [style.backgroundColor]=\"color\"\n (click)=\"copyHarmony(color)\"\n [uiTooltip]=\"copiedHarmony() === color ? 'Copied ' + color : 'Click to copy ' + color\"\n [attr.aria-label]=\"'Copy ' + color\"\n >\n @if (copiedHarmony() === color) {\n <span class=\"absolute inset-0 flex items-center justify-center rounded bg-foreground/80 text-background\">\n <ui-icon name=\"check\" class=\"h-3 w-3\" />\n </span>\n }\n </button>\n }\n @if (copiedHarmony(); as copied) {\n @if (groupContains(group, copied)) {\n <span class=\"ml-1 inline-flex items-center gap-1 rounded bg-green-500/15 px-1.5 py-0.5 text-[10px] font-medium text-green-700 dark:text-green-300\">\n <ui-icon name=\"check\" class=\"h-3 w-3\" />\n {{ copied }}\n </span>\n }\n }\n </div>\n </div>\n }\n </div>\n </fieldset>\n }\n\n @if (showContrast() && contrastBadge(); as badge) {\n <div class=\"mt-3 flex items-center justify-between gap-2 rounded-md border border-input px-2 py-1.5\">\n <div class=\"flex items-center gap-2 min-w-0\">\n <button\n type=\"button\"\n class=\"flex flex-col items-center gap-0.5 rounded p-1 transition focus:outline-none\"\n [class.ring-2]=\"compareActive() === 'a'\"\n [class.ring-ring]=\"compareActive() === 'a'\"\n (click)=\"setCompareSlot('a')\"\n uiTooltip=\"Edit color A with the picker above\"\n [attr.aria-label]=\"t().editColorA + ' ' + compareAHex()\"\n >\n <span\n class=\"block h-6 w-6 rounded border\"\n [style.backgroundColor]=\"compareAHex()\"\n ></span>\n <span class=\"font-mono text-[9px] text-muted-foreground\">{{ compareAHex() }}</span>\n </button>\n <span class=\"text-xs text-muted-foreground shrink-0\">vs</span>\n <button\n type=\"button\"\n class=\"flex flex-col items-center gap-0.5 rounded p-1 transition focus:outline-none\"\n [class.ring-2]=\"compareActive() === 'b'\"\n [class.ring-ring]=\"compareActive() === 'b'\"\n (click)=\"setCompareSlot('b')\"\n uiTooltip=\"Edit color B with the picker above\"\n [attr.aria-label]=\"t().editColorB + ' ' + compareBHex()\"\n >\n <span\n class=\"block h-6 w-6 rounded border\"\n [style.backgroundColor]=\"compareBHex()\"\n ></span>\n <span class=\"font-mono text-[9px] text-muted-foreground\">{{ compareBHex() }}</span>\n </button>\n </div>\n <div class=\"flex items-center gap-2 shrink-0\">\n <span class=\"font-mono text-xs\">{{ contrastRatioDisplay() }}:1</span>\n <span\n class=\"rounded px-1.5 py-0.5 text-[10px] font-semibold\"\n [class.bg-green-700]=\"badge.pass\"\n [class.text-white]=\"badge.pass\"\n [class.bg-destructive]=\"!badge.pass\"\n [class.text-destructive-foreground]=\"!badge.pass\"\n >{{ badge.label }}</span>\n </div>\n </div>\n }\n\n <ui-tabs [defaultValue]=\"formats()[0]\">\n <ui-tabs-list class=\"flex justify-start w-full h-8 gap-1\">\n @for (fmt of formats(); track fmt) {\n <ui-tabs-trigger [value]=\"fmt\" class=\"text-xs uppercase\">{{ fmt }}</ui-tabs-trigger>\n }\n </ui-tabs-list>\n\n @if (formats().includes('hex')) {\n <ui-tabs-content value=\"hex\" class=\"mt-2\">\n <div class=\"flex items-center gap-1\">\n <ui-input\n type=\"text\"\n [ngModel]=\"formatValues().hex\"\n (ngModelChange)=\"onHexInput($event)\"\n placeholder=\"#000000\"\n class=\"h-8 text-xs font-mono flex-1\"\n />\n <button\n type=\"button\"\n class=\"inline-flex h-8 w-8 pointer-coarse:size-11 items-center justify-center rounded-md text-muted-foreground hover:text-foreground\"\n (click)=\"copy('hex')\"\n [attr.aria-label]=\"t().copyHex\"\n >\n <ui-icon [name]=\"copiedFormat() === 'hex' ? 'check' : 'copy'\" class=\"h-4 w-4\" />\n </button>\n </div>\n </ui-tabs-content>\n }\n\n @if (formats().includes('rgb')) {\n <ui-tabs-content value=\"rgb\" class=\"mt-2\">\n <div class=\"space-y-2\">\n <div class=\"grid grid-cols-3 gap-2\">\n <div>\n <span class=\"text-xs text-muted-foreground\" aria-hidden=\"true\">R</span>\n <ui-input\n type=\"number\"\n min=\"0\"\n max=\"255\"\n [ngModel]=\"rgb().r\"\n (ngModelChange)=\"onRgbChange('r', $event)\"\n [attr.aria-label]=\"t().red\"\n class=\"h-8 text-xs\"\n />\n </div>\n <div>\n <span class=\"text-xs text-muted-foreground\" aria-hidden=\"true\">G</span>\n <ui-input\n type=\"number\"\n min=\"0\"\n max=\"255\"\n [ngModel]=\"rgb().g\"\n (ngModelChange)=\"onRgbChange('g', $event)\"\n [attr.aria-label]=\"t().green\"\n class=\"h-8 text-xs\"\n />\n </div>\n <div>\n <span class=\"text-xs text-muted-foreground\" aria-hidden=\"true\">B</span>\n <ui-input\n type=\"number\"\n min=\"0\"\n max=\"255\"\n [ngModel]=\"rgb().b\"\n (ngModelChange)=\"onRgbChange('b', $event)\"\n [attr.aria-label]=\"t().blue\"\n class=\"h-8 text-xs\"\n />\n </div>\n </div>\n <div class=\"flex items-center gap-1\">\n <span class=\"flex-1 truncate text-xs font-mono text-muted-foreground\">{{ formatValues().rgb }}</span>\n <button\n type=\"button\"\n class=\"inline-flex h-7 w-7 pointer-coarse:size-11 items-center justify-center rounded-md text-muted-foreground hover:text-foreground\"\n (click)=\"copy('rgb')\"\n [attr.aria-label]=\"t().copyRgb\"\n >\n <ui-icon [name]=\"copiedFormat() === 'rgb' ? 'check' : 'copy'\" class=\"h-4 w-4\" />\n </button>\n </div>\n </div>\n </ui-tabs-content>\n }\n\n @if (formats().includes('hsl')) {\n <ui-tabs-content value=\"hsl\" class=\"mt-2\">\n <div class=\"space-y-2\">\n <div class=\"grid grid-cols-3 gap-2\">\n <div>\n <span class=\"text-xs text-muted-foreground\" aria-hidden=\"true\">H</span>\n <ui-input\n type=\"number\"\n min=\"0\"\n max=\"360\"\n [ngModel]=\"hsl().h\"\n (ngModelChange)=\"onHslHueChange($event)\"\n [attr.aria-label]=\"t().hue\"\n class=\"h-8 text-xs\"\n />\n </div>\n <div>\n <span class=\"text-xs text-muted-foreground\" aria-hidden=\"true\">S</span>\n <ui-input\n type=\"number\"\n min=\"0\"\n max=\"100\"\n [ngModel]=\"hsl().s\"\n (ngModelChange)=\"onHslChange('s', $event)\"\n [attr.aria-label]=\"t().saturation\"\n class=\"h-8 text-xs\"\n />\n </div>\n <div>\n <span class=\"text-xs text-muted-foreground\" aria-hidden=\"true\">L</span>\n <ui-input\n type=\"number\"\n min=\"0\"\n max=\"100\"\n [ngModel]=\"hsl().l\"\n (ngModelChange)=\"onHslChange('l', $event)\"\n [attr.aria-label]=\"t().lightness\"\n class=\"h-8 text-xs\"\n />\n </div>\n </div>\n <div class=\"flex items-center gap-1\">\n <span class=\"flex-1 truncate text-xs font-mono text-muted-foreground\">{{ formatValues().hsl }}</span>\n <button\n type=\"button\"\n class=\"inline-flex h-7 w-7 pointer-coarse:size-11 items-center justify-center rounded-md text-muted-foreground hover:text-foreground\"\n (click)=\"copy('hsl')\"\n [attr.aria-label]=\"t().copyHsl\"\n >\n <ui-icon [name]=\"copiedFormat() === 'hsl' ? 'check' : 'copy'\" class=\"h-4 w-4\" />\n </button>\n </div>\n </div>\n </ui-tabs-content>\n }\n\n @if (formats().includes('oklch')) {\n <ui-tabs-content value=\"oklch\" class=\"mt-2\">\n <div class=\"flex items-center gap-1\">\n <span class=\"flex-1 truncate text-xs font-mono text-muted-foreground\">{{ formatValues().oklch }}</span>\n <button\n type=\"button\"\n class=\"inline-flex h-7 w-7 pointer-coarse:size-11 items-center justify-center rounded-md text-muted-foreground hover:text-foreground\"\n (click)=\"copy('oklch')\"\n [attr.aria-label]=\"t().copyOklch\"\n >\n <ui-icon [name]=\"copiedFormat() === 'oklch' ? 'check' : 'copy'\" class=\"h-4 w-4\" />\n </button>\n </div>\n </ui-tabs-content>\n }\n </ui-tabs>\n </div>\n</ng-template>\n\n@if (inline()) {\n <ng-container [ngTemplateOutlet]=\"colorPanel\" />\n} @else {\n <ui-popover [open]=\"open()\" (openChange)=\"open.set($event)\" [attr.dir]=\"dir()\">\n <ui-popover-trigger>\n <ng-content select=\"[colorPickerTrigger]\" />\n @if (!hasTrigger()) {\n <button\n type=\"button\"\n [class]=\"triggerClasses()\"\n [disabled]=\"isDisabled()\"\n [attr.data-slot]=\"'color-picker-trigger'\"\n >\n <span\n class=\"h-6 w-6 rounded border ui-color-picker-checker\"\n [style.backgroundColor]=\"currentColor()\"\n ></span>\n <span class=\"flex-1 text-start text-sm truncate font-mono\">{{ currentColor() || 'Select color' }}</span>\n <span class=\"inline-flex opacity-50\"><ui-icon name=\"chevron-down\" class=\"h-4 w-4\" /></span>\n </button>\n }\n </ui-popover-trigger>\n <ui-popover-content class=\"w-72 p-3\" align=\"start\" [restoreFocus]=\"false\">\n <ng-container [ngTemplateOutlet]=\"colorPanel\" />\n </ui-popover-content>\n </ui-popover>\n}\n", styles: [":host{--_d: var(--density-picker, var(--density, 1))}@layer components{[data-slot=color-picker-trigger]{height:calc(2.5rem * var(--_d));padding-inline:calc(.75rem * var(--_d));padding-block:calc(.5rem * var(--_d));gap:calc(.5rem * var(--_d))}.ui-color-picker-checker{background-image:linear-gradient(45deg,hsl(0 0% 80%) 25%,transparent 25%),linear-gradient(-45deg,hsl(0 0% 80%) 25%,transparent 25%),linear-gradient(45deg,transparent 75%,hsl(0 0% 80%) 75%),linear-gradient(-45deg,transparent 75%,hsl(0 0% 80%) 75%);background-size:8px 8px;background-position:0 0,0 4px,4px -4px,-4px 0}}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: PopoverComponent, selector: "ui-popover", inputs: ["class", "open", "closeOnScroll"], outputs: ["openChange"] }, { kind: "component", type: PopoverTriggerComponent, selector: "ui-popover-trigger", inputs: ["class"] }, { kind: "component", type: PopoverContentComponent, selector: "ui-popover-content", inputs: ["class", "align", "side", "sideOffset", "avoidCollisions", "restoreFocus", "strategy"] }, { kind: "component", type: InputComponent, selector: "ui-input", inputs: ["type", "placeholder", "disabled", "class", "elementId", "name", "ariaLabel", "ariaLabelledby", "ariaDescribedby", "variant", "loading", "skeleton", "autofocus", "clearable", "floating", "label", "labelClass", "inputMode", "lang", "prefix", "suffix", "value"], outputs: ["valueChange"] }, { kind: "component", type: TabsComponent, selector: "ui-tabs", inputs: ["defaultValue", "class", "tabs"], outputs: ["tabChange"] }, { kind: "component", type: TabsListComponent, selector: "ui-tabs-list", inputs: ["class", "ariaLabel", "skeleton", "skeletonCount"] }, { kind: "component", type: TabsTriggerComponent, selector: "ui-tabs-trigger", inputs: ["value", "class"] }, { kind: "component", type: TabsContentComponent, selector: "ui-tabs-content", inputs: ["value", "class"] }, { kind: "component", type: IconComponent, selector: "ui-icon", inputs: ["name", "class", "size", "weight", "strokeWidth", "color", "fillColor"] }, { kind: "component", type: EyedropperComponent, selector: "ui-eyedropper", inputs: ["class", "disabled", "label", "variant", "locale", "fallbackTarget"], outputs: ["colorPick", "pickStart", "pickCancel"] }, { kind: "directive", type: TooltipDirective, selector: "[uiTooltip]", inputs: ["uiTooltip", "tooltipSide", "tooltipDisabled"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
29477
29704
|
}
|
|
29478
29705
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: ColorPickerComponent, decorators: [{
|
|
29479
29706
|
type: Component,
|
|
@@ -29497,7 +29724,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
|
|
|
29497
29724
|
useExisting: forwardRef(() => ColorPickerComponent),
|
|
29498
29725
|
multi: true,
|
|
29499
29726
|
},
|
|
29500
|
-
], host: { class: 'inline-block' }, template: "<ng-template #colorPanel>\n <div class=\"flex flex-col gap-3\">\n\n @if (enableEyedropper() || enableImagePick()) {\n <div class=\"flex items-center justify-end gap-1\">\n @if (enableEyedropper()) {\n <ui-eyedropper\n variant=\"icon\"\n [fallbackTarget]=\"fallbackTarget()\"\n (colorPick)=\"onEyedropperPick($event)\"\n uiTooltip=\"Pick color from screen\"\n />\n }\n @if (enableImagePick()) {\n <button\n type=\"button\"\n class=\"inline-flex h-9 w-9 items-center justify-center rounded-md border border-input bg-background text-sm font-medium ring-offset-background transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2\"\n (click)=\"openImagePicker()\"\n [attr.aria-label]=\"t().pickColorFromImage\"\n data-slot=\"image-pick-trigger\"\n uiTooltip=\"Pick color from image\"\n >\n <ui-icon name=\"pipette-image\" class=\"h-4 w-4\" />\n </button>\n <input\n #imageFile\n type=\"file\"\n accept=\"image/*\"\n hidden\n (change)=\"onImageSelected($event)\"\n />\n }\n </div>\n }\n\n <div\n #colorArea\n class=\"relative h-32 w-full cursor-crosshair rounded-md outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2\"\n style=\"touch-action: none\"\n [style.background]=\"areaBackground()\"\n tabindex=\"0\"\n role=\"slider\"\n [attr.aria-label]=\"t().saturationValue\"\n [attr.aria-valuenow]=\"saturation()\"\n [attr.aria-valuemin]=\"0\"\n [attr.aria-valuemax]=\"100\"\n [attr.aria-valuetext]=\"'S ' + saturation() + '%, V ' + hsvValue() + '%'\"\n (mousedown)=\"onAreaMouseDown($event)\"\n (touchstart)=\"onAreaTouchStart($event)\"\n (keydown)=\"onAreaKeyDown($event)\"\n >\n <div\n class=\"absolute h-4 w-4 -translate-x-1/2 -translate-y-1/2 rounded-full border-2 border-white shadow-sm pointer-events-none\"\n [style.left.%]=\"saturation()\"\n [style.top.%]=\"100 - hsvValue()\"\n [style.backgroundColor]=\"currentColor()\"\n ></div>\n </div>\n\n <div class=\"space-y-1\">\n <label for=\"ui-color-picker-hue\" class=\"text-xs text-muted-foreground\">Hue</label>\n <input\n id=\"ui-color-picker-hue\"\n type=\"range\"\n min=\"0\"\n max=\"360\"\n [value]=\"hue()\"\n (input)=\"onHueChange($event)\"\n [attr.aria-label]=\"t().hue\"\n class=\"w-full h-3 rounded-md cursor-pointer appearance-none\"\n [style.background]=\"hueGradient\"\n />\n </div>\n\n @if (alpha()) {\n <div class=\"space-y-1\">\n <label for=\"ui-color-picker-alpha\" class=\"text-xs text-muted-foreground\">Alpha</label>\n <div class=\"relative h-3 w-full rounded-md ui-color-picker-checker\">\n <input\n id=\"ui-color-picker-alpha\"\n type=\"range\"\n min=\"0\"\n max=\"100\"\n step=\"1\"\n [value]=\"alphaValue() * 100\"\n (input)=\"onAlphaChange($event)\"\n [attr.aria-label]=\"t().alpha\"\n class=\"absolute inset-0 w-full h-3 rounded-md cursor-pointer appearance-none\"\n [style.background]=\"alphaGradient()\"\n />\n </div>\n </div>\n }\n\n @if (showRecent() && recents().length > 0) {\n <fieldset class=\"space-y-1 border-0 p-0 m-0\">\n <legend class=\"text-xs text-muted-foreground p-0\">{{ t().recent }}</legend>\n <ul class=\"flex flex-wrap gap-1 list-none p-0 m-0\" [attr.aria-label]=\"t().recentColors\">\n @for (color of recents(); track color) {\n <li>\n <button\n type=\"button\"\n class=\"aspect-square w-6 rounded border cursor-pointer hover:scale-110 transition-transform ui-color-picker-checker\"\n [style.backgroundColor]=\"color\"\n (click)=\"selectPreset(color)\"\n [attr.aria-label]=\"'Apply recent ' + color\"\n ></button>\n </li>\n }\n </ul>\n </fieldset>\n }\n\n @if (extractedPalette().length > 0) {\n <fieldset class=\"space-y-1 border-0 p-0 m-0\">\n <div class=\"flex items-center justify-between\">\n <legend class=\"text-xs text-muted-foreground p-0\">From image</legend>\n <button\n type=\"button\"\n class=\"text-xs text-muted-foreground hover:text-foreground\"\n (click)=\"clearExtractedPalette()\"\n >Clear</button>\n </div>\n <ul class=\"flex flex-wrap gap-1 list-none p-0 m-0\" [attr.aria-label]=\"t().extractedPalette\">\n @for (color of extractedPalette(); track color) {\n <li>\n <button\n type=\"button\"\n class=\"aspect-square w-6 rounded border cursor-pointer hover:scale-110 transition-transform\"\n [style.backgroundColor]=\"color\"\n (click)=\"applyExtracted(color)\"\n [attr.aria-label]=\"'Apply extracted ' + color\"\n ></button>\n </li>\n }\n </ul>\n </fieldset>\n }\n\n @if (presets().length > 0) {\n <fieldset class=\"space-y-1 border-0 p-0 m-0\">\n <legend class=\"text-xs text-muted-foreground p-0\">Presets</legend>\n <div class=\"flex flex-wrap gap-1\">\n @for (color of presets(); track color) {\n <button\n type=\"button\"\n data-color-btn\n class=\"aspect-square w-6 rounded border cursor-pointer hover:scale-110 transition-transform\"\n [style.backgroundColor]=\"color\"\n [class.ring-2]=\"currentColor() === color\"\n [class.ring-primary]=\"currentColor() === color\"\n (click)=\"selectPreset(color)\"\n [attr.aria-label]=\"'Select ' + color\"\n ></button>\n }\n </div>\n </fieldset>\n }\n\n @if (showHarmonies()) {\n <fieldset class=\"space-y-1 border-0 p-0 m-0\">\n <legend class=\"text-xs text-muted-foreground p-0\">Harmonies</legend>\n <div class=\"space-y-1\">\n @for (group of harmonyGroups(); track group.label) {\n <div class=\"flex items-center gap-2\">\n <span\n class=\"w-20 text-[10px] text-muted-foreground cursor-help underline decoration-dotted underline-offset-2\"\n [uiTooltip]=\"group.hint\"\n >{{ group.label }}</span>\n <div class=\"flex items-center gap-1\">\n @for (color of group.swatches; track color) {\n <button\n type=\"button\"\n class=\"relative aspect-square w-5 rounded border cursor-pointer hover:scale-110 transition-transform\"\n [style.backgroundColor]=\"color\"\n (click)=\"copyHarmony(color)\"\n [uiTooltip]=\"copiedHarmony() === color ? 'Copied ' + color : 'Click to copy ' + color\"\n [attr.aria-label]=\"'Copy ' + color\"\n >\n @if (copiedHarmony() === color) {\n <span class=\"absolute inset-0 flex items-center justify-center rounded bg-foreground/80 text-background\">\n <ui-icon name=\"check\" class=\"h-3 w-3\" />\n </span>\n }\n </button>\n }\n @if (copiedHarmony(); as copied) {\n @if (groupContains(group, copied)) {\n <span class=\"ml-1 inline-flex items-center gap-1 rounded bg-green-500/15 px-1.5 py-0.5 text-[10px] font-medium text-green-700 dark:text-green-300\">\n <ui-icon name=\"check\" class=\"h-3 w-3\" />\n {{ copied }}\n </span>\n }\n }\n </div>\n </div>\n }\n </div>\n </fieldset>\n }\n\n @if (showContrast() && contrastBadge(); as badge) {\n <div class=\"mt-3 flex items-center justify-between gap-2 rounded-md border border-input px-2 py-1.5\">\n <div class=\"flex items-center gap-2 min-w-0\">\n <button\n type=\"button\"\n class=\"flex flex-col items-center gap-0.5 rounded p-1 transition focus:outline-none\"\n [class.ring-2]=\"compareActive() === 'a'\"\n [class.ring-ring]=\"compareActive() === 'a'\"\n (click)=\"setCompareSlot('a')\"\n uiTooltip=\"Edit color A with the picker above\"\n [attr.aria-label]=\"t().editColorA\"\n >\n <span\n class=\"block h-6 w-6 rounded border\"\n [style.backgroundColor]=\"compareAHex()\"\n ></span>\n <span class=\"font-mono text-[9px] text-muted-foreground\">{{ compareAHex() }}</span>\n </button>\n <span class=\"text-xs text-muted-foreground shrink-0\">vs</span>\n <button\n type=\"button\"\n class=\"flex flex-col items-center gap-0.5 rounded p-1 transition focus:outline-none\"\n [class.ring-2]=\"compareActive() === 'b'\"\n [class.ring-ring]=\"compareActive() === 'b'\"\n (click)=\"setCompareSlot('b')\"\n uiTooltip=\"Edit color B with the picker above\"\n [attr.aria-label]=\"t().editColorB\"\n >\n <span\n class=\"block h-6 w-6 rounded border\"\n [style.backgroundColor]=\"compareBHex()\"\n ></span>\n <span class=\"font-mono text-[9px] text-muted-foreground\">{{ compareBHex() }}</span>\n </button>\n </div>\n <div class=\"flex items-center gap-2 shrink-0\">\n <span class=\"font-mono text-xs\">{{ contrastRatioDisplay() }}:1</span>\n <span\n class=\"rounded px-1.5 py-0.5 text-[10px] font-semibold\"\n [class.bg-green-500]=\"badge.pass\"\n [class.text-white]=\"badge.pass\"\n [class.bg-destructive]=\"!badge.pass\"\n [class.text-destructive-foreground]=\"!badge.pass\"\n >{{ badge.label }}</span>\n </div>\n </div>\n }\n\n <ui-tabs [defaultValue]=\"formats()[0]\">\n <ui-tabs-list class=\"flex justify-start w-full h-8 gap-1\">\n @for (fmt of formats(); track fmt) {\n <ui-tabs-trigger [value]=\"fmt\" class=\"text-xs uppercase\">{{ fmt }}</ui-tabs-trigger>\n }\n </ui-tabs-list>\n\n @if (formats().includes('hex')) {\n <ui-tabs-content value=\"hex\" class=\"mt-2\">\n <div class=\"flex items-center gap-1\">\n <ui-input\n type=\"text\"\n [ngModel]=\"formatValues().hex\"\n (ngModelChange)=\"onHexInput($event)\"\n placeholder=\"#000000\"\n class=\"h-8 text-xs font-mono flex-1\"\n />\n <button\n type=\"button\"\n class=\"inline-flex h-8 w-8 pointer-coarse:size-11 items-center justify-center rounded-md text-muted-foreground hover:text-foreground\"\n (click)=\"copy('hex')\"\n [attr.aria-label]=\"t().copyHex\"\n >\n <ui-icon [name]=\"copiedFormat() === 'hex' ? 'check' : 'copy'\" class=\"h-4 w-4\" />\n </button>\n </div>\n </ui-tabs-content>\n }\n\n @if (formats().includes('rgb')) {\n <ui-tabs-content value=\"rgb\" class=\"mt-2\">\n <div class=\"space-y-2\">\n <div class=\"grid grid-cols-3 gap-2\">\n <div>\n <span class=\"text-xs text-muted-foreground\" aria-hidden=\"true\">R</span>\n <ui-input\n type=\"number\"\n min=\"0\"\n max=\"255\"\n [ngModel]=\"rgb().r\"\n (ngModelChange)=\"onRgbChange('r', $event)\"\n [attr.aria-label]=\"t().red\"\n class=\"h-8 text-xs\"\n />\n </div>\n <div>\n <span class=\"text-xs text-muted-foreground\" aria-hidden=\"true\">G</span>\n <ui-input\n type=\"number\"\n min=\"0\"\n max=\"255\"\n [ngModel]=\"rgb().g\"\n (ngModelChange)=\"onRgbChange('g', $event)\"\n [attr.aria-label]=\"t().green\"\n class=\"h-8 text-xs\"\n />\n </div>\n <div>\n <span class=\"text-xs text-muted-foreground\" aria-hidden=\"true\">B</span>\n <ui-input\n type=\"number\"\n min=\"0\"\n max=\"255\"\n [ngModel]=\"rgb().b\"\n (ngModelChange)=\"onRgbChange('b', $event)\"\n [attr.aria-label]=\"t().blue\"\n class=\"h-8 text-xs\"\n />\n </div>\n </div>\n <div class=\"flex items-center gap-1\">\n <span class=\"flex-1 truncate text-xs font-mono text-muted-foreground\">{{ formatValues().rgb }}</span>\n <button\n type=\"button\"\n class=\"inline-flex h-7 w-7 pointer-coarse:size-11 items-center justify-center rounded-md text-muted-foreground hover:text-foreground\"\n (click)=\"copy('rgb')\"\n [attr.aria-label]=\"t().copyRgb\"\n >\n <ui-icon [name]=\"copiedFormat() === 'rgb' ? 'check' : 'copy'\" class=\"h-4 w-4\" />\n </button>\n </div>\n </div>\n </ui-tabs-content>\n }\n\n @if (formats().includes('hsl')) {\n <ui-tabs-content value=\"hsl\" class=\"mt-2\">\n <div class=\"space-y-2\">\n <div class=\"grid grid-cols-3 gap-2\">\n <div>\n <span class=\"text-xs text-muted-foreground\" aria-hidden=\"true\">H</span>\n <ui-input\n type=\"number\"\n min=\"0\"\n max=\"360\"\n [ngModel]=\"hsl().h\"\n (ngModelChange)=\"onHslHueChange($event)\"\n [attr.aria-label]=\"t().hue\"\n class=\"h-8 text-xs\"\n />\n </div>\n <div>\n <span class=\"text-xs text-muted-foreground\" aria-hidden=\"true\">S</span>\n <ui-input\n type=\"number\"\n min=\"0\"\n max=\"100\"\n [ngModel]=\"hsl().s\"\n (ngModelChange)=\"onHslChange('s', $event)\"\n [attr.aria-label]=\"t().saturation\"\n class=\"h-8 text-xs\"\n />\n </div>\n <div>\n <span class=\"text-xs text-muted-foreground\" aria-hidden=\"true\">L</span>\n <ui-input\n type=\"number\"\n min=\"0\"\n max=\"100\"\n [ngModel]=\"hsl().l\"\n (ngModelChange)=\"onHslChange('l', $event)\"\n [attr.aria-label]=\"t().lightness\"\n class=\"h-8 text-xs\"\n />\n </div>\n </div>\n <div class=\"flex items-center gap-1\">\n <span class=\"flex-1 truncate text-xs font-mono text-muted-foreground\">{{ formatValues().hsl }}</span>\n <button\n type=\"button\"\n class=\"inline-flex h-7 w-7 pointer-coarse:size-11 items-center justify-center rounded-md text-muted-foreground hover:text-foreground\"\n (click)=\"copy('hsl')\"\n [attr.aria-label]=\"t().copyHsl\"\n >\n <ui-icon [name]=\"copiedFormat() === 'hsl' ? 'check' : 'copy'\" class=\"h-4 w-4\" />\n </button>\n </div>\n </div>\n </ui-tabs-content>\n }\n\n @if (formats().includes('oklch')) {\n <ui-tabs-content value=\"oklch\" class=\"mt-2\">\n <div class=\"flex items-center gap-1\">\n <span class=\"flex-1 truncate text-xs font-mono text-muted-foreground\">{{ formatValues().oklch }}</span>\n <button\n type=\"button\"\n class=\"inline-flex h-7 w-7 pointer-coarse:size-11 items-center justify-center rounded-md text-muted-foreground hover:text-foreground\"\n (click)=\"copy('oklch')\"\n [attr.aria-label]=\"t().copyOklch\"\n >\n <ui-icon [name]=\"copiedFormat() === 'oklch' ? 'check' : 'copy'\" class=\"h-4 w-4\" />\n </button>\n </div>\n </ui-tabs-content>\n }\n </ui-tabs>\n </div>\n</ng-template>\n\n@if (inline()) {\n <ng-container [ngTemplateOutlet]=\"colorPanel\" />\n} @else {\n <ui-popover [open]=\"open()\" (openChange)=\"open.set($event)\" [attr.dir]=\"dir()\">\n <ui-popover-trigger>\n <ng-content select=\"[colorPickerTrigger]\" />\n @if (!hasTrigger()) {\n <button\n type=\"button\"\n [class]=\"triggerClasses()\"\n [disabled]=\"isDisabled()\"\n [attr.data-slot]=\"'color-picker-trigger'\"\n >\n <span\n class=\"h-6 w-6 rounded border ui-color-picker-checker\"\n [style.backgroundColor]=\"currentColor()\"\n ></span>\n <span class=\"flex-1 text-start text-sm truncate font-mono\">{{ currentColor() || 'Select color' }}</span>\n <ui-icon name=\"chevron-down\" class=\"h-4 w-4 opacity-50\" />\n </button>\n }\n </ui-popover-trigger>\n <ui-popover-content class=\"w-72 p-3\" align=\"start\" [restoreFocus]=\"false\">\n <ng-container [ngTemplateOutlet]=\"colorPanel\" />\n </ui-popover-content>\n </ui-popover>\n}\n", styles: [":host{--_d: var(--density-picker, var(--density, 1))}@layer components{[data-slot=color-picker-trigger]{height:calc(2.5rem * var(--_d));padding-inline:calc(.75rem * var(--_d));padding-block:calc(.5rem * var(--_d));gap:calc(.5rem * var(--_d))}.ui-color-picker-checker{background-image:linear-gradient(45deg,hsl(0 0% 80%) 25%,transparent 25%),linear-gradient(-45deg,hsl(0 0% 80%) 25%,transparent 25%),linear-gradient(45deg,transparent 75%,hsl(0 0% 80%) 75%),linear-gradient(-45deg,transparent 75%,hsl(0 0% 80%) 75%);background-size:8px 8px;background-position:0 0,0 4px,4px -4px,-4px 0}}\n"] }]
|
|
29727
|
+
], host: { class: 'inline-block' }, template: "<ng-template #colorPanel>\n <div class=\"flex flex-col gap-3\">\n\n @if (enableEyedropper() || enableImagePick()) {\n <div class=\"flex items-center justify-end gap-1\">\n @if (enableEyedropper()) {\n <ui-eyedropper\n variant=\"icon\"\n [fallbackTarget]=\"fallbackTarget()\"\n (colorPick)=\"onEyedropperPick($event)\"\n uiTooltip=\"Pick color from screen\"\n />\n }\n @if (enableImagePick()) {\n <button\n type=\"button\"\n class=\"inline-flex h-9 w-9 items-center justify-center rounded-md border border-input bg-background text-sm font-medium ring-offset-background transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2\"\n (click)=\"openImagePicker()\"\n [attr.aria-label]=\"t().pickColorFromImage\"\n data-slot=\"image-pick-trigger\"\n uiTooltip=\"Pick color from image\"\n >\n <ui-icon name=\"pipette-image\" class=\"h-4 w-4\" />\n </button>\n <input\n #imageFile\n type=\"file\"\n accept=\"image/*\"\n hidden\n (change)=\"onImageSelected($event)\"\n />\n }\n </div>\n }\n\n <div\n #colorArea\n class=\"relative h-32 w-full cursor-crosshair rounded-md outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2\"\n style=\"touch-action: none\"\n [style.background]=\"areaBackground()\"\n tabindex=\"0\"\n role=\"slider\"\n [attr.aria-label]=\"t().saturationValue\"\n [attr.aria-valuenow]=\"saturation()\"\n [attr.aria-valuemin]=\"0\"\n [attr.aria-valuemax]=\"100\"\n [attr.aria-valuetext]=\"'S ' + saturation() + '%, V ' + hsvValue() + '%'\"\n (mousedown)=\"onAreaMouseDown($event)\"\n (touchstart)=\"onAreaTouchStart($event)\"\n (keydown)=\"onAreaKeyDown($event)\"\n >\n <div\n class=\"absolute h-4 w-4 -translate-x-1/2 -translate-y-1/2 rounded-full border-2 border-white shadow-sm pointer-events-none\"\n [style.left.%]=\"saturation()\"\n [style.top.%]=\"100 - hsvValue()\"\n [style.backgroundColor]=\"currentColor()\"\n ></div>\n </div>\n\n <div class=\"space-y-1\">\n <label for=\"ui-color-picker-hue\" class=\"text-xs text-muted-foreground\">Hue</label>\n <input\n id=\"ui-color-picker-hue\"\n type=\"range\"\n min=\"0\"\n max=\"360\"\n [value]=\"hue()\"\n (input)=\"onHueChange($event)\"\n [attr.aria-label]=\"t().hue\"\n class=\"w-full h-3 rounded-md cursor-pointer appearance-none\"\n [style.background]=\"hueGradient\"\n />\n </div>\n\n @if (alpha()) {\n <div class=\"space-y-1\">\n <label for=\"ui-color-picker-alpha\" class=\"text-xs text-muted-foreground\">Alpha</label>\n <div class=\"relative h-3 w-full rounded-md ui-color-picker-checker\">\n <input\n id=\"ui-color-picker-alpha\"\n type=\"range\"\n min=\"0\"\n max=\"100\"\n step=\"1\"\n [value]=\"alphaValue() * 100\"\n (input)=\"onAlphaChange($event)\"\n [attr.aria-label]=\"t().alpha\"\n class=\"absolute inset-0 w-full h-3 rounded-md cursor-pointer appearance-none\"\n [style.background]=\"alphaGradient()\"\n />\n </div>\n </div>\n }\n\n @if (showRecent() && recents().length > 0) {\n <fieldset class=\"space-y-1 border-0 p-0 m-0\">\n <legend class=\"text-xs text-muted-foreground p-0\">{{ t().recent }}</legend>\n <ul class=\"flex flex-wrap gap-1 list-none p-0 m-0\" [attr.aria-label]=\"t().recentColors\">\n @for (color of recents(); track color) {\n <li>\n <button\n type=\"button\"\n class=\"aspect-square w-6 rounded border cursor-pointer hover:scale-110 transition-transform ui-color-picker-checker\"\n [style.backgroundColor]=\"color\"\n (click)=\"selectPreset(color)\"\n [attr.aria-label]=\"'Apply recent ' + color\"\n ></button>\n </li>\n }\n </ul>\n </fieldset>\n }\n\n @if (extractedPalette().length > 0) {\n <fieldset class=\"space-y-1 border-0 p-0 m-0\">\n <div class=\"flex items-center justify-between\">\n <legend class=\"text-xs text-muted-foreground p-0\">From image</legend>\n <button\n type=\"button\"\n class=\"text-xs text-muted-foreground hover:text-foreground\"\n (click)=\"clearExtractedPalette()\"\n >Clear</button>\n </div>\n <ul class=\"flex flex-wrap gap-1 list-none p-0 m-0\" [attr.aria-label]=\"t().extractedPalette\">\n @for (color of extractedPalette(); track color) {\n <li>\n <button\n type=\"button\"\n class=\"aspect-square w-6 rounded border cursor-pointer hover:scale-110 transition-transform\"\n [style.backgroundColor]=\"color\"\n (click)=\"applyExtracted(color)\"\n [attr.aria-label]=\"'Apply extracted ' + color\"\n ></button>\n </li>\n }\n </ul>\n </fieldset>\n }\n\n @if (presets().length > 0) {\n <fieldset class=\"space-y-1 border-0 p-0 m-0\">\n <legend class=\"text-xs text-muted-foreground p-0\">Presets</legend>\n <div class=\"flex flex-wrap gap-1\">\n @for (color of presets(); track color) {\n <button\n type=\"button\"\n data-color-btn\n class=\"aspect-square w-6 rounded border cursor-pointer hover:scale-110 transition-transform\"\n [style.backgroundColor]=\"color\"\n [class.ring-2]=\"currentColor() === color\"\n [class.ring-primary]=\"currentColor() === color\"\n (click)=\"selectPreset(color)\"\n [attr.aria-label]=\"'Select ' + color\"\n ></button>\n }\n </div>\n </fieldset>\n }\n\n @if (showHarmonies()) {\n <fieldset class=\"space-y-1 border-0 p-0 m-0\">\n <legend class=\"text-xs text-muted-foreground p-0\">Harmonies</legend>\n <div class=\"space-y-1\">\n @for (group of harmonyGroups(); track group.label) {\n <div class=\"flex items-center gap-2\">\n <span\n class=\"w-20 text-[10px] text-muted-foreground cursor-help underline decoration-dotted underline-offset-2\"\n [uiTooltip]=\"group.hint\"\n >{{ group.label }}</span>\n <div class=\"flex items-center gap-1\">\n @for (color of group.swatches; track color) {\n <button\n type=\"button\"\n class=\"relative aspect-square w-5 rounded border cursor-pointer hover:scale-110 transition-transform\"\n [style.backgroundColor]=\"color\"\n (click)=\"copyHarmony(color)\"\n [uiTooltip]=\"copiedHarmony() === color ? 'Copied ' + color : 'Click to copy ' + color\"\n [attr.aria-label]=\"'Copy ' + color\"\n >\n @if (copiedHarmony() === color) {\n <span class=\"absolute inset-0 flex items-center justify-center rounded bg-foreground/80 text-background\">\n <ui-icon name=\"check\" class=\"h-3 w-3\" />\n </span>\n }\n </button>\n }\n @if (copiedHarmony(); as copied) {\n @if (groupContains(group, copied)) {\n <span class=\"ml-1 inline-flex items-center gap-1 rounded bg-green-500/15 px-1.5 py-0.5 text-[10px] font-medium text-green-700 dark:text-green-300\">\n <ui-icon name=\"check\" class=\"h-3 w-3\" />\n {{ copied }}\n </span>\n }\n }\n </div>\n </div>\n }\n </div>\n </fieldset>\n }\n\n @if (showContrast() && contrastBadge(); as badge) {\n <div class=\"mt-3 flex items-center justify-between gap-2 rounded-md border border-input px-2 py-1.5\">\n <div class=\"flex items-center gap-2 min-w-0\">\n <button\n type=\"button\"\n class=\"flex flex-col items-center gap-0.5 rounded p-1 transition focus:outline-none\"\n [class.ring-2]=\"compareActive() === 'a'\"\n [class.ring-ring]=\"compareActive() === 'a'\"\n (click)=\"setCompareSlot('a')\"\n uiTooltip=\"Edit color A with the picker above\"\n [attr.aria-label]=\"t().editColorA + ' ' + compareAHex()\"\n >\n <span\n class=\"block h-6 w-6 rounded border\"\n [style.backgroundColor]=\"compareAHex()\"\n ></span>\n <span class=\"font-mono text-[9px] text-muted-foreground\">{{ compareAHex() }}</span>\n </button>\n <span class=\"text-xs text-muted-foreground shrink-0\">vs</span>\n <button\n type=\"button\"\n class=\"flex flex-col items-center gap-0.5 rounded p-1 transition focus:outline-none\"\n [class.ring-2]=\"compareActive() === 'b'\"\n [class.ring-ring]=\"compareActive() === 'b'\"\n (click)=\"setCompareSlot('b')\"\n uiTooltip=\"Edit color B with the picker above\"\n [attr.aria-label]=\"t().editColorB + ' ' + compareBHex()\"\n >\n <span\n class=\"block h-6 w-6 rounded border\"\n [style.backgroundColor]=\"compareBHex()\"\n ></span>\n <span class=\"font-mono text-[9px] text-muted-foreground\">{{ compareBHex() }}</span>\n </button>\n </div>\n <div class=\"flex items-center gap-2 shrink-0\">\n <span class=\"font-mono text-xs\">{{ contrastRatioDisplay() }}:1</span>\n <span\n class=\"rounded px-1.5 py-0.5 text-[10px] font-semibold\"\n [class.bg-green-700]=\"badge.pass\"\n [class.text-white]=\"badge.pass\"\n [class.bg-destructive]=\"!badge.pass\"\n [class.text-destructive-foreground]=\"!badge.pass\"\n >{{ badge.label }}</span>\n </div>\n </div>\n }\n\n <ui-tabs [defaultValue]=\"formats()[0]\">\n <ui-tabs-list class=\"flex justify-start w-full h-8 gap-1\">\n @for (fmt of formats(); track fmt) {\n <ui-tabs-trigger [value]=\"fmt\" class=\"text-xs uppercase\">{{ fmt }}</ui-tabs-trigger>\n }\n </ui-tabs-list>\n\n @if (formats().includes('hex')) {\n <ui-tabs-content value=\"hex\" class=\"mt-2\">\n <div class=\"flex items-center gap-1\">\n <ui-input\n type=\"text\"\n [ngModel]=\"formatValues().hex\"\n (ngModelChange)=\"onHexInput($event)\"\n placeholder=\"#000000\"\n class=\"h-8 text-xs font-mono flex-1\"\n />\n <button\n type=\"button\"\n class=\"inline-flex h-8 w-8 pointer-coarse:size-11 items-center justify-center rounded-md text-muted-foreground hover:text-foreground\"\n (click)=\"copy('hex')\"\n [attr.aria-label]=\"t().copyHex\"\n >\n <ui-icon [name]=\"copiedFormat() === 'hex' ? 'check' : 'copy'\" class=\"h-4 w-4\" />\n </button>\n </div>\n </ui-tabs-content>\n }\n\n @if (formats().includes('rgb')) {\n <ui-tabs-content value=\"rgb\" class=\"mt-2\">\n <div class=\"space-y-2\">\n <div class=\"grid grid-cols-3 gap-2\">\n <div>\n <span class=\"text-xs text-muted-foreground\" aria-hidden=\"true\">R</span>\n <ui-input\n type=\"number\"\n min=\"0\"\n max=\"255\"\n [ngModel]=\"rgb().r\"\n (ngModelChange)=\"onRgbChange('r', $event)\"\n [attr.aria-label]=\"t().red\"\n class=\"h-8 text-xs\"\n />\n </div>\n <div>\n <span class=\"text-xs text-muted-foreground\" aria-hidden=\"true\">G</span>\n <ui-input\n type=\"number\"\n min=\"0\"\n max=\"255\"\n [ngModel]=\"rgb().g\"\n (ngModelChange)=\"onRgbChange('g', $event)\"\n [attr.aria-label]=\"t().green\"\n class=\"h-8 text-xs\"\n />\n </div>\n <div>\n <span class=\"text-xs text-muted-foreground\" aria-hidden=\"true\">B</span>\n <ui-input\n type=\"number\"\n min=\"0\"\n max=\"255\"\n [ngModel]=\"rgb().b\"\n (ngModelChange)=\"onRgbChange('b', $event)\"\n [attr.aria-label]=\"t().blue\"\n class=\"h-8 text-xs\"\n />\n </div>\n </div>\n <div class=\"flex items-center gap-1\">\n <span class=\"flex-1 truncate text-xs font-mono text-muted-foreground\">{{ formatValues().rgb }}</span>\n <button\n type=\"button\"\n class=\"inline-flex h-7 w-7 pointer-coarse:size-11 items-center justify-center rounded-md text-muted-foreground hover:text-foreground\"\n (click)=\"copy('rgb')\"\n [attr.aria-label]=\"t().copyRgb\"\n >\n <ui-icon [name]=\"copiedFormat() === 'rgb' ? 'check' : 'copy'\" class=\"h-4 w-4\" />\n </button>\n </div>\n </div>\n </ui-tabs-content>\n }\n\n @if (formats().includes('hsl')) {\n <ui-tabs-content value=\"hsl\" class=\"mt-2\">\n <div class=\"space-y-2\">\n <div class=\"grid grid-cols-3 gap-2\">\n <div>\n <span class=\"text-xs text-muted-foreground\" aria-hidden=\"true\">H</span>\n <ui-input\n type=\"number\"\n min=\"0\"\n max=\"360\"\n [ngModel]=\"hsl().h\"\n (ngModelChange)=\"onHslHueChange($event)\"\n [attr.aria-label]=\"t().hue\"\n class=\"h-8 text-xs\"\n />\n </div>\n <div>\n <span class=\"text-xs text-muted-foreground\" aria-hidden=\"true\">S</span>\n <ui-input\n type=\"number\"\n min=\"0\"\n max=\"100\"\n [ngModel]=\"hsl().s\"\n (ngModelChange)=\"onHslChange('s', $event)\"\n [attr.aria-label]=\"t().saturation\"\n class=\"h-8 text-xs\"\n />\n </div>\n <div>\n <span class=\"text-xs text-muted-foreground\" aria-hidden=\"true\">L</span>\n <ui-input\n type=\"number\"\n min=\"0\"\n max=\"100\"\n [ngModel]=\"hsl().l\"\n (ngModelChange)=\"onHslChange('l', $event)\"\n [attr.aria-label]=\"t().lightness\"\n class=\"h-8 text-xs\"\n />\n </div>\n </div>\n <div class=\"flex items-center gap-1\">\n <span class=\"flex-1 truncate text-xs font-mono text-muted-foreground\">{{ formatValues().hsl }}</span>\n <button\n type=\"button\"\n class=\"inline-flex h-7 w-7 pointer-coarse:size-11 items-center justify-center rounded-md text-muted-foreground hover:text-foreground\"\n (click)=\"copy('hsl')\"\n [attr.aria-label]=\"t().copyHsl\"\n >\n <ui-icon [name]=\"copiedFormat() === 'hsl' ? 'check' : 'copy'\" class=\"h-4 w-4\" />\n </button>\n </div>\n </div>\n </ui-tabs-content>\n }\n\n @if (formats().includes('oklch')) {\n <ui-tabs-content value=\"oklch\" class=\"mt-2\">\n <div class=\"flex items-center gap-1\">\n <span class=\"flex-1 truncate text-xs font-mono text-muted-foreground\">{{ formatValues().oklch }}</span>\n <button\n type=\"button\"\n class=\"inline-flex h-7 w-7 pointer-coarse:size-11 items-center justify-center rounded-md text-muted-foreground hover:text-foreground\"\n (click)=\"copy('oklch')\"\n [attr.aria-label]=\"t().copyOklch\"\n >\n <ui-icon [name]=\"copiedFormat() === 'oklch' ? 'check' : 'copy'\" class=\"h-4 w-4\" />\n </button>\n </div>\n </ui-tabs-content>\n }\n </ui-tabs>\n </div>\n</ng-template>\n\n@if (inline()) {\n <ng-container [ngTemplateOutlet]=\"colorPanel\" />\n} @else {\n <ui-popover [open]=\"open()\" (openChange)=\"open.set($event)\" [attr.dir]=\"dir()\">\n <ui-popover-trigger>\n <ng-content select=\"[colorPickerTrigger]\" />\n @if (!hasTrigger()) {\n <button\n type=\"button\"\n [class]=\"triggerClasses()\"\n [disabled]=\"isDisabled()\"\n [attr.data-slot]=\"'color-picker-trigger'\"\n >\n <span\n class=\"h-6 w-6 rounded border ui-color-picker-checker\"\n [style.backgroundColor]=\"currentColor()\"\n ></span>\n <span class=\"flex-1 text-start text-sm truncate font-mono\">{{ currentColor() || 'Select color' }}</span>\n <span class=\"inline-flex opacity-50\"><ui-icon name=\"chevron-down\" class=\"h-4 w-4\" /></span>\n </button>\n }\n </ui-popover-trigger>\n <ui-popover-content class=\"w-72 p-3\" align=\"start\" [restoreFocus]=\"false\">\n <ng-container [ngTemplateOutlet]=\"colorPanel\" />\n </ui-popover-content>\n </ui-popover>\n}\n", styles: [":host{--_d: var(--density-picker, var(--density, 1))}@layer components{[data-slot=color-picker-trigger]{height:calc(2.5rem * var(--_d));padding-inline:calc(.75rem * var(--_d));padding-block:calc(.5rem * var(--_d));gap:calc(.5rem * var(--_d))}.ui-color-picker-checker{background-image:linear-gradient(45deg,hsl(0 0% 80%) 25%,transparent 25%),linear-gradient(-45deg,hsl(0 0% 80%) 25%,transparent 25%),linear-gradient(45deg,transparent 75%,hsl(0 0% 80%) 75%),linear-gradient(-45deg,transparent 75%,hsl(0 0% 80%) 75%);background-size:8px 8px;background-position:0 0,0 4px,4px -4px,-4px 0}}\n"] }]
|
|
29501
29728
|
}], ctorParameters: () => [], propDecorators: { presets: [{ type: i0.Input, args: [{ isSignal: true, alias: "presets", required: false }] }], inline: [{ type: i0.Input, args: [{ isSignal: true, alias: "inline", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], alpha: [{ type: i0.Input, args: [{ isSignal: true, alias: "alpha", required: false }] }], recentColors: [{ type: i0.Input, args: [{ isSignal: true, alias: "recentColors", required: false }] }], showRecent: [{ type: i0.Input, args: [{ isSignal: true, alias: "showRecent", required: false }] }], maxRecent: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxRecent", required: false }] }], storageKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "storageKey", required: false }] }], enableEyedropper: [{ type: i0.Input, args: [{ isSignal: true, alias: "enableEyedropper", required: false }] }], fallbackTarget: [{ type: i0.Input, args: [{ isSignal: true, alias: "fallbackTarget", required: false }] }], locale: [{ type: i0.Input, args: [{ isSignal: true, alias: "locale", required: false }] }], enableImagePick: [{ type: i0.Input, args: [{ isSignal: true, alias: "enableImagePick", required: false }] }], imageExtractAlgorithm: [{ type: i0.Input, args: [{ isSignal: true, alias: "imageExtractAlgorithm", required: false }] }], imageExtractCount: [{ type: i0.Input, args: [{ isSignal: true, alias: "imageExtractCount", required: false }] }], showHarmonies: [{ type: i0.Input, args: [{ isSignal: true, alias: "showHarmonies", required: false }] }], showContrast: [{ type: i0.Input, args: [{ isSignal: true, alias: "showContrast", required: false }] }], contrastBackground: [{ type: i0.Input, args: [{ isSignal: true, alias: "contrastBackground", required: false }] }], formats: [{ type: i0.Input, args: [{ isSignal: true, alias: "formats", required: false }] }], colorChange: [{ type: i0.Output, args: ["colorChange"] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], recentColorsChange: [{ type: i0.Output, args: ["recentColorsChange"] }], colorArea: [{ type: i0.ViewChild, args: ['colorArea', { isSignal: true }] }], imageFile: [{ type: i0.ViewChild, args: ['imageFile', { isSignal: true }] }] } });
|
|
29502
29729
|
|
|
29503
29730
|
const RICH_TEXT_COLOR_BUTTON_CONTEXT = new InjectionToken('RICH_TEXT_COLOR_BUTTON_CONTEXT');
|
|
@@ -32346,6 +32573,14 @@ const EMOJI_DATA = {
|
|
|
32346
32573
|
|
|
32347
32574
|
/** How many leading keywords make up an emoji's spoken name. */
|
|
32348
32575
|
const EMOJI_LABEL_WORDS = 3;
|
|
32576
|
+
/** Frames the scroll position must hold still before a category jump counts as finished. */
|
|
32577
|
+
const SETTLE_STABLE_FRAMES = 3;
|
|
32578
|
+
/** Frames a smooth scroll may sit at its start position (a busy main thread delays its first step) before "not moving" counts as "arrived". */
|
|
32579
|
+
const SETTLE_START_GRACE_FRAMES = 20;
|
|
32580
|
+
/** Upper bound (~4s at 60fps) so a stuck scroll can never leave the scroll-spy suppressed. */
|
|
32581
|
+
const SETTLE_MAX_FRAMES = 240;
|
|
32582
|
+
/** Re-aims allowed once the scroll stops: each one corrects a height estimate, and a few cover the worst case. */
|
|
32583
|
+
const SETTLE_MAX_REAIMS = 5;
|
|
32349
32584
|
class EmojiPickerContentComponent {
|
|
32350
32585
|
set scrollArea(value) {
|
|
32351
32586
|
this._scrollArea = value;
|
|
@@ -32510,29 +32745,63 @@ class EmojiPickerContentComponent {
|
|
|
32510
32745
|
/**
|
|
32511
32746
|
* Jumps the grid to a category section, clearing the search box first so every
|
|
32512
32747
|
* category is present to scroll to. The scroll is smooth and the scroll-spy that
|
|
32513
|
-
* normally tracks the active tab is suppressed
|
|
32514
|
-
*
|
|
32748
|
+
* normally tracks the active tab is suppressed until the animation has settled so it
|
|
32749
|
+
* cannot fight it.
|
|
32515
32750
|
*/
|
|
32516
32751
|
scrollToCategory(categoryId) {
|
|
32517
32752
|
this.searchQuery.set('');
|
|
32518
32753
|
this.activeCategory.set(categoryId);
|
|
32519
32754
|
this.isScrollingProgrammatically = true;
|
|
32520
32755
|
setTimeout(() => {
|
|
32521
|
-
|
|
32522
|
-
const section = this.el.nativeElement.querySelector(`[data-category="${categoryId}"]`);
|
|
32523
|
-
if (section && viewport) {
|
|
32524
|
-
const relativeTop = section.getBoundingClientRect().top - viewport.getBoundingClientRect().top;
|
|
32525
|
-
const scrollTop = viewport.scrollTop + relativeTop;
|
|
32526
|
-
viewport.scrollTo({ top: scrollTop, behavior: 'smooth' });
|
|
32527
|
-
setTimeout(() => {
|
|
32528
|
-
this.isScrollingProgrammatically = false;
|
|
32529
|
-
}, 800);
|
|
32530
|
-
}
|
|
32531
|
-
else {
|
|
32756
|
+
if (this.alignToCategory(categoryId, 'smooth') === null) {
|
|
32532
32757
|
this.isScrollingProgrammatically = false;
|
|
32758
|
+
return;
|
|
32533
32759
|
}
|
|
32760
|
+
// Sections are content-visibility:auto with an estimated height, so the
|
|
32761
|
+
// scroll height changes as the animation passes them; re-aim once it ends.
|
|
32762
|
+
const startTop = this.scrollViewport()?.scrollTop ?? 0;
|
|
32763
|
+
this.settleOnCategory(categoryId, { startTop, lastTop: startTop, stableFrames: 0, moved: false, framesLeft: SETTLE_MAX_FRAMES, reaimsLeft: SETTLE_MAX_REAIMS });
|
|
32534
32764
|
});
|
|
32535
32765
|
}
|
|
32766
|
+
/**
|
|
32767
|
+
* Waits until the smooth scroll has stopped moving (its length depends on distance and on how
|
|
32768
|
+
* busy the frame loop is, so a fixed delay is a bet), then snaps the heading into place.
|
|
32769
|
+
*/
|
|
32770
|
+
settleOnCategory(categoryId, state) {
|
|
32771
|
+
const top = this.scrollViewport()?.scrollTop ?? 0;
|
|
32772
|
+
const moved = state.moved || top !== state.startTop;
|
|
32773
|
+
const stable = top === state.lastTop ? state.stableFrames + 1 : 0;
|
|
32774
|
+
// A smooth scroll that has not taken its first step yet looks identical to one that has finished;
|
|
32775
|
+
// only a seen movement, or the start grace running out (we were already there), makes stillness mean arrival.
|
|
32776
|
+
const arrived = stable >= SETTLE_STABLE_FRAMES && (moved || SETTLE_MAX_FRAMES - state.framesLeft >= SETTLE_START_GRACE_FRAMES);
|
|
32777
|
+
if (state.framesLeft > 0 && !arrived) {
|
|
32778
|
+
requestAnimationFrame(() => this.settleOnCategory(categoryId, { ...state, lastTop: top, stableFrames: stable, moved, framesLeft: state.framesLeft - 1 }));
|
|
32779
|
+
return;
|
|
32780
|
+
}
|
|
32781
|
+
const offset = this.alignToCategory(categoryId, 'auto');
|
|
32782
|
+
if (offset !== null && Math.abs(offset) > 1 && state.reaimsLeft > 0) {
|
|
32783
|
+
requestAnimationFrame(() => this.settleOnCategory(categoryId, { ...state, lastTop: top, stableFrames: 0, moved: true, framesLeft: state.framesLeft - 1, reaimsLeft: state.reaimsLeft - 1 }));
|
|
32784
|
+
return;
|
|
32785
|
+
}
|
|
32786
|
+
setTimeout(() => {
|
|
32787
|
+
this.isScrollingProgrammatically = false;
|
|
32788
|
+
});
|
|
32789
|
+
}
|
|
32790
|
+
scrollViewport() {
|
|
32791
|
+
return this._scrollArea?.viewportRef?.nativeElement;
|
|
32792
|
+
}
|
|
32793
|
+
/** Scrolls so the section's heading sits at the viewport top; returns how far it was off, or null when the section or viewport is missing. */
|
|
32794
|
+
alignToCategory(categoryId, behavior) {
|
|
32795
|
+
const viewport = this.scrollViewport();
|
|
32796
|
+
const section = this.el.nativeElement.querySelector(`[data-category="${categoryId}"]`);
|
|
32797
|
+
if (!section || !viewport)
|
|
32798
|
+
return null;
|
|
32799
|
+
const relativeTop = section.getBoundingClientRect().top - viewport.getBoundingClientRect().top;
|
|
32800
|
+
if (behavior === 'smooth' || Math.abs(relativeTop) > 1) {
|
|
32801
|
+
viewport.scrollTo({ top: viewport.scrollTop + relativeTop, behavior });
|
|
32802
|
+
}
|
|
32803
|
+
return relativeTop;
|
|
32804
|
+
}
|
|
32536
32805
|
setupScrollListener(viewport) {
|
|
32537
32806
|
this.scrollRemoveListener?.();
|
|
32538
32807
|
const listener = () => this.onScroll();
|
|
@@ -33369,7 +33638,7 @@ class RichTextFileImportDirective {
|
|
|
33369
33638
|
async importDocx(file) {
|
|
33370
33639
|
this.assertImportableSize(file);
|
|
33371
33640
|
const bytes = new Uint8Array(await file.arrayBuffer());
|
|
33372
|
-
const { parseDocx } = await import('./gilav21-shadcn-angular-rte-docx-parser-
|
|
33641
|
+
const { parseDocx } = await import('./gilav21-shadcn-angular-rte-docx-parser-Yd5YQqOL.mjs');
|
|
33373
33642
|
const { renderDocxForEditor } = await import('./gilav21-shadcn-angular-rte-docx-to-editor-html-BreagmS_.mjs');
|
|
33374
33643
|
const html = renderDocxForEditor(parseDocx(bytes));
|
|
33375
33644
|
this.insertImported(html);
|
|
@@ -33377,7 +33646,7 @@ class RichTextFileImportDirective {
|
|
|
33377
33646
|
async importPdf(file) {
|
|
33378
33647
|
this.assertImportableSize(file);
|
|
33379
33648
|
const buffer = await file.arrayBuffer();
|
|
33380
|
-
const { parsePdfReadable } = await import('./gilav21-shadcn-angular-rte-pdf-readable-
|
|
33649
|
+
const { parsePdfReadable } = await import('./gilav21-shadcn-angular-rte-pdf-readable-BKYRkHec.mjs');
|
|
33381
33650
|
const result = await parsePdfReadable(buffer);
|
|
33382
33651
|
if (result.html.trim() && result.fontFaceCss)
|
|
33383
33652
|
this.injectFontCss(result.fontFaceCss);
|
|
@@ -36224,7 +36493,7 @@ function resolveEntityTemplate(template, context) {
|
|
|
36224
36493
|
query: context.query, type: context.type, userId: context.userId, tagId: context.tagId,
|
|
36225
36494
|
};
|
|
36226
36495
|
return template
|
|
36227
|
-
.replaceAll(/@@([a-zA-Z0-9_-]+)@@/g, (
|
|
36496
|
+
.replaceAll(/@@([a-zA-Z0-9_-]+)@@/g, (...[, token]) => values[token] ?? '')
|
|
36228
36497
|
.replaceAll(/:([a-zA-Z][a-zA-Z0-9_-]*)/g, (match, token) => values[token] ?? match);
|
|
36229
36498
|
}
|
|
36230
36499
|
function resolveEntityText(context, options) {
|
|
@@ -36244,8 +36513,12 @@ function resolveEntityUrl(context, options, sanitizeUrl) {
|
|
|
36244
36513
|
}
|
|
36245
36514
|
return raw ? sanitizeUrl(raw) : null;
|
|
36246
36515
|
}
|
|
36247
|
-
function applyEntityBaseAttributes(element, context) {
|
|
36516
|
+
function applyEntityBaseAttributes(element, context, mode) {
|
|
36248
36517
|
element.setAttribute('contenteditable', 'false');
|
|
36518
|
+
// `class` does not survive the sanitizer, so the mode is what tells the
|
|
36519
|
+
// chip look to leave a text/link entity alone after a round trip.
|
|
36520
|
+
if (mode !== 'chip')
|
|
36521
|
+
element.dataset['entityMode'] = mode;
|
|
36249
36522
|
if (context.type === 'mention') {
|
|
36250
36523
|
element.dataset['mention'] = context.value;
|
|
36251
36524
|
element.dataset['mentionId'] = context.id;
|
|
@@ -36257,7 +36530,7 @@ function applyEntityBaseAttributes(element, context) {
|
|
|
36257
36530
|
}
|
|
36258
36531
|
function createEntitySpanElement(doc, context, text, mode, customClassName) {
|
|
36259
36532
|
const span = doc.createElement('span');
|
|
36260
|
-
applyEntityBaseAttributes(span, context);
|
|
36533
|
+
applyEntityBaseAttributes(span, context, mode);
|
|
36261
36534
|
span.className = mode === 'text'
|
|
36262
36535
|
? (customClassName ?? '')
|
|
36263
36536
|
: (customClassName ?? 'bg-accent text-accent-foreground rounded px-1');
|
|
@@ -36270,7 +36543,7 @@ function createEntityLinkElement(doc, context, text, options, sanitizeUrl) {
|
|
|
36270
36543
|
return createEntitySpanElement(doc, context, text, 'chip', options.className);
|
|
36271
36544
|
}
|
|
36272
36545
|
const link = doc.createElement('a');
|
|
36273
|
-
applyEntityBaseAttributes(link, context);
|
|
36546
|
+
applyEntityBaseAttributes(link, context, 'link');
|
|
36274
36547
|
link.href = safeUrl;
|
|
36275
36548
|
link.target = options.target ?? '_blank';
|
|
36276
36549
|
link.rel = options.rel ?? 'noopener noreferrer';
|
|
@@ -36366,7 +36639,6 @@ class RichTextMentionsDirective {
|
|
|
36366
36639
|
this.sanitizer = inject(RichTextSanitizerService);
|
|
36367
36640
|
this.injector = inject(Injector);
|
|
36368
36641
|
this.vcr = inject(ViewContainerRef);
|
|
36369
|
-
this.document = inject(DOCUMENT);
|
|
36370
36642
|
/** Locale for the popover UI: a registry key (`'en'`/`'he'`/…) or a full dictionary. */
|
|
36371
36643
|
this.uiRteMentionsLocale = input(...(ngDevMode ? [undefined, { debugName: "uiRteMentionsLocale" }] : /* istanbul ignore next */ []));
|
|
36372
36644
|
/** Enable the `@mention` trigger (the bare `uiRteMentions` attribute). */
|
|
@@ -40111,7 +40383,7 @@ class AutocompleteComponent {
|
|
|
40111
40383
|
useExisting: forwardRef(() => AutocompleteComponent),
|
|
40112
40384
|
multi: true,
|
|
40113
40385
|
},
|
|
40114
|
-
], viewQueries: [{ propertyName: "inputEl", first: true, predicate: ["inputEl"], descendants: true, isSignal: true }, { propertyName: "command", first: true, predicate: CommandComponent, descendants: true, isSignal: true }, { propertyName: "commandService", first: true, predicate: CommandComponent, descendants: true, read: CommandService, isSignal: true }], ngImport: i0, template: "<ui-popover [open]=\"open()\" (openChange)=\"onOpenChange($event)\">\n <ui-popover-trigger class=\"w-full\">\n <div\n [class]=\"containerClasses()\"\n [attr.data-state]=\"open() ? 'open' : 'closed'\"\n [attr.data-disabled]=\"isDisabled() || null\"\n [attr.data-slot]=\"'autocomplete-container'\"\n [attr.dir]=\"dir()\"\n tabindex=\"-1\"\n (click)=\"onContainerClick($event)\"\n (keydown.enter)=\"onContainerClick($event)\"\n (keydown.space)=\"onContainerClick($event)\"\n >\n @if (multiple()) {\n <div class=\"flex flex-wrap items-center gap-1 w-full\">\n @for (item of selectedItems(); track item; let i = $index) {\n <ui-badge variant=\"secondary\" class=\"gap-1 pe-0.5\">\n {{ getDisplayValue(item) }}\n <button\n type=\"button\"\n class=\"cursor-pointer rounded-full p-0.5 pointer-coarse:size-11 hover:bg-secondary-foreground/20 inline-flex items-center justify-center bg-transparent border-0\"\n data-slot=\"chip-remove\"\n (click)=\"removeItem(item, $event)\"\n >\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" class=\"h-3 w-3\"><path d=\"M18 6 6 18\"/><path d=\"m6 6 12 12\"/></svg>\n </button>\n </ui-badge>\n }\n <input\n #inputEl\n type=\"text\"\n role=\"combobox\"\n aria-autocomplete=\"list\"\n [attr.aria-expanded]=\"open()\"\n [attr.aria-controls]=\"listId\"\n [attr.aria-activedescendant]=\"activeItemId()\"\n [class]=\"multiInputClasses()\"\n [placeholder]=\"selectedItems().length === 0 ? (placeholder() ?? t().selectPlaceholder) : ''\"\n [disabled]=\"isDisabled()\"\n [(ngModel)]=\"searchTerm\"\n (input)=\"onInput($event)\"\n (keydown)=\"onKeydown($event)\"\n (blur)=\"onTouched()\"\n />\n </div>\n } @else {\n <div class=\"flex items-center w-full gap-2\">\n <input\n #inputEl\n type=\"text\"\n role=\"combobox\"\n aria-autocomplete=\"list\"\n [attr.aria-expanded]=\"open()\"\n [attr.aria-controls]=\"listId\"\n [attr.aria-activedescendant]=\"activeItemId()\"\n [class]=\"singleInputClasses()\"\n [placeholder]=\"placeholder() ?? t().selectPlaceholder\"\n [disabled]=\"isDisabled()\"\n [value]=\"inputValue()\"\n (input)=\"onInput($event)\"\n (keydown)=\"onKeydown($event)\"\n (blur)=\"onBlur()\"\n (focus)=\"onFocus()\"\n />\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" class=\"h-4 w-4 opacity-50 shrink-0\"><path d=\"m6 9 6 6 6-6\"/></svg>\n </div>\n }\n </div>\n </ui-popover-trigger>\n <ui-popover-content [side]=\"dropdownSide()\" class=\"w-
|
|
40386
|
+
], viewQueries: [{ propertyName: "inputEl", first: true, predicate: ["inputEl"], descendants: true, isSignal: true }, { propertyName: "command", first: true, predicate: CommandComponent, descendants: true, isSignal: true }, { propertyName: "commandService", first: true, predicate: CommandComponent, descendants: true, read: CommandService, isSignal: true }], ngImport: i0, template: "<ui-popover [open]=\"open()\" (openChange)=\"onOpenChange($event)\">\n <ui-popover-trigger class=\"w-full\">\n <div\n [class]=\"containerClasses()\"\n [attr.data-state]=\"open() ? 'open' : 'closed'\"\n [attr.data-disabled]=\"isDisabled() || null\"\n [attr.data-slot]=\"'autocomplete-container'\"\n [attr.dir]=\"dir()\"\n tabindex=\"-1\"\n (click)=\"onContainerClick($event)\"\n (keydown.enter)=\"onContainerClick($event)\"\n (keydown.space)=\"onContainerClick($event)\"\n >\n @if (multiple()) {\n <div class=\"flex flex-wrap items-center gap-1 w-full\">\n @for (item of selectedItems(); track item; let i = $index) {\n <ui-badge variant=\"secondary\" class=\"gap-1 pe-0.5\">\n {{ getDisplayValue(item) }}\n <button\n type=\"button\"\n class=\"cursor-pointer rounded-full p-0.5 pointer-coarse:size-11 hover:bg-secondary-foreground/20 inline-flex items-center justify-center bg-transparent border-0\"\n data-slot=\"chip-remove\"\n (click)=\"removeItem(item, $event)\"\n >\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" class=\"h-3 w-3\"><path d=\"M18 6 6 18\"/><path d=\"m6 6 12 12\"/></svg>\n </button>\n </ui-badge>\n }\n <input\n #inputEl\n type=\"text\"\n role=\"combobox\"\n aria-autocomplete=\"list\"\n [attr.aria-expanded]=\"open()\"\n [attr.aria-controls]=\"listId\"\n [attr.aria-activedescendant]=\"activeItemId()\"\n [class]=\"multiInputClasses()\"\n [placeholder]=\"selectedItems().length === 0 ? (placeholder() ?? t().selectPlaceholder) : ''\"\n [disabled]=\"isDisabled()\"\n [(ngModel)]=\"searchTerm\"\n (input)=\"onInput($event)\"\n (keydown)=\"onKeydown($event)\"\n (blur)=\"onTouched()\"\n />\n </div>\n } @else {\n <div class=\"flex items-center w-full gap-2\">\n <input\n #inputEl\n type=\"text\"\n role=\"combobox\"\n aria-autocomplete=\"list\"\n [attr.aria-expanded]=\"open()\"\n [attr.aria-controls]=\"listId\"\n [attr.aria-activedescendant]=\"activeItemId()\"\n [class]=\"singleInputClasses()\"\n [placeholder]=\"placeholder() ?? t().selectPlaceholder\"\n [disabled]=\"isDisabled()\"\n [value]=\"inputValue()\"\n (input)=\"onInput($event)\"\n (keydown)=\"onKeydown($event)\"\n (blur)=\"onBlur()\"\n (focus)=\"onFocus()\"\n />\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" class=\"h-4 w-4 opacity-50 shrink-0\"><path d=\"m6 9 6 6 6-6\"/></svg>\n </div>\n }\n </div>\n </ui-popover-trigger>\n <ui-popover-content [side]=\"dropdownSide()\" class=\"w-(--trigger-width) p-0\" align=\"start\" [restoreFocus]=\"false\" [avoidCollisions]=\"avoidPopoverCollisions()\">\n <ui-command [shouldFilter]=\"filter()\" [search]=\"searchTerm()\" [attr.dir]=\"dir()\">\n <ui-command-list [attr.id]=\"listId\" role=\"listbox\">\n <ui-command-empty>{{ t().noResults }}</ui-command-empty>\n\n @for (option of options(); track getTrackBy(option)) {\n <ui-command-item\n [value]=\"getSearchValue(option)\"\n [selected]=\"isSelected(option)\"\n (selectItem)=\"onSelect(option)\"\n >\n <span class=\"truncate\" [innerHTML]=\"getDisplayValue(option) | highlight: searchTerm()\"></span>\n <span class=\"ms-auto flex h-3.5 w-3.5 shrink-0 items-center justify-center opacity-0\" [class.opacity-100]=\"isSelected(option)\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" class=\"h-4 w-4\"><polyline points=\"20 6 9 17 4 12\"/></svg>\n </span>\n </ui-command-item>\n }\n </ui-command-list>\n </ui-command>\n </ui-popover-content>\n</ui-popover>\n", styles: [":host{--_d: var(--density-select, var(--density, 1))}@layer components{[data-slot=autocomplete-container]{min-height:calc(2.5rem * var(--_d));padding-inline:calc(.75rem * var(--_d));padding-block:calc(.5rem * var(--_d))}}\n"], dependencies: [{ kind: "component", type: PopoverComponent, selector: "ui-popover", inputs: ["class", "open", "closeOnScroll"], outputs: ["openChange"] }, { kind: "component", type: PopoverContentComponent, selector: "ui-popover-content", inputs: ["class", "align", "side", "sideOffset", "avoidCollisions", "restoreFocus", "strategy"] }, { kind: "component", type: PopoverTriggerComponent, selector: "ui-popover-trigger", inputs: ["class"] }, { kind: "component", type: CommandComponent, selector: "ui-command", inputs: ["class", "shouldFilter", "search", "source", "debounce", "recentKey", "recentLimit"] }, { kind: "component", type: CommandListComponent, selector: "ui-command-list", inputs: ["class", "ariaLabel"] }, { kind: "component", type: CommandItemComponent, selector: "ui-command-item", inputs: ["class", "disabled", "selected", "value", "shortcut"], outputs: ["selectItem"] }, { kind: "component", type: CommandEmptyComponent, selector: "ui-command-empty", inputs: ["class"] }, { kind: "component", type: BadgeComponent, selector: "ui-badge", inputs: ["variant", "label", "class", "skeleton"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "pipe", type: HighlightPipe, name: "highlight" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
40115
40387
|
}
|
|
40116
40388
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: AutocompleteComponent, decorators: [{
|
|
40117
40389
|
type: Component,
|
|
@@ -40132,7 +40404,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
|
|
|
40132
40404
|
useExisting: forwardRef(() => AutocompleteComponent),
|
|
40133
40405
|
multi: true,
|
|
40134
40406
|
},
|
|
40135
|
-
], host: { class: 'contents' }, template: "<ui-popover [open]=\"open()\" (openChange)=\"onOpenChange($event)\">\n <ui-popover-trigger class=\"w-full\">\n <div\n [class]=\"containerClasses()\"\n [attr.data-state]=\"open() ? 'open' : 'closed'\"\n [attr.data-disabled]=\"isDisabled() || null\"\n [attr.data-slot]=\"'autocomplete-container'\"\n [attr.dir]=\"dir()\"\n tabindex=\"-1\"\n (click)=\"onContainerClick($event)\"\n (keydown.enter)=\"onContainerClick($event)\"\n (keydown.space)=\"onContainerClick($event)\"\n >\n @if (multiple()) {\n <div class=\"flex flex-wrap items-center gap-1 w-full\">\n @for (item of selectedItems(); track item; let i = $index) {\n <ui-badge variant=\"secondary\" class=\"gap-1 pe-0.5\">\n {{ getDisplayValue(item) }}\n <button\n type=\"button\"\n class=\"cursor-pointer rounded-full p-0.5 pointer-coarse:size-11 hover:bg-secondary-foreground/20 inline-flex items-center justify-center bg-transparent border-0\"\n data-slot=\"chip-remove\"\n (click)=\"removeItem(item, $event)\"\n >\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" class=\"h-3 w-3\"><path d=\"M18 6 6 18\"/><path d=\"m6 6 12 12\"/></svg>\n </button>\n </ui-badge>\n }\n <input\n #inputEl\n type=\"text\"\n role=\"combobox\"\n aria-autocomplete=\"list\"\n [attr.aria-expanded]=\"open()\"\n [attr.aria-controls]=\"listId\"\n [attr.aria-activedescendant]=\"activeItemId()\"\n [class]=\"multiInputClasses()\"\n [placeholder]=\"selectedItems().length === 0 ? (placeholder() ?? t().selectPlaceholder) : ''\"\n [disabled]=\"isDisabled()\"\n [(ngModel)]=\"searchTerm\"\n (input)=\"onInput($event)\"\n (keydown)=\"onKeydown($event)\"\n (blur)=\"onTouched()\"\n />\n </div>\n } @else {\n <div class=\"flex items-center w-full gap-2\">\n <input\n #inputEl\n type=\"text\"\n role=\"combobox\"\n aria-autocomplete=\"list\"\n [attr.aria-expanded]=\"open()\"\n [attr.aria-controls]=\"listId\"\n [attr.aria-activedescendant]=\"activeItemId()\"\n [class]=\"singleInputClasses()\"\n [placeholder]=\"placeholder() ?? t().selectPlaceholder\"\n [disabled]=\"isDisabled()\"\n [value]=\"inputValue()\"\n (input)=\"onInput($event)\"\n (keydown)=\"onKeydown($event)\"\n (blur)=\"onBlur()\"\n (focus)=\"onFocus()\"\n />\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" class=\"h-4 w-4 opacity-50 shrink-0\"><path d=\"m6 9 6 6 6-6\"/></svg>\n </div>\n }\n </div>\n </ui-popover-trigger>\n <ui-popover-content [side]=\"dropdownSide()\" class=\"w-
|
|
40407
|
+
], host: { class: 'contents' }, template: "<ui-popover [open]=\"open()\" (openChange)=\"onOpenChange($event)\">\n <ui-popover-trigger class=\"w-full\">\n <div\n [class]=\"containerClasses()\"\n [attr.data-state]=\"open() ? 'open' : 'closed'\"\n [attr.data-disabled]=\"isDisabled() || null\"\n [attr.data-slot]=\"'autocomplete-container'\"\n [attr.dir]=\"dir()\"\n tabindex=\"-1\"\n (click)=\"onContainerClick($event)\"\n (keydown.enter)=\"onContainerClick($event)\"\n (keydown.space)=\"onContainerClick($event)\"\n >\n @if (multiple()) {\n <div class=\"flex flex-wrap items-center gap-1 w-full\">\n @for (item of selectedItems(); track item; let i = $index) {\n <ui-badge variant=\"secondary\" class=\"gap-1 pe-0.5\">\n {{ getDisplayValue(item) }}\n <button\n type=\"button\"\n class=\"cursor-pointer rounded-full p-0.5 pointer-coarse:size-11 hover:bg-secondary-foreground/20 inline-flex items-center justify-center bg-transparent border-0\"\n data-slot=\"chip-remove\"\n (click)=\"removeItem(item, $event)\"\n >\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" class=\"h-3 w-3\"><path d=\"M18 6 6 18\"/><path d=\"m6 6 12 12\"/></svg>\n </button>\n </ui-badge>\n }\n <input\n #inputEl\n type=\"text\"\n role=\"combobox\"\n aria-autocomplete=\"list\"\n [attr.aria-expanded]=\"open()\"\n [attr.aria-controls]=\"listId\"\n [attr.aria-activedescendant]=\"activeItemId()\"\n [class]=\"multiInputClasses()\"\n [placeholder]=\"selectedItems().length === 0 ? (placeholder() ?? t().selectPlaceholder) : ''\"\n [disabled]=\"isDisabled()\"\n [(ngModel)]=\"searchTerm\"\n (input)=\"onInput($event)\"\n (keydown)=\"onKeydown($event)\"\n (blur)=\"onTouched()\"\n />\n </div>\n } @else {\n <div class=\"flex items-center w-full gap-2\">\n <input\n #inputEl\n type=\"text\"\n role=\"combobox\"\n aria-autocomplete=\"list\"\n [attr.aria-expanded]=\"open()\"\n [attr.aria-controls]=\"listId\"\n [attr.aria-activedescendant]=\"activeItemId()\"\n [class]=\"singleInputClasses()\"\n [placeholder]=\"placeholder() ?? t().selectPlaceholder\"\n [disabled]=\"isDisabled()\"\n [value]=\"inputValue()\"\n (input)=\"onInput($event)\"\n (keydown)=\"onKeydown($event)\"\n (blur)=\"onBlur()\"\n (focus)=\"onFocus()\"\n />\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" class=\"h-4 w-4 opacity-50 shrink-0\"><path d=\"m6 9 6 6 6-6\"/></svg>\n </div>\n }\n </div>\n </ui-popover-trigger>\n <ui-popover-content [side]=\"dropdownSide()\" class=\"w-(--trigger-width) p-0\" align=\"start\" [restoreFocus]=\"false\" [avoidCollisions]=\"avoidPopoverCollisions()\">\n <ui-command [shouldFilter]=\"filter()\" [search]=\"searchTerm()\" [attr.dir]=\"dir()\">\n <ui-command-list [attr.id]=\"listId\" role=\"listbox\">\n <ui-command-empty>{{ t().noResults }}</ui-command-empty>\n\n @for (option of options(); track getTrackBy(option)) {\n <ui-command-item\n [value]=\"getSearchValue(option)\"\n [selected]=\"isSelected(option)\"\n (selectItem)=\"onSelect(option)\"\n >\n <span class=\"truncate\" [innerHTML]=\"getDisplayValue(option) | highlight: searchTerm()\"></span>\n <span class=\"ms-auto flex h-3.5 w-3.5 shrink-0 items-center justify-center opacity-0\" [class.opacity-100]=\"isSelected(option)\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" class=\"h-4 w-4\"><polyline points=\"20 6 9 17 4 12\"/></svg>\n </span>\n </ui-command-item>\n }\n </ui-command-list>\n </ui-command>\n </ui-popover-content>\n</ui-popover>\n", styles: [":host{--_d: var(--density-select, var(--density, 1))}@layer components{[data-slot=autocomplete-container]{min-height:calc(2.5rem * var(--_d));padding-inline:calc(.75rem * var(--_d));padding-block:calc(.5rem * var(--_d))}}\n"] }]
|
|
40136
40408
|
}], ctorParameters: () => [], propDecorators: { options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], displayWith: [{ type: i0.Input, args: [{ isSignal: true, alias: "displayWith", required: false }] }], valueAttribute: [{ type: i0.Input, args: [{ isSignal: true, alias: "valueAttribute", required: false }] }], filter: [{ type: i0.Input, args: [{ isSignal: true, alias: "filter", required: false }] }], multiple: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiple", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], debounceTime: [{ type: i0.Input, args: [{ isSignal: true, alias: "debounceTime", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], locale: [{ type: i0.Input, args: [{ isSignal: true, alias: "locale", required: false }] }], searchChange: [{ type: i0.Output, args: ["searchChange"] }], searchTerm: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchTerm", required: false }] }, { type: i0.Output, args: ["searchTermChange"] }], inputEl: [{ type: i0.ViewChild, args: ['inputEl', { isSignal: true }] }], command: [{ type: i0.ViewChild, args: [i0.forwardRef(() => CommandComponent), { isSignal: true }] }], commandService: [{ type: i0.ViewChild, args: [i0.forwardRef(() => CommandComponent), { ...{ read: CommandService }, isSignal: true }] }] } });
|
|
40137
40409
|
|
|
40138
40410
|
const RICH_TEXT_TYPOGRAPHY_BUTTON_CONTEXT = new InjectionToken('RICH_TEXT_TYPOGRAPHY_BUTTON_CONTEXT');
|
|
@@ -40239,7 +40511,7 @@ const DEFAULT_FONT_FAMILIES = [
|
|
|
40239
40511
|
'Impact',
|
|
40240
40512
|
];
|
|
40241
40513
|
/** Font sizes (px) offered by the font-size dropdown: 8px…72px in 2px steps. */
|
|
40242
|
-
const FONT_SIZE_STEPS = Array.from({ length: 33 }, (
|
|
40514
|
+
const FONT_SIZE_STEPS = Array.from({ length: 33 }, (...[, i]) => 8 + i * 2);
|
|
40243
40515
|
/**
|
|
40244
40516
|
* Opt-in typography addon for `<ui-rich-text-editor>`. Attaches via DI to the
|
|
40245
40517
|
* `RichTextEditorAddonHost` the base provides and contributes two toolbar
|
|
@@ -40409,4 +40681,4 @@ const RTE_FULL = [
|
|
|
40409
40681
|
*/
|
|
40410
40682
|
|
|
40411
40683
|
export { RichTextAllowHost as $, ACTION_ATTRS as A, RICH_TEXT_LOCALES as B, RICH_TEXT_MENTIONS_LOCALES as C, DEFAULT_COLOR_PALETTE as D, EMPTINESS_FIXTURES as E, FIND_MAX_PAINTED_RECTS as F, RICH_TEXT_OUTLINE_CONTEXT as G, HEADER_BYTES as H, IMAGE_IMPORT_ACCEPT as I, RICH_TEXT_OUTLINE_LOCALES as J, RICH_TEXT_PROSE_CLASSES as K, RICH_TEXT_SHORTCUT_DEFINITIONS as L, MAX_NESTING_DEPTH as M, RICH_TEXT_SLASH_COMMANDS_LOCALES as N, RICH_TEXT_TABLES_BUTTON_CONTEXT as O, PDF_MIME as P, RICH_TEXT_TABLES_LOCALES as Q, RICH_TEXT_ACTIONS_SANITIZER_RULES as R, RICH_TEXT_TYPOGRAPHY_BUTTON_CONTEXT as S, RICH_TEXT_TYPOGRAPHY_LOCALES as T, RTE_FULL as U, RichTextActionsBindDirective as V, RichTextActionsDirective as W, RichTextAiChipComponent as X, RichTextAiDirective as Y, RichTextAiPanelComponent as Z, RichTextAllowDirective as _, ACTION_PARAMS as a, flattenIntoRowText as a$, RichTextColorsButtonComponent as a0, RichTextColorsDirective as a1, RichTextCommandRegistry as a2, RichTextEditorAddonHost as a3, RichTextEditorComponent as a4, RichTextEmojiButtonComponent as a5, RichTextEmojiDirective as a6, RichTextFileImportButtonComponent as a7, RichTextFileImportDirective as a8, RichTextFileImportOverlayComponent as a9, TRANSPARENT_PIXEL as aA, addonSetting as aB, anchorOverlay as aC, applyImageAlignment as aD, applyStarterStyle as aE, assertFlatParams as aF, bindRichTextActions as aG, blockquoteDepthOf as aH, buildDefaultSlashCommands as aI, buildEntityInsertNode as aJ, buildEntityRenderContext as aK, buildFindIndex as aL, buildLineIndex as aM, caretPosition as aN, childList as aO, classifyImport as aP, compileFindRegex as aQ, computeSeedStyleString as aR, containsCssUrl as aS, createImageElement as aT, cssFunctionCalls as aU, dataUrlToFile as aV, decodeCssEscapes as aW, detectTrigger as aX, directionOf as aY, dragHasSupportedDocument as aZ, extractCssUrls as a_, RichTextHistoryDirective as aa, RichTextHistoryPanelComponent as ab, RichTextImageResizerComponent as ac, RichTextImagesButtonComponent as ad, RichTextImagesDirective as ae, RichTextImagesOverlayComponent as af, RichTextLinksButtonComponent as ag, RichTextLinksDirective as ah, RichTextLinksFormComponent as ai, RichTextMarkdownService as aj, RichTextMentionPopoverComponent as ak, RichTextMentionsDirective as al, RichTextOutlineDirective as am, RichTextOutlinePanelComponent as an, RichTextPasteNormalizerService as ao, RichTextSanitizerService as ap, RichTextSlashCommandsDirective as aq, RichTextSlashCommandsMenuComponent as ar, RichTextTablesButtonComponent as as, RichTextTablesDirective as at, RichTextToolbarComponent as au, RichTextToolbarViewContext as av, RichTextTypographyButtonComponent as aw, RichTextTypographyDirective as ax, TEXT_STYLE_OPTIONS as ay, TOOLBAR_BUTTONS as az, AddonSlotRegistry as b, validateActionParams as b$, hasUnsafeCssFunction as b0, holdsNothing as b1, hostOf as b2, hoverCardAction as b3, hoverCardHandlers as b4, inlineElementsHoldingBlocks as b5, isCombinedOnElement as b6, isHostAllowed as b7, isHostBearingUrl as b8, isLineOwner as b9, offsetToPosition as bA, openDialogAction as bB, openDialogHandlers as bC, parseImageSize as bD, placeCaretIn as bE, placeImageAtSelection as bF, positionAfterLine as bG, rangeShowsNothing as bH, readActions as bI, readFileAsDataUrl as bJ, remoteHostOf as bK, removeAction as bL, reportResourceDecisions as bM, resolveFromPage as bN, richTextHasMedia as bO, richTextMaxLength as bP, richTextMinWords as bQ, richTextRequired as bR, richTextVisibleText as bS, rowRunsOf as bT, selectTriggerRange as bU, separateListKinds as bV, simpleHash as bW, stripCssComments as bX, stripStyleIfMatches as bY, structureAround as bZ, validateActionId as b_, isNestedList as ba, isPdfHeader as bb, isPhrasing as bc, isRichTextEmpty as bd, isSupportedDocumentFile as be, isZipHeader as bf, labelBlockedImages as bg, lastOwnInlineNode as bh, lineAbove as bi, lineBelow as bj, lineIsEmpty as bk, lineIsTextOnly as bl, lineKeepsItsElement as bm, lineOf as bn, lineOwnNodes as bo, lineTagIsFixed as bp, lineText as bq, linesBetween as br, linesMayJoin as bs, linkedPreviewDialogAction as bt, linkedPreviewDialogHandlers as bu, matchBlockInputRule as bv, matchInlineInputRule as bw, mountTopLayer as bx, nodeShowsNothing as by, normalizeHostEntry as bz, DEFAULT_FONT_FAMILIES as c, writeAction as c0, writeCombined as c1, DEFAULT_HIGHLIGHT_PALETTE as d, DEFAULT_LINK_SCHEMES as e, DEFAULT_TOOLBAR_ITEMS as f, DOCUMENT_IMPORT_ACCEPT as g, DOCX_MIME as h, isValidImageMagicBytes as i, FIND_MAX_QUERY_LENGTH as j, INLINE_RULE_LOOKBEHIND as k, PresetDialogComponent as l, PresetHoverCardComponent as m, RICH_TEXT_AI_CONTEXT as n, RICH_TEXT_AI_LOCALES as o, RICH_TEXT_COLORS_LOCALES as p, RICH_TEXT_COLOR_BUTTON_CONTEXT as q, RICH_TEXT_EMOJI_CONTEXT as r, RICH_TEXT_EMOJI_LOCALES as s, RICH_TEXT_FILE_IMPORT_BUTTON_CONTEXT as t, RICH_TEXT_FILE_IMPORT_LOCALES as u, RICH_TEXT_HISTORY_LOCALES as v, RICH_TEXT_IMAGES_BUTTON_CONTEXT as w, RICH_TEXT_IMAGES_LOCALES as x, RICH_TEXT_LINKS_BUTTON_CONTEXT as y, RICH_TEXT_LINKS_LOCALES as z };
|
|
40412
|
-
//# sourceMappingURL=gilav21-shadcn-angular-rte-gilav21-shadcn-angular-rte-
|
|
40684
|
+
//# sourceMappingURL=gilav21-shadcn-angular-rte-gilav21-shadcn-angular-rte-ATpviG2l.mjs.map
|