@nanahoshi/mona-ui 0.27.2 → 0.29.0
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/docs/api/chart.md +2 -2
- package/docs/api/locales.md +8 -0
- package/docs/api/popup.md +1 -1
- package/docs/api/theme.md +2 -2
- package/docs/chart.md +14 -0
- package/docs/editor.md +2 -0
- package/docs/installation.md +147 -15
- package/docs/introduction.md +37 -15
- package/docs/theming-built-in-themes.md +67 -0
- package/docs/theming-custom-colors.md +274 -0
- package/docs/theming-custom-themes.md +168 -0
- package/docs/theming.md +164 -248
- package/fesm2022/nanahoshi-mona-ui-auto-complete.mjs +1089 -603
- package/fesm2022/nanahoshi-mona-ui-avatar.mjs +369 -184
- package/fesm2022/nanahoshi-mona-ui-breadcrumb.mjs +658 -371
- package/fesm2022/nanahoshi-mona-ui-button-group.mjs +513 -359
- package/fesm2022/nanahoshi-mona-ui-button.mjs +622 -517
- package/fesm2022/nanahoshi-mona-ui-calendar.mjs +2071 -1573
- package/fesm2022/nanahoshi-mona-ui-card.mjs +620 -316
- package/fesm2022/nanahoshi-mona-ui-chart.mjs +61151 -64921
- package/fesm2022/nanahoshi-mona-ui-check-box.mjs +646 -317
- package/fesm2022/nanahoshi-mona-ui-chip.mjs +737 -516
- package/fesm2022/nanahoshi-mona-ui-circular-progress-bar.mjs +441 -242
- package/fesm2022/nanahoshi-mona-ui-collapsible.mjs +443 -390
- package/fesm2022/nanahoshi-mona-ui-color-gradient.mjs +1138 -814
- package/fesm2022/nanahoshi-mona-ui-color-palette.mjs +1114 -959
- package/fesm2022/nanahoshi-mona-ui-color-picker.mjs +858 -504
- package/fesm2022/nanahoshi-mona-ui-combo-box.mjs +1181 -742
- package/fesm2022/nanahoshi-mona-ui-command.mjs +1454 -853
- package/fesm2022/nanahoshi-mona-ui-common.mjs +569 -743
- package/fesm2022/nanahoshi-mona-ui-contextmenu.mjs +978 -532
- package/fesm2022/nanahoshi-mona-ui-date-input.mjs +283 -266
- package/fesm2022/nanahoshi-mona-ui-date-picker.mjs +973 -451
- package/fesm2022/nanahoshi-mona-ui-datetime-picker.mjs +1203 -658
- package/fesm2022/nanahoshi-mona-ui-dialog.mjs +1415 -936
- package/fesm2022/nanahoshi-mona-ui-dropdown-button.mjs +1165 -568
- package/fesm2022/nanahoshi-mona-ui-dropdown-list.mjs +1142 -677
- package/fesm2022/nanahoshi-mona-ui-dropdowns.mjs +1018 -734
- package/fesm2022/nanahoshi-mona-ui-editor.mjs +3589 -2122
- package/fesm2022/nanahoshi-mona-ui-expansion-panel.mjs +577 -359
- package/fesm2022/nanahoshi-mona-ui-fieldset.mjs +311 -151
- package/fesm2022/nanahoshi-mona-ui-filter.mjs +1086 -718
- package/fesm2022/nanahoshi-mona-ui-grid-grid-colgroup.component-NhONCVIX.mjs +77 -0
- package/fesm2022/nanahoshi-mona-ui-grid-grid-footer-row.component-Djv8ZnT5.mjs +480 -0
- package/fesm2022/nanahoshi-mona-ui-grid-grid-list.component-WbXAzGCa.mjs +470 -0
- package/fesm2022/nanahoshi-mona-ui-grid-grid-row.component-DkWTD3pN.mjs +2115 -0
- package/fesm2022/nanahoshi-mona-ui-grid-grid-virtual-list.component-DAHqTwBJ.mjs +330 -0
- package/fesm2022/nanahoshi-mona-ui-grid-grid.styles-BmLU-3zP.mjs +3766 -0
- package/fesm2022/nanahoshi-mona-ui-grid.mjs +5418 -2
- package/fesm2022/nanahoshi-mona-ui-i18n-icu.mjs +1379 -1079
- package/fesm2022/nanahoshi-mona-ui-i18n.mjs +4451 -5077
- package/fesm2022/nanahoshi-mona-ui-internal-filter-input.mjs +344 -143
- package/fesm2022/nanahoshi-mona-ui-internal-indicator-icon.mjs +257 -127
- package/fesm2022/nanahoshi-mona-ui-internal-list.mjs +2080 -1829
- package/fesm2022/nanahoshi-mona-ui-internal-popup-menu.mjs +103 -141
- package/fesm2022/nanahoshi-mona-ui-internal-tree.mjs +2498 -2706
- package/fesm2022/nanahoshi-mona-ui-internal.mjs +722 -1007
- package/fesm2022/nanahoshi-mona-ui-label.mjs +313 -202
- package/fesm2022/nanahoshi-mona-ui-list-box.mjs +1308 -1009
- package/fesm2022/nanahoshi-mona-ui-list-view.mjs +1411 -677
- package/fesm2022/nanahoshi-mona-ui-list.mjs +1 -6
- package/fesm2022/nanahoshi-mona-ui-locales-ar-sa.mjs +556 -577
- package/fesm2022/nanahoshi-mona-ui-locales-de-de.mjs +530 -573
- package/fesm2022/nanahoshi-mona-ui-locales-es-es.mjs +530 -573
- package/fesm2022/nanahoshi-mona-ui-locales-fr-fr.mjs +533 -576
- package/fesm2022/nanahoshi-mona-ui-locales-id-id.mjs +520 -555
- package/fesm2022/nanahoshi-mona-ui-locales-it-it.mjs +530 -571
- package/fesm2022/nanahoshi-mona-ui-locales-ja-jp.mjs +520 -555
- package/fesm2022/nanahoshi-mona-ui-locales-ko-kr.mjs +520 -555
- package/fesm2022/nanahoshi-mona-ui-locales-pl-pl.mjs +599 -0
- package/fesm2022/nanahoshi-mona-ui-locales-pt-br.mjs +530 -571
- package/fesm2022/nanahoshi-mona-ui-locales-ru-ru.mjs +576 -591
- package/fesm2022/nanahoshi-mona-ui-locales-tr-tr.mjs +530 -565
- package/fesm2022/nanahoshi-mona-ui-locales-zh-cn.mjs +520 -555
- package/fesm2022/nanahoshi-mona-ui-locales-zh-tw.mjs +520 -555
- package/fesm2022/nanahoshi-mona-ui-locales.mjs +61 -77
- package/fesm2022/nanahoshi-mona-ui-menubar.mjs +1411 -829
- package/fesm2022/nanahoshi-mona-ui-multi-select.mjs +1326 -702
- package/fesm2022/nanahoshi-mona-ui-notification.mjs +763 -675
- package/fesm2022/nanahoshi-mona-ui-numeric-text-box.mjs +1306 -826
- package/fesm2022/nanahoshi-mona-ui-otp-input.mjs +1122 -897
- package/fesm2022/nanahoshi-mona-ui-pager.mjs +1110 -651
- package/fesm2022/nanahoshi-mona-ui-placeholder.mjs +95 -53
- package/fesm2022/nanahoshi-mona-ui-popover.mjs +559 -397
- package/fesm2022/nanahoshi-mona-ui-popup-menu.mjs +2323 -1694
- package/fesm2022/nanahoshi-mona-ui-popup.mjs +1657 -1455
- package/fesm2022/nanahoshi-mona-ui-progress-bar.mjs +441 -267
- package/fesm2022/nanahoshi-mona-ui-query.mjs +211 -340
- package/fesm2022/nanahoshi-mona-ui-radio-button.mjs +1017 -548
- package/fesm2022/nanahoshi-mona-ui-rating.mjs +874 -624
- package/fesm2022/nanahoshi-mona-ui-scroll-view.mjs +1130 -917
- package/fesm2022/nanahoshi-mona-ui-segmented.mjs +705 -455
- package/fesm2022/nanahoshi-mona-ui-sheet.mjs +461 -283
- package/fesm2022/nanahoshi-mona-ui-sidebar.mjs +2791 -2449
- package/fesm2022/nanahoshi-mona-ui-skeleton.mjs +145 -90
- package/fesm2022/nanahoshi-mona-ui-slider.mjs +1563 -1103
- package/fesm2022/nanahoshi-mona-ui-spinner.mjs +738 -673
- package/fesm2022/nanahoshi-mona-ui-split-button.mjs +1287 -647
- package/fesm2022/nanahoshi-mona-ui-splitter.mjs +1313 -909
- package/fesm2022/nanahoshi-mona-ui-stepper.mjs +761 -540
- package/fesm2022/nanahoshi-mona-ui-switch.mjs +611 -280
- package/fesm2022/nanahoshi-mona-ui-tabs.mjs +1393 -841
- package/fesm2022/nanahoshi-mona-ui-text-area.mjs +142 -73
- package/fesm2022/nanahoshi-mona-ui-text-box.mjs +876 -374
- package/fesm2022/nanahoshi-mona-ui-theme.mjs +1465 -1449
- package/fesm2022/nanahoshi-mona-ui-time-picker.mjs +897 -443
- package/fesm2022/nanahoshi-mona-ui-time-selector.mjs +1100 -703
- package/fesm2022/nanahoshi-mona-ui-tooltip.mjs +789 -538
- package/fesm2022/nanahoshi-mona-ui-tree-view.mjs +1361 -805
- package/fesm2022/nanahoshi-mona-ui-window.mjs +2145 -1531
- package/fesm2022/nanahoshi-mona-ui.mjs +1 -8
- package/llms.txt +7 -3
- package/locales/pl-pl/package.json +4 -0
- package/locales/pl-pl/pl-pl.messages.json +536 -0
- package/package.json +66 -23
- package/types/nanahoshi-mona-ui-auto-complete.d.ts +367 -233
- package/types/nanahoshi-mona-ui-avatar.d.ts +722 -649
- package/types/nanahoshi-mona-ui-breadcrumb.d.ts +134 -103
- package/types/nanahoshi-mona-ui-button-group.d.ts +213 -152
- package/types/nanahoshi-mona-ui-button.d.ts +227 -166
- package/types/nanahoshi-mona-ui-calendar.d.ts +324 -259
- package/types/nanahoshi-mona-ui-card.d.ts +125 -111
- package/types/nanahoshi-mona-ui-chart.d.ts +10483 -7326
- package/types/nanahoshi-mona-ui-check-box.d.ts +293 -180
- package/types/nanahoshi-mona-ui-chip.d.ts +208 -141
- package/types/nanahoshi-mona-ui-circular-progress-bar.d.ts +194 -133
- package/types/nanahoshi-mona-ui-collapsible.d.ts +103 -87
- package/types/nanahoshi-mona-ui-color-gradient.d.ts +281 -213
- package/types/nanahoshi-mona-ui-color-palette.d.ts +201 -138
- package/types/nanahoshi-mona-ui-color-picker.d.ts +283 -194
- package/types/nanahoshi-mona-ui-combo-box.d.ts +401 -262
- package/types/nanahoshi-mona-ui-command.d.ts +279 -191
- package/types/nanahoshi-mona-ui-common.d.ts +354 -385
- package/types/nanahoshi-mona-ui-contextmenu.d.ts +142 -117
- package/types/nanahoshi-mona-ui-date-input.d.ts +79 -96
- package/types/nanahoshi-mona-ui-date-picker.d.ts +338 -208
- package/types/nanahoshi-mona-ui-datetime-picker.d.ts +413 -259
- package/types/nanahoshi-mona-ui-dialog.d.ts +470 -381
- package/types/nanahoshi-mona-ui-dropdown-button.d.ts +216 -168
- package/types/nanahoshi-mona-ui-dropdown-list.d.ts +369 -243
- package/types/nanahoshi-mona-ui-dropdowns.d.ts +231 -217
- package/types/nanahoshi-mona-ui-editor.d.ts +302 -235
- package/types/nanahoshi-mona-ui-expansion-panel.d.ts +140 -109
- package/types/nanahoshi-mona-ui-fieldset.d.ts +98 -68
- package/types/nanahoshi-mona-ui-filter.d.ts +150 -124
- package/types/nanahoshi-mona-ui-grid.d.ts +1956 -1678
- package/types/nanahoshi-mona-ui-i18n-icu.d.ts +25 -34
- package/types/nanahoshi-mona-ui-i18n.d.ts +987 -1052
- package/types/nanahoshi-mona-ui-internal-filter-input.d.ts +118 -71
- package/types/nanahoshi-mona-ui-internal-indicator-icon.d.ts +56 -27
- package/types/nanahoshi-mona-ui-internal-list.d.ts +474 -408
- package/types/nanahoshi-mona-ui-internal-popup-menu.d.ts +143 -150
- package/types/nanahoshi-mona-ui-internal-tree.d.ts +493 -506
- package/types/nanahoshi-mona-ui-internal.d.ts +195 -213
- package/types/nanahoshi-mona-ui-label.d.ts +108 -78
- package/types/nanahoshi-mona-ui-list-box.d.ts +392 -322
- package/types/nanahoshi-mona-ui-list-view.d.ts +423 -282
- package/types/nanahoshi-mona-ui-list.d.ts +2 -1
- package/types/nanahoshi-mona-ui-locales-ar-sa.d.ts +540 -542
- package/types/nanahoshi-mona-ui-locales-de-de.d.ts +540 -542
- package/types/nanahoshi-mona-ui-locales-es-es.d.ts +540 -542
- package/types/nanahoshi-mona-ui-locales-fr-fr.d.ts +540 -542
- package/types/nanahoshi-mona-ui-locales-id-id.d.ts +540 -542
- package/types/nanahoshi-mona-ui-locales-it-it.d.ts +540 -542
- package/types/nanahoshi-mona-ui-locales-ja-jp.d.ts +540 -542
- package/types/nanahoshi-mona-ui-locales-ko-kr.d.ts +540 -542
- package/types/nanahoshi-mona-ui-locales-pl-pl.d.ts +540 -0
- package/types/nanahoshi-mona-ui-locales-pt-br.d.ts +540 -542
- package/types/nanahoshi-mona-ui-locales-ru-ru.d.ts +540 -542
- package/types/nanahoshi-mona-ui-locales-tr-tr.d.ts +540 -542
- package/types/nanahoshi-mona-ui-locales-zh-cn.d.ts +540 -542
- package/types/nanahoshi-mona-ui-locales-zh-tw.d.ts +540 -542
- package/types/nanahoshi-mona-ui-locales.d.ts +18 -19
- package/types/nanahoshi-mona-ui-menubar.d.ts +210 -181
- package/types/nanahoshi-mona-ui-multi-select.d.ts +416 -276
- package/types/nanahoshi-mona-ui-notification.d.ts +140 -151
- package/types/nanahoshi-mona-ui-numeric-text-box.d.ts +407 -270
- package/types/nanahoshi-mona-ui-otp-input.d.ts +364 -241
- package/types/nanahoshi-mona-ui-pager.d.ts +379 -301
- package/types/nanahoshi-mona-ui-placeholder.d.ts +35 -28
- package/types/nanahoshi-mona-ui-popover.d.ts +176 -134
- package/types/nanahoshi-mona-ui-popup-menu.d.ts +488 -344
- package/types/nanahoshi-mona-ui-popup.d.ts +698 -560
- package/types/nanahoshi-mona-ui-progress-bar.d.ts +197 -137
- package/types/nanahoshi-mona-ui-query.d.ts +82 -88
- package/types/nanahoshi-mona-ui-radio-button.d.ts +434 -269
- package/types/nanahoshi-mona-ui-rating.d.ts +348 -254
- package/types/nanahoshi-mona-ui-scroll-view.d.ts +244 -172
- package/types/nanahoshi-mona-ui-segmented.d.ts +250 -175
- package/types/nanahoshi-mona-ui-sheet.d.ts +115 -63
- package/types/nanahoshi-mona-ui-sidebar.d.ts +653 -493
- package/types/nanahoshi-mona-ui-skeleton.d.ts +55 -39
- package/types/nanahoshi-mona-ui-slider.d.ts +503 -354
- package/types/nanahoshi-mona-ui-spinner.d.ts +125 -112
- package/types/nanahoshi-mona-ui-split-button.d.ts +241 -196
- package/types/nanahoshi-mona-ui-splitter.d.ts +124 -78
- package/types/nanahoshi-mona-ui-stepper.d.ts +206 -181
- package/types/nanahoshi-mona-ui-switch.d.ts +197 -131
- package/types/nanahoshi-mona-ui-tabs.d.ts +349 -248
- package/types/nanahoshi-mona-ui-text-area.d.ts +52 -36
- package/types/nanahoshi-mona-ui-text-box.d.ts +349 -218
- package/types/nanahoshi-mona-ui-theme.d.ts +415 -408
- package/types/nanahoshi-mona-ui-time-picker.d.ts +357 -217
- package/types/nanahoshi-mona-ui-time-selector.d.ts +255 -170
- package/types/nanahoshi-mona-ui-tooltip.d.ts +222 -144
- package/types/nanahoshi-mona-ui-tree-view.d.ts +466 -308
- package/types/nanahoshi-mona-ui-window.d.ts +494 -399
- package/types/nanahoshi-mona-ui.d.ts +1 -2
- package/fesm2022/nanahoshi-mona-ui-grid-grid-footer-row.component-DjNnVxHE.mjs +0 -181
- package/fesm2022/nanahoshi-mona-ui-grid-grid-list.component-ihQIKeP-.mjs +0 -208
- package/fesm2022/nanahoshi-mona-ui-grid-grid-row.component-BpnybNcs.mjs +0 -1082
- package/fesm2022/nanahoshi-mona-ui-grid-grid-virtual-list.component-CYlgfc7c.mjs +0 -186
- package/fesm2022/nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-LCzfCYd3.mjs +0 -7568
|
@@ -1,51 +1,47 @@
|
|
|
1
|
-
import { LiveAnnouncer } from
|
|
2
|
-
import { Clipboard } from
|
|
3
|
-
import { NgTemplateOutlet } from
|
|
4
|
-
import * as i0 from
|
|
5
|
-
import {
|
|
6
|
-
import { takeUntilDestroyed } from
|
|
7
|
-
import {
|
|
8
|
-
import { ButtonDirective } from
|
|
9
|
-
import {
|
|
10
|
-
import { DropdownButtonComponent, DropdownButtonItemComponent, DropdownButtonTextTemplateDirective } from
|
|
11
|
-
import { NumericTextBoxComponent, NumericTextBoxPrefixTemplateDirective } from
|
|
12
|
-
import { SliderComponent } from
|
|
13
|
-
import { TextBoxComponent, TextBoxPrefixTemplateDirective, TextBoxSuffixTemplateDirective } from
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import { cva } from
|
|
17
|
-
|
|
18
|
-
// Generated from i18n/catalogs/en-US.messages.json by scripts/generate-locale-catalogs.ts. Do not edit.
|
|
19
|
-
// Edit the JSON file and run `npm run generate:locale-catalogs`.
|
|
1
|
+
import { LiveAnnouncer } from "@angular/cdk/a11y";
|
|
2
|
+
import { Clipboard } from "@angular/cdk/clipboard";
|
|
3
|
+
import { NgTemplateOutlet } from "@angular/common";
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
import { Component, DOCUMENT, DestroyRef, ElementRef, afterNextRender, booleanAttribute, computed, effect, inject, input, isDevMode, model, output, signal, untracked, viewChild } from "@angular/core";
|
|
6
|
+
import { takeUntilDestroyed } from "@angular/core/rxjs-interop";
|
|
7
|
+
import { LucideChevronsUpDown, LucideCopy, LucideDropletOff } from "@lucide/angular";
|
|
8
|
+
import { ButtonDirective } from "@nanahoshi/mona-ui/button";
|
|
9
|
+
import { formatAlpha, hex2rgba, hsva2rgba, injectEffectiveDisabled, injectLabelAssociation, isValidHex, parseColor, rgba2hex, rgba2hsla, rgba2hsva } from "@nanahoshi/mona-ui/internal";
|
|
10
|
+
import { DropdownButtonComponent, DropdownButtonItemComponent, DropdownButtonTextTemplateDirective } from "@nanahoshi/mona-ui/dropdown-button";
|
|
11
|
+
import { NumericTextBoxComponent, NumericTextBoxPrefixTemplateDirective } from "@nanahoshi/mona-ui/numeric-text-box";
|
|
12
|
+
import { SliderComponent } from "@nanahoshi/mona-ui/slider";
|
|
13
|
+
import { TextBoxComponent, TextBoxPrefixTemplateDirective, TextBoxSuffixTemplateDirective } from "@nanahoshi/mona-ui/text-box";
|
|
14
|
+
import { MonaI18nService, formatNumber } from "@nanahoshi/mona-ui/i18n";
|
|
15
|
+
import { filter, fromEvent, merge, switchMap, takeUntil, tap } from "rxjs";
|
|
16
|
+
import { cva } from "class-variance-authority";
|
|
20
17
|
function localizeNumber(value, options) {
|
|
21
|
-
|
|
18
|
+
return formatNumber(value, "en-US", options);
|
|
22
19
|
}
|
|
23
20
|
const COLOR_GRADIENT_DEFAULT_MESSAGES = {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
21
|
+
alpha: "Alpha",
|
|
22
|
+
alphaText: (opacity) => `Opacity ${localizeNumber(opacity)}%`,
|
|
23
|
+
apply: "Apply",
|
|
24
|
+
blue: "Blue",
|
|
25
|
+
cancel: "Cancel",
|
|
26
|
+
clearColor: "Clear color",
|
|
27
|
+
colorCopied: "Color copied",
|
|
28
|
+
colorGradient: "Color gradient",
|
|
29
|
+
copyAsHex: "Copy as HEX",
|
|
30
|
+
copyAsRgb: "Copy as RGB",
|
|
31
|
+
copyColor: "Copy color",
|
|
32
|
+
copyFailed: "Couldn't copy the color",
|
|
33
|
+
currentColor: "Current color",
|
|
34
|
+
green: "Green",
|
|
35
|
+
hexColor: "Hex color",
|
|
36
|
+
hue: "Hue",
|
|
37
|
+
previousColor: "Previous color",
|
|
38
|
+
red: "Red",
|
|
39
|
+
saturation: "Saturation",
|
|
40
|
+
saturationAndValue: "Color saturation and value",
|
|
41
|
+
saturationAndValueText: (saturation, value) => `Saturation ${localizeNumber(saturation)}%, Value ${localizeNumber(value)}%`,
|
|
42
|
+
switchColorMode: "Switch color mode",
|
|
43
|
+
value: "Value"
|
|
47
44
|
};
|
|
48
|
-
|
|
49
45
|
const colorGradientBaseThemeVariants = cva(`
|
|
50
46
|
flex flex-col min-w-64
|
|
51
47
|
gap-2 p-2
|
|
@@ -65,17 +61,13 @@ const colorGradientHsvRectangleThemeVariants = cva(`
|
|
|
65
61
|
cursor-crosshair touch-none forced-color-adjust-none
|
|
66
62
|
bg-[linear-gradient(to_bottom,rgba(0,0,0,0),black),linear-gradient(to_right,white,rgba(255,255,255,0))]
|
|
67
63
|
border border-border-subtle
|
|
68
|
-
`, {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
full: "rounded-lg" // Full is not suitable for color gradient rectangle.
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
});
|
|
64
|
+
`, { variants: { rounded: {
|
|
65
|
+
none: "rounded-none",
|
|
66
|
+
small: "rounded-sm",
|
|
67
|
+
medium: "rounded-md",
|
|
68
|
+
large: "rounded-lg",
|
|
69
|
+
full: "rounded-lg"
|
|
70
|
+
} } });
|
|
79
71
|
const colorGradientHsvRectangleHandleThemeVariants = cva(`
|
|
80
72
|
absolute
|
|
81
73
|
h-3 w-3
|
|
@@ -86,774 +78,1106 @@ const colorGradientHsvRectangleHandleThemeVariants = cva(`
|
|
|
86
78
|
|
|
87
79
|
focus-visible:outline-2 focus-visible:outline-white/90!
|
|
88
80
|
focus-visible:shadow-[0_0_0_4px_rgb(0_0_0/0.9)]
|
|
89
|
-
`, {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
full: "rounded-full"
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
});
|
|
81
|
+
`, { variants: { rounded: {
|
|
82
|
+
none: "rounded-none",
|
|
83
|
+
small: "rounded-sm",
|
|
84
|
+
medium: "rounded-md",
|
|
85
|
+
large: "rounded-lg",
|
|
86
|
+
full: "rounded-full"
|
|
87
|
+
} } });
|
|
100
88
|
const colorGradientPreviewThemeVariants = cva(`
|
|
101
89
|
flex h-10 w-10
|
|
102
90
|
border border-border-subtle
|
|
103
91
|
forced-color-adjust-none
|
|
104
92
|
focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus-indicator
|
|
105
|
-
`, {
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
full: "rounded-full"
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
});
|
|
93
|
+
`, { variants: { rounded: {
|
|
94
|
+
none: "rounded-none",
|
|
95
|
+
small: "rounded-sm",
|
|
96
|
+
medium: "rounded-md",
|
|
97
|
+
large: "rounded-lg",
|
|
98
|
+
full: "rounded-full"
|
|
99
|
+
} } });
|
|
116
100
|
const colorGradientSliderHandleThemeVariants = cva(`
|
|
117
101
|
h-3 w-3
|
|
118
102
|
bg-transparent
|
|
119
103
|
border-3 border-white/90
|
|
120
104
|
outline outline-solid outline-black/90
|
|
121
105
|
`);
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: ColorGradientComponent, isStandalone: true, selector: "mona-color-gradient", inputs: { ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelledBy: { classPropertyName: "ariaLabelledBy", publicName: "aria-labelledby", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, format: { classPropertyName: "format", publicName: "format", isSignal: true, isRequired: false, transformFunction: null }, invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, opacity: { classPropertyName: "opacity", publicName: "opacity", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, rounded: { classPropertyName: "rounded", publicName: "rounded", isSignal: true, isRequired: false, transformFunction: null }, showButtons: { classPropertyName: "showButtons", publicName: "showButtons", isSignal: true, isRequired: false, transformFunction: null }, showColorInputs: { classPropertyName: "showColorInputs", publicName: "showColorInputs", isSignal: true, isRequired: false, transformFunction: null }, showHexInput: { classPropertyName: "showHexInput", publicName: "showHexInput", isSignal: true, isRequired: false, transformFunction: null }, touched: { classPropertyName: "touched", publicName: "touched", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { apply: "apply", cancel: "cancel", touch: "touch", value: "valueChange" }, host: { listeners: { "focusout": "onFocusOut($event)" }, properties: { "class": "baseClasses()", "attr.data-disabled": "effectiveDisabled()", "attr.data-readonly": "readonly() || null", "attr.data-invalid": "invalidState() || null", "attr.role": "'group'", "attr.aria-label": "labelledBy() ? null : ariaLabel() || messages().colorGradient", "attr.aria-labelledby": "labelledBy()", "attr.aria-invalid": "invalidState() ? 'true' : null" } }, viewQueries: [{ propertyName: "hsvHandle", first: true, predicate: ["hsvPointer"], descendants: true, isSignal: true }, { propertyName: "hsvRectangle", first: true, predicate: ["hsvRectangle"], descendants: true, isSignal: true }], ngImport: i0, template: "<div [class]=\"hsvRectangleClasses()\" [style.background-color]=\"hsvRectangleBackground()\" #hsvRectangle>\n <div\n [class]=\"hsvRectangleHandleClasses()\"\n [style.left.%]=\"hsv().s ?? 0\"\n [style.top.%]=\"100 - (hsv().v ?? 100)\"\n [attr.tabindex]=\"effectiveDisabled() ? -1 : 0\"\n [attr.role]=\"'slider'\"\n [attr.aria-label]=\"messages().saturationAndValue\"\n [attr.aria-valuemin]=\"0\"\n [attr.aria-valuemax]=\"100\"\n [attr.aria-valuenow]=\"roundedSaturation()\"\n [attr.aria-valuetext]=\"messages().saturationAndValueText(roundedSaturation(), roundedValue())\"\n [attr.aria-disabled]=\"effectiveDisabled() || null\"\n [attr.aria-readonly]=\"readonly() || null\"\n (keydown)=\"onHsvHandleKeyDown($event)\"\n #hsvPointer></div>\n</div>\n<div class=\"flex items-center gap-2\">\n <div class=\"flex flex-1 flex-col gap-1 me-2 forced-color-adjust-none\">\n <mona-slider\n dir=\"ltr\"\n [aria-label]=\"messages().hue\"\n [minValue]=\"0\"\n [maxValue]=\"360\"\n [trackBackground]=\"'linear-gradient(to right, #ff0000, #ffff00, #00ff00, #00ffff, #0000ff, #ff00ff, #ff0000)'\"\n [selectionBackground]=\"'transparent'\"\n [handleClasses]=\"sliderHandleClasses()\"\n [trackSize]=\"sliderHeight\"\n [rounded]=\"rounded()\"\n [value]=\"roundedHue()\"\n [disabled]=\"effectiveDisabled()\"\n [readonly]=\"readonly()\"\n (valueChange)=\"onHueChange($event)\"></mona-slider>\n @if (opacity()) {\n <mona-slider\n dir=\"ltr\"\n [aria-label]=\"messages().alpha\"\n [ariaValueText]=\"alphaValueText()\"\n [minValue]=\"0\"\n [maxValue]=\"255\"\n [trackBackground]=\"alphaSliderBackground()\"\n [selectionBackground]=\"'transparent'\"\n [handleClasses]=\"sliderHandleClasses()\"\n [trackSize]=\"sliderHeight\"\n [rounded]=\"rounded()\"\n [value]=\"alpha()\"\n [disabled]=\"effectiveDisabled()\"\n [readonly]=\"readonly()\"\n (valueChange)=\"onAlphaChange($event)\"></mona-slider>\n }\n </div>\n @for (preview of colorPreviews(); track preview.type) {\n <div\n [class]=\"colorPreviewClasses()\"\n [class.cursor-pointer]=\"$index === 1\"\n [style.background-color]=\"preview.color\"\n [attr.title]=\"$index === 1 ? preview.title : null\"\n [attr.aria-label]=\"$index === 1 ? preview.title : null\"\n [attr.aria-hidden]=\"$index === 0 ? 'true' : null\"\n [attr.aria-disabled]=\"$index === 1 && interactionDisabled() ? 'true' : null\"\n [attr.role]=\"$index === 1 ? 'button' : null\"\n [attr.tabindex]=\"$index === 1 && !interactionDisabled() ? 0 : null\"\n (click)=\"preview.onClick?.()\"\n (keydown)=\"onPreviousColorKeyDown($event, preview.onClick)\"></div>\n }\n <button\n monaButton\n look=\"ghost\"\n size=\"small\"\n [disabled]=\"interactionDisabled()\"\n [attr.aria-label]=\"messages().clearColor\"\n (click)=\"onClearClick()\">\n <svg lucideDropletOff [size]=\"16\" aria-hidden=\"true\"></svg>\n </button>\n</div>\n<div class=\"flex flex-col gap-2\">\n @if (showColorInputs()) {\n <div class=\"flex gap-2\">\n <div class=\"flex gap-1\">\n @for (input of colorInputs(); track input.key) {\n <mona-numeric-text-box\n [aria-label]=\"input.ariaLabel\"\n [value]=\"input.value\"\n [minValue]=\"input.min\"\n [maxValue]=\"input.max\"\n [decimals]=\"0\"\n [spinners]=\"false\"\n [nullable]=\"false\"\n [rounded]=\"rounded()\"\n [size]=\"'small'\"\n class=\"w-18\"\n [disabled]=\"effectiveDisabled()\"\n [readonly]=\"readonly()\"\n (valueChange)=\"input.change($event)\">\n <ng-template monaNumericTextBoxPrefixTemplate>\n <ng-container\n [ngTemplateOutlet]=\"numericInputPrefixTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: input.label }\"></ng-container>\n </ng-template>\n </mona-numeric-text-box>\n }\n </div>\n <div class=\"flex flex-1 items-center justify-end\">\n <button\n monaButton\n look=\"ghost\"\n [rounded]=\"rounded()\"\n size=\"small\"\n [disabled]=\"effectiveDisabled()\"\n [attr.aria-label]=\"messages().switchColorMode\"\n (click)=\"onSwitchColorModeClick()\">\n <svg lucideChevronsUpDown [size]=\"16\" aria-hidden=\"true\"></svg>\n </button>\n </div>\n </div>\n }\n @if (showHexInput()) {\n <mona-text-box\n [aria-label]=\"messages().hexColor\"\n [rounded]=\"rounded()\"\n [value]=\"hex()\"\n [disabled]=\"effectiveDisabled()\"\n [readonly]=\"readonly()\"\n (valueChange)=\"onHexChange($event)\"\n (inputBlur)=\"onHexInputBlur()\"\n (inputFocus)=\"onHexInputFocus()\"\n class=\"w-full\">\n <ng-template monaTextBoxPrefixTemplate>\n <ng-container\n [ngTemplateOutlet]=\"numericInputPrefixTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: 'HEX', classes: 'w-auto px-2' }\"></ng-container>\n </ng-template>\n <ng-template monaTextBoxSuffixTemplate>\n <mona-dropdown-button\n look=\"ghost\"\n [disabled]=\"effectiveDisabled() || !selectedColor()\"\n [iconOnly]=\"true\"\n [aria-label]=\"messages().copyColor\"\n class=\"h-full\">\n <ng-template monaDropdownButtonTextTemplate>\n <svg lucideCopy [size]=\"12\" aria-hidden=\"true\"></svg>\n </ng-template>\n <mona-dropdown-button-item\n [label]=\"messages().copyAsHex\"\n (menuClick)=\"onCopyColorSelect('hex')\"></mona-dropdown-button-item>\n <mona-dropdown-button-item\n [label]=\"messages().copyAsRgb\"\n (menuClick)=\"onCopyColorSelect('rgb')\"></mona-dropdown-button-item>\n </mona-dropdown-button>\n </ng-template>\n </mona-text-box>\n }\n @if (showButtons()) {\n <div class=\"flex items-center justify-end gap-2\">\n <button\n monaButton\n [rounded]=\"rounded()\"\n look=\"primary\"\n [disabled]=\"interactionDisabled()\"\n (click)=\"onApply()\">\n {{ messages().apply }}\n </button>\n <button monaButton [rounded]=\"rounded()\" [disabled]=\"effectiveDisabled()\" (click)=\"onCancel()\">\n {{ messages().cancel }}\n </button>\n </div>\n }\n</div>\n\n<ng-template #numericInputPrefixTemplate let-text let-classes=\"classes\">\n <span\n [class]=\"classes\"\n class=\"inline-flex items-center justify-center select-none w-7.5 [background-color:var(--mona-input-addon-background,var(--color-secondary))] h-full text-foreground text-xs font-semibold border-e border-e-input-border\"\n aria-hidden=\"true\"\n >{{ text }}</span\n >\n</ng-template>\n", dependencies: [{ kind: "component", type: LucideDropletOff, selector: "svg[lucideDropletOff]" }, { kind: "component", type: LucideChevronsUpDown, selector: "svg[lucideChevronsUpDown]" }, { kind: "component", type: NumericTextBoxComponent, selector: "mona-numeric-text-box", inputs: ["formatter", "maxValue", "minValue", "step", "value"], outputs: ["valueChange"] }, { kind: "directive", type: NumericTextBoxPrefixTemplateDirective, selector: "ng-template[monaNumericTextBoxPrefixTemplate]" }, { kind: "directive", type: ButtonDirective, selector: "button[monaButton]", inputs: ["aria-haspopup", "disabled", "iconOnly", "loading", "look", "rounded", "selected", "size", "tabindex", "toggleable", "type", "class", "value"], outputs: ["lookChange", "selectedChange"] }, { kind: "component", type: TextBoxComponent, selector: "mona-text-box", inputs: ["aria-describedby", "aria-label", "aria-labelledby", "clearButton", "disabled", "inputAttributes", "inputClass", "inputId", "inputStyle", "invalid", "maxLength", "minLength", "name", "placeholder", "readonly", "required", "rounded", "size", "touched", "type", "class", "value"], outputs: ["inputBlur", "inputFocus", "touch", "valueChange"] }, { kind: "directive", type: TextBoxPrefixTemplateDirective, selector: "ng-template[monaTextBoxPrefixTemplate]" }, { kind: "directive", type: TextBoxSuffixTemplateDirective, selector: "ng-template[monaTextBoxSuffixTemplate]" }, { kind: "component", type: SliderComponent, selector: "mona-slider", inputs: ["max", "min", "value"], outputs: ["valueChange"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: DropdownButtonComponent, selector: "mona-dropdown-button", inputs: ["aria-label", "aria-labelledby", "disabled", "iconOnly", "loading", "look", "popupWidth", "rounded", "showArrow", "size", "text", "class"], outputs: ["menuItemClick"] }, { kind: "component", type: DropdownButtonItemComponent, selector: "mona-dropdown-button-item" }, { kind: "directive", type: DropdownButtonTextTemplateDirective, selector: "ng-template[monaDropdownButtonTextTemplate]" }, { kind: "component", type: LucideCopy, selector: "svg[lucideCopy]" }] }); }
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
106
|
+
const DEFAULT_HSV = {
|
|
107
|
+
h: 0,
|
|
108
|
+
s: 0,
|
|
109
|
+
v: 100
|
|
110
|
+
};
|
|
111
|
+
const DEFAULT_RGB = {
|
|
112
|
+
r: 255,
|
|
113
|
+
g: 255,
|
|
114
|
+
b: 255
|
|
115
|
+
};
|
|
116
|
+
var ColorGradientComponent = class ColorGradientComponent {
|
|
117
|
+
#announcer;
|
|
118
|
+
#clipboard;
|
|
119
|
+
#destroyRef;
|
|
120
|
+
#document;
|
|
121
|
+
#hostElementRef;
|
|
122
|
+
#i18n;
|
|
123
|
+
#label;
|
|
124
|
+
#viewReady;
|
|
125
|
+
#edited;
|
|
126
|
+
#internalValueUpdatePending;
|
|
127
|
+
#lastInternalValue;
|
|
128
|
+
constructor() {
|
|
129
|
+
this.#announcer = inject(LiveAnnouncer);
|
|
130
|
+
this.#clipboard = inject(Clipboard);
|
|
131
|
+
this.#destroyRef = inject(DestroyRef);
|
|
132
|
+
this.#document = inject(DOCUMENT);
|
|
133
|
+
this.#hostElementRef = inject(ElementRef);
|
|
134
|
+
this.#i18n = inject(MonaI18nService);
|
|
135
|
+
this.#label = injectLabelAssociation({
|
|
136
|
+
activate: () => this.focus(),
|
|
137
|
+
ariaLabel: () => this.ariaLabel(),
|
|
138
|
+
ariaLabelledBy: () => this.ariaLabelledBy()
|
|
139
|
+
});
|
|
140
|
+
this.#viewReady = signal(false, ...ngDevMode ? [{ debugName: "#viewReady" }] : /* istanbul ignore next */ []);
|
|
141
|
+
this.#edited = false;
|
|
142
|
+
this.#internalValueUpdatePending = false;
|
|
143
|
+
this.#lastInternalValue = void 0;
|
|
144
|
+
this.alpha = signal(255, ...ngDevMode ? [{ debugName: "alpha" }] : /* istanbul ignore next */ []);
|
|
145
|
+
this.alphaInputColor = computed(() => {
|
|
146
|
+
const rgb = this.rgb();
|
|
147
|
+
return rgba2hex(rgb.r ?? 0, rgb.g ?? 0, rgb.b ?? 0, 255);
|
|
148
|
+
}, ...ngDevMode ? [{ debugName: "alphaInputColor" }] : /* istanbul ignore next */ []);
|
|
149
|
+
this.alphaSliderBackground = computed(() => {
|
|
150
|
+
return `linear-gradient(to right, transparent, ${this.alphaInputColor()})`;
|
|
151
|
+
}, ...ngDevMode ? [{ debugName: "alphaSliderBackground" }] : /* istanbul ignore next */ []);
|
|
152
|
+
this.alphaValueText = computed(() => {
|
|
153
|
+
const { alphaText } = this.messages();
|
|
154
|
+
return (alpha) => alphaText(Math.round(alpha / 255 * 100));
|
|
155
|
+
}, ...ngDevMode ? [{ debugName: "alphaValueText" }] : /* istanbul ignore next */ []);
|
|
156
|
+
this.baseClasses = computed(() => {
|
|
157
|
+
return colorGradientBaseThemeVariants();
|
|
158
|
+
}, ...ngDevMode ? [{ debugName: "baseClasses" }] : /* istanbul ignore next */ []);
|
|
159
|
+
this.colorInputs = computed(() => {
|
|
160
|
+
const baseInputs = this.colorMode() === "rgb" ? this.createRgbInputList() : this.createHsvInputList();
|
|
161
|
+
if (this.opacity()) baseInputs.push({
|
|
162
|
+
ariaLabel: this.messages().alpha,
|
|
163
|
+
key: "a",
|
|
164
|
+
label: "A",
|
|
165
|
+
value: this.alpha(),
|
|
166
|
+
min: 0,
|
|
167
|
+
max: 255,
|
|
168
|
+
change: (value) => this.onAlphaChange(value)
|
|
169
|
+
});
|
|
170
|
+
return baseInputs;
|
|
171
|
+
}, ...ngDevMode ? [{ debugName: "colorInputs" }] : /* istanbul ignore next */ []);
|
|
172
|
+
this.colorMode = signal("rgb", ...ngDevMode ? [{ debugName: "colorMode" }] : /* istanbul ignore next */ []);
|
|
173
|
+
this.colorPreviewClasses = computed(() => {
|
|
174
|
+
const rounded = this.rounded();
|
|
175
|
+
return colorGradientPreviewThemeVariants({ rounded });
|
|
176
|
+
}, ...ngDevMode ? [{ debugName: "colorPreviewClasses" }] : /* istanbul ignore next */ []);
|
|
177
|
+
this.colorPreviews = computed(() => [{
|
|
178
|
+
type: "current",
|
|
179
|
+
color: this.selectedColor(),
|
|
180
|
+
title: this.messages().currentColor
|
|
181
|
+
}, {
|
|
182
|
+
type: "last",
|
|
183
|
+
color: this.lastSelectedColor(),
|
|
184
|
+
title: this.messages().previousColor,
|
|
185
|
+
onClick: () => this.onResetColorClick()
|
|
186
|
+
}], ...ngDevMode ? [{ debugName: "colorPreviews" }] : /* istanbul ignore next */ []);
|
|
187
|
+
this.effectiveDisabled = injectEffectiveDisabled(() => this.disabled());
|
|
188
|
+
this.hex = computed(() => {
|
|
189
|
+
const rgb = this.rgb();
|
|
190
|
+
const alpha = this.alpha();
|
|
191
|
+
if (!this.hexFocused()) return rgba2hex(rgb.r, rgb.g, rgb.b, alpha);
|
|
192
|
+
return this.hexInputValue();
|
|
193
|
+
}, ...ngDevMode ? [{ debugName: "hex" }] : /* istanbul ignore next */ []);
|
|
194
|
+
this.hexFocused = signal(false, ...ngDevMode ? [{ debugName: "hexFocused" }] : /* istanbul ignore next */ []);
|
|
195
|
+
this.hexInputValue = signal("", ...ngDevMode ? [{ debugName: "hexInputValue" }] : /* istanbul ignore next */ []);
|
|
196
|
+
this.hsv = signal({ ...DEFAULT_HSV }, ...ngDevMode ? [{ debugName: "hsv" }] : /* istanbul ignore next */ []);
|
|
197
|
+
this.hsvHandle = viewChild.required("hsvPointer", ...ngDevMode ? [{ debugName: "hsvHandle" }] : /* istanbul ignore next */ []);
|
|
198
|
+
this.hsvRectangle = viewChild.required("hsvRectangle", ...ngDevMode ? [{ debugName: "hsvRectangle" }] : /* istanbul ignore next */ []);
|
|
199
|
+
this.hsvRectangleBackground = computed(() => {
|
|
200
|
+
const rgb = hsva2rgba(this.hsv().h ?? 0, 100, 100, 255);
|
|
201
|
+
return `rgb(${rgb.r}, ${rgb.g}, ${rgb.b})`;
|
|
202
|
+
}, ...ngDevMode ? [{ debugName: "hsvRectangleBackground" }] : /* istanbul ignore next */ []);
|
|
203
|
+
this.hsvRectangleClasses = computed(() => {
|
|
204
|
+
const rounded = this.rounded() === "full" ? "large" : this.rounded();
|
|
205
|
+
return colorGradientHsvRectangleThemeVariants({ rounded });
|
|
206
|
+
}, ...ngDevMode ? [{ debugName: "hsvRectangleClasses" }] : /* istanbul ignore next */ []);
|
|
207
|
+
this.hsvRectangleHandleClasses = computed(() => {
|
|
208
|
+
const rounded = this.rounded();
|
|
209
|
+
return colorGradientHsvRectangleHandleThemeVariants({ rounded });
|
|
210
|
+
}, ...ngDevMode ? [{ debugName: "hsvRectangleHandleClasses" }] : /* istanbul ignore next */ []);
|
|
211
|
+
this.interactionDisabled = computed(() => this.effectiveDisabled() || this.readonly(), ...ngDevMode ? [{ debugName: "interactionDisabled" }] : /* istanbul ignore next */ []);
|
|
212
|
+
this.invalidState = computed(() => this.touched() && (this.invalid() || this.required() && !this.value()), ...ngDevMode ? [{ debugName: "invalidState" }] : /* istanbul ignore next */ []);
|
|
213
|
+
this.labelledBy = this.#label.labelledBy;
|
|
214
|
+
this.lastSelectedColor = signal("", ...ngDevMode ? [{ debugName: "lastSelectedColor" }] : /* istanbul ignore next */ []);
|
|
215
|
+
this.messages = this.#i18n.componentMessages("colorGradient", COLOR_GRADIENT_DEFAULT_MESSAGES);
|
|
216
|
+
this.rgb = signal({ ...DEFAULT_RGB }, ...ngDevMode ? [{ debugName: "rgb" }] : /* istanbul ignore next */ []);
|
|
217
|
+
this.roundedHue = computed(() => Math.round(this.hsv().h ?? 0), ...ngDevMode ? [{ debugName: "roundedHue" }] : /* istanbul ignore next */ []);
|
|
218
|
+
this.roundedSaturation = computed(() => Math.round(this.hsv().s ?? 0), ...ngDevMode ? [{ debugName: "roundedSaturation" }] : /* istanbul ignore next */ []);
|
|
219
|
+
this.roundedValue = computed(() => Math.round(this.hsv().v ?? 0), ...ngDevMode ? [{ debugName: "roundedValue" }] : /* istanbul ignore next */ []);
|
|
220
|
+
this.selectedColor = computed(() => {
|
|
221
|
+
const rgb = this.rgb();
|
|
222
|
+
if (rgb.r == null || rgb.g == null || rgb.b == null) return "";
|
|
223
|
+
return `rgba(${rgb.r}, ${rgb.g}, ${rgb.b}, ${this.alpha() / 255})`;
|
|
224
|
+
}, ...ngDevMode ? [{ debugName: "selectedColor" }] : /* istanbul ignore next */ []);
|
|
225
|
+
this.sliderHandleClasses = computed(() => {
|
|
226
|
+
return colorGradientSliderHandleThemeVariants();
|
|
227
|
+
}, ...ngDevMode ? [{ debugName: "sliderHandleClasses" }] : /* istanbul ignore next */ []);
|
|
228
|
+
this.sliderHeight = 10;
|
|
229
|
+
this.apply = output();
|
|
230
|
+
this.ariaLabel = input("", {
|
|
231
|
+
...ngDevMode ? { debugName: "ariaLabel" } : /* istanbul ignore next */ {},
|
|
232
|
+
alias: "aria-label"
|
|
233
|
+
});
|
|
234
|
+
this.ariaLabelledBy = input("", {
|
|
235
|
+
...ngDevMode ? { debugName: "ariaLabelledBy" } : /* istanbul ignore next */ {},
|
|
236
|
+
alias: "aria-labelledby"
|
|
237
|
+
});
|
|
238
|
+
this.cancel = output();
|
|
239
|
+
this.disabled = input(false, {
|
|
240
|
+
...ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {},
|
|
241
|
+
transform: booleanAttribute
|
|
242
|
+
});
|
|
243
|
+
this.format = input("hex", ...ngDevMode ? [{ debugName: "format" }] : /* istanbul ignore next */ []);
|
|
244
|
+
this.invalid = input(false, {
|
|
245
|
+
...ngDevMode ? { debugName: "invalid" } : /* istanbul ignore next */ {},
|
|
246
|
+
transform: booleanAttribute
|
|
247
|
+
});
|
|
248
|
+
this.opacity = input(true, {
|
|
249
|
+
...ngDevMode ? { debugName: "opacity" } : /* istanbul ignore next */ {},
|
|
250
|
+
transform: booleanAttribute
|
|
251
|
+
});
|
|
252
|
+
this.readonly = input(false, {
|
|
253
|
+
...ngDevMode ? { debugName: "readonly" } : /* istanbul ignore next */ {},
|
|
254
|
+
transform: booleanAttribute
|
|
255
|
+
});
|
|
256
|
+
this.required = input(false, {
|
|
257
|
+
...ngDevMode ? { debugName: "required" } : /* istanbul ignore next */ {},
|
|
258
|
+
transform: booleanAttribute
|
|
259
|
+
});
|
|
260
|
+
this.rounded = input("medium", ...ngDevMode ? [{ debugName: "rounded" }] : /* istanbul ignore next */ []);
|
|
261
|
+
this.showButtons = input(true, {
|
|
262
|
+
...ngDevMode ? { debugName: "showButtons" } : /* istanbul ignore next */ {},
|
|
263
|
+
transform: booleanAttribute
|
|
264
|
+
});
|
|
265
|
+
this.showColorInputs = input(true, {
|
|
266
|
+
...ngDevMode ? { debugName: "showColorInputs" } : /* istanbul ignore next */ {},
|
|
267
|
+
transform: booleanAttribute
|
|
268
|
+
});
|
|
269
|
+
this.showHexInput = input(true, {
|
|
270
|
+
...ngDevMode ? { debugName: "showHexInput" } : /* istanbul ignore next */ {},
|
|
271
|
+
transform: booleanAttribute
|
|
272
|
+
});
|
|
273
|
+
this.touch = output();
|
|
274
|
+
this.touched = input(false, {
|
|
275
|
+
...ngDevMode ? { debugName: "touched" } : /* istanbul ignore next */ {},
|
|
276
|
+
transform: booleanAttribute
|
|
277
|
+
});
|
|
278
|
+
this.value = model(void 0, ...ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []);
|
|
279
|
+
afterNextRender({ read: () => {
|
|
280
|
+
this.lastSelectedColor.set(this.hex());
|
|
281
|
+
this.setHsvRectPointerEvents();
|
|
282
|
+
this.#viewReady.set(true);
|
|
283
|
+
} });
|
|
284
|
+
effect(() => {
|
|
285
|
+
if (!this.#viewReady()) return;
|
|
286
|
+
const value = this.value();
|
|
287
|
+
untracked(() => this.syncValue(value));
|
|
288
|
+
});
|
|
289
|
+
}
|
|
290
|
+
focus(options) {
|
|
291
|
+
this.hsvHandle().nativeElement.focus(options);
|
|
292
|
+
}
|
|
293
|
+
setLabelledBy(id) {
|
|
294
|
+
this.#label.setLabelledBy(id);
|
|
295
|
+
}
|
|
296
|
+
onAlphaChange(value) {
|
|
297
|
+
if (value == null) return;
|
|
298
|
+
this.#edited = true;
|
|
299
|
+
const alpha = this.getValidChannelValue(value, "a");
|
|
300
|
+
this.alpha.set(alpha);
|
|
301
|
+
this.updateHexInputValue();
|
|
302
|
+
if (!this.showButtons()) this.emitValue();
|
|
303
|
+
}
|
|
304
|
+
onApply() {
|
|
305
|
+
if (this.interactionDisabled()) return;
|
|
306
|
+
if (this.#edited || this.value() === void 0) {
|
|
307
|
+
this.lastSelectedColor.set(this.hex());
|
|
308
|
+
this.emitValue();
|
|
309
|
+
}
|
|
310
|
+
this.#edited = false;
|
|
311
|
+
this.apply.emit();
|
|
312
|
+
}
|
|
313
|
+
onCancel() {
|
|
314
|
+
this.loadValue(this.value());
|
|
315
|
+
this.cancel.emit();
|
|
316
|
+
}
|
|
317
|
+
onClearClick() {
|
|
318
|
+
if (this.interactionDisabled()) return;
|
|
319
|
+
this.#edited = true;
|
|
320
|
+
this.clear();
|
|
321
|
+
if (!this.showButtons()) this.commitValue(null);
|
|
322
|
+
}
|
|
323
|
+
onCopyColorSelect(mode) {
|
|
324
|
+
const rgb = this.rgb();
|
|
325
|
+
const text = mode === "hex" ? rgba2hex(rgb.r, rgb.g, rgb.b, this.alpha()) : `rgba(${rgb.r}, ${rgb.g}, ${rgb.b}, ${formatAlpha(this.alpha())})`;
|
|
326
|
+
const copied = this.#clipboard.copy(text);
|
|
327
|
+
this.#announcer.announce(copied ? this.messages().colorCopied : this.messages().copyFailed);
|
|
328
|
+
}
|
|
329
|
+
onFocusOut(event) {
|
|
330
|
+
const nextTarget = event.relatedTarget;
|
|
331
|
+
if (nextTarget instanceof Node && this.#hostElementRef.nativeElement.contains(nextTarget)) return;
|
|
332
|
+
this.touch.emit();
|
|
333
|
+
}
|
|
334
|
+
onHexChange(value) {
|
|
335
|
+
this.hexInputValue.set(value);
|
|
336
|
+
if (!isValidHex(value)) return;
|
|
337
|
+
this.#edited = true;
|
|
338
|
+
const rgb = hex2rgba(value);
|
|
339
|
+
const hsv = rgba2hsva(rgb.r, rgb.g, rgb.b, rgb.a);
|
|
340
|
+
this.hsv.update((c) => ({
|
|
341
|
+
...c,
|
|
342
|
+
h: hsv.h,
|
|
343
|
+
s: hsv.s,
|
|
344
|
+
v: hsv.v
|
|
345
|
+
}));
|
|
346
|
+
this.rgb.update((c) => ({
|
|
347
|
+
...c,
|
|
348
|
+
r: rgb.r,
|
|
349
|
+
g: rgb.g,
|
|
350
|
+
b: rgb.b
|
|
351
|
+
}));
|
|
352
|
+
this.alpha.set(rgb.a ?? 255);
|
|
353
|
+
if (!this.showButtons()) this.emitValue();
|
|
354
|
+
}
|
|
355
|
+
onHexInputBlur() {
|
|
356
|
+
this.hexFocused.set(false);
|
|
357
|
+
this.updateHexInputValue();
|
|
358
|
+
}
|
|
359
|
+
onHexInputFocus() {
|
|
360
|
+
this.updateHexInputValue();
|
|
361
|
+
this.hexFocused.set(true);
|
|
362
|
+
}
|
|
363
|
+
onHsvChange(value, channel) {
|
|
364
|
+
if (value == null) return;
|
|
365
|
+
this.#edited = true;
|
|
366
|
+
value = this.getValidChannelValue(value, channel);
|
|
367
|
+
this.hsv.update((c) => ({
|
|
368
|
+
...c,
|
|
369
|
+
[channel]: value
|
|
370
|
+
}));
|
|
371
|
+
this.updateOtherNullChannels(channel);
|
|
372
|
+
const hsv = this.hsv();
|
|
373
|
+
const rgb = hsva2rgba(hsv.h, hsv.s, hsv.v, this.alpha());
|
|
374
|
+
this.rgb.update((c) => ({
|
|
375
|
+
...c,
|
|
376
|
+
r: rgb.r,
|
|
377
|
+
g: rgb.g,
|
|
378
|
+
b: rgb.b
|
|
379
|
+
}));
|
|
380
|
+
this.updateHexInputValue();
|
|
381
|
+
if (!this.showButtons()) this.emitValue();
|
|
382
|
+
}
|
|
383
|
+
onHsvHandleKeyDown(event) {
|
|
384
|
+
if (this.interactionDisabled()) return;
|
|
385
|
+
const step = event.shiftKey ? 10 : 1;
|
|
386
|
+
const largeStep = 25;
|
|
387
|
+
let handled = false;
|
|
388
|
+
const currentHsv = this.hsv();
|
|
389
|
+
const currentSaturation = currentHsv.s ?? 0;
|
|
390
|
+
const currentValue = currentHsv.v ?? 0;
|
|
391
|
+
let newSaturation = currentSaturation;
|
|
392
|
+
let newValue = currentValue;
|
|
393
|
+
switch (event.key) {
|
|
394
|
+
case "ArrowLeft":
|
|
395
|
+
newSaturation = this.getValidChannelValue(currentSaturation - step, "s");
|
|
396
|
+
handled = true;
|
|
397
|
+
break;
|
|
398
|
+
case "ArrowRight":
|
|
399
|
+
newSaturation = this.getValidChannelValue(currentSaturation + step, "s");
|
|
400
|
+
handled = true;
|
|
401
|
+
break;
|
|
402
|
+
case "ArrowUp":
|
|
403
|
+
newValue = this.getValidChannelValue(currentValue + step, "v");
|
|
404
|
+
handled = true;
|
|
405
|
+
break;
|
|
406
|
+
case "ArrowDown":
|
|
407
|
+
newValue = this.getValidChannelValue(currentValue - step, "v");
|
|
408
|
+
handled = true;
|
|
409
|
+
break;
|
|
410
|
+
case "Home":
|
|
411
|
+
newSaturation = 0;
|
|
412
|
+
newValue = 100;
|
|
413
|
+
handled = true;
|
|
414
|
+
break;
|
|
415
|
+
case "End":
|
|
416
|
+
newSaturation = 100;
|
|
417
|
+
newValue = 0;
|
|
418
|
+
handled = true;
|
|
419
|
+
break;
|
|
420
|
+
case "PageUp":
|
|
421
|
+
newValue = this.getValidChannelValue(currentValue + largeStep, "v");
|
|
422
|
+
handled = true;
|
|
423
|
+
break;
|
|
424
|
+
case "PageDown":
|
|
425
|
+
newValue = this.getValidChannelValue(currentValue - largeStep, "v");
|
|
426
|
+
handled = true;
|
|
427
|
+
}
|
|
428
|
+
if (handled) {
|
|
429
|
+
event.preventDefault();
|
|
430
|
+
event.stopPropagation();
|
|
431
|
+
this.updateHsvValues(newSaturation, newValue);
|
|
432
|
+
this.updateHexInputValue();
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
onHueChange(value) {
|
|
436
|
+
this.#edited = true;
|
|
437
|
+
this.hsv.update((c) => ({
|
|
438
|
+
...c,
|
|
439
|
+
h: Math.round(value)
|
|
440
|
+
}));
|
|
441
|
+
this.updateOtherNullChannels("h");
|
|
442
|
+
this.updateRgbFromHsv();
|
|
443
|
+
this.updateHexInputValue();
|
|
444
|
+
}
|
|
445
|
+
onPreviousColorKeyDown(event, handler) {
|
|
446
|
+
if (event.key === "Enter" || event.key === " ") {
|
|
447
|
+
event.preventDefault();
|
|
448
|
+
handler?.();
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
onResetColorClick() {
|
|
452
|
+
if (this.interactionDisabled()) return;
|
|
453
|
+
this.onHexChange(this.lastSelectedColor());
|
|
454
|
+
}
|
|
455
|
+
onRgbChange(value, channel) {
|
|
456
|
+
if (value == null) return;
|
|
457
|
+
this.#edited = true;
|
|
458
|
+
value = this.getValidChannelValue(value, channel);
|
|
459
|
+
this.rgb.update((c) => ({
|
|
460
|
+
...c,
|
|
461
|
+
[channel]: value
|
|
462
|
+
}));
|
|
463
|
+
this.updateOtherNullChannels(channel);
|
|
464
|
+
const rgb = this.rgb();
|
|
465
|
+
const hsv = rgba2hsva(rgb.r, rgb.g, rgb.b, this.alpha());
|
|
466
|
+
this.hsv.update((c) => ({
|
|
467
|
+
...c,
|
|
468
|
+
h: hsv.h,
|
|
469
|
+
s: hsv.s,
|
|
470
|
+
v: hsv.v
|
|
471
|
+
}));
|
|
472
|
+
this.updateHexInputValue();
|
|
473
|
+
if (!this.showButtons()) this.emitValue();
|
|
474
|
+
}
|
|
475
|
+
onSwitchColorModeClick() {
|
|
476
|
+
this.colorMode.set(this.colorMode() === "rgb" ? "hsv" : "rgb");
|
|
477
|
+
}
|
|
478
|
+
clear() {
|
|
479
|
+
this.hexInputValue.set("");
|
|
480
|
+
this.rgb.update((c) => ({
|
|
481
|
+
...c,
|
|
482
|
+
r: null,
|
|
483
|
+
g: null,
|
|
484
|
+
b: null
|
|
485
|
+
}));
|
|
486
|
+
this.alpha.set(255);
|
|
487
|
+
this.hsv.update((c) => ({
|
|
488
|
+
...c,
|
|
489
|
+
h: null,
|
|
490
|
+
s: null,
|
|
491
|
+
v: null
|
|
492
|
+
}));
|
|
493
|
+
}
|
|
494
|
+
commitValue(value) {
|
|
495
|
+
if (value === this.value()) return;
|
|
496
|
+
this.#internalValueUpdatePending = true;
|
|
497
|
+
this.#lastInternalValue = value;
|
|
498
|
+
this.value.set(value);
|
|
499
|
+
}
|
|
500
|
+
createHsvInputList() {
|
|
501
|
+
const messages = this.messages();
|
|
502
|
+
return [
|
|
503
|
+
{
|
|
504
|
+
ariaLabel: messages.hue,
|
|
505
|
+
key: "h",
|
|
506
|
+
label: "H",
|
|
507
|
+
value: this.roundedHue(),
|
|
508
|
+
min: 0,
|
|
509
|
+
max: 360,
|
|
510
|
+
change: (value) => this.onHsvChange(value, "h")
|
|
511
|
+
},
|
|
512
|
+
{
|
|
513
|
+
ariaLabel: messages.saturation,
|
|
514
|
+
key: "s",
|
|
515
|
+
label: "S",
|
|
516
|
+
value: this.roundedSaturation(),
|
|
517
|
+
min: 0,
|
|
518
|
+
max: 100,
|
|
519
|
+
change: (value) => this.onHsvChange(value, "s")
|
|
520
|
+
},
|
|
521
|
+
{
|
|
522
|
+
ariaLabel: messages.value,
|
|
523
|
+
key: "v",
|
|
524
|
+
label: "V",
|
|
525
|
+
value: this.roundedValue(),
|
|
526
|
+
min: 0,
|
|
527
|
+
max: 100,
|
|
528
|
+
change: (value) => this.onHsvChange(value, "v")
|
|
529
|
+
}
|
|
530
|
+
];
|
|
531
|
+
}
|
|
532
|
+
createRgbInputList() {
|
|
533
|
+
const messages = this.messages();
|
|
534
|
+
return [
|
|
535
|
+
{
|
|
536
|
+
ariaLabel: messages.red,
|
|
537
|
+
key: "r",
|
|
538
|
+
label: "R",
|
|
539
|
+
value: this.rgb().r,
|
|
540
|
+
min: 0,
|
|
541
|
+
max: 255,
|
|
542
|
+
change: (value) => this.onRgbChange(value, "r")
|
|
543
|
+
},
|
|
544
|
+
{
|
|
545
|
+
ariaLabel: messages.green,
|
|
546
|
+
key: "g",
|
|
547
|
+
label: "G",
|
|
548
|
+
value: this.rgb().g,
|
|
549
|
+
min: 0,
|
|
550
|
+
max: 255,
|
|
551
|
+
change: (value) => this.onRgbChange(value, "g")
|
|
552
|
+
},
|
|
553
|
+
{
|
|
554
|
+
ariaLabel: messages.blue,
|
|
555
|
+
key: "b",
|
|
556
|
+
label: "B",
|
|
557
|
+
value: this.rgb().b,
|
|
558
|
+
min: 0,
|
|
559
|
+
max: 255,
|
|
560
|
+
change: (value) => this.onRgbChange(value, "b")
|
|
561
|
+
}
|
|
562
|
+
];
|
|
563
|
+
}
|
|
564
|
+
emitValue() {
|
|
565
|
+
const rgb = this.rgb();
|
|
566
|
+
const alpha = this.alpha();
|
|
567
|
+
if (rgb.r == null || rgb.g == null || rgb.b == null || alpha == null) {
|
|
568
|
+
this.commitValue(null);
|
|
569
|
+
return;
|
|
570
|
+
}
|
|
571
|
+
const format = this.format();
|
|
572
|
+
if (format === "hex") this.commitValue(rgba2hex(rgb.r, rgb.g, rgb.b, alpha));
|
|
573
|
+
else if (format === "rgb") this.commitValue(`rgba(${rgb.r}, ${rgb.g}, ${rgb.b}, ${formatAlpha(alpha)})`);
|
|
574
|
+
else if (format === "hsl") {
|
|
575
|
+
const hsl = rgba2hsla(rgb.r, rgb.g, rgb.b, alpha);
|
|
576
|
+
this.commitValue(`hsla(${hsl.h}, ${hsl.s}%, ${hsl.l}%, ${formatAlpha(alpha)})`);
|
|
577
|
+
}
|
|
578
|
+
}
|
|
579
|
+
getValidChannelValue(value, channel) {
|
|
580
|
+
if (channel === "r" || channel === "g" || channel === "b" || channel === "a") return Math.min(255, Math.max(0, value));
|
|
581
|
+
if (channel === "h") return Math.min(360, Math.max(0, value));
|
|
582
|
+
if (channel === "s" || channel === "v") return Math.min(100, Math.max(0, value));
|
|
583
|
+
return value;
|
|
584
|
+
}
|
|
585
|
+
loadColorFromString(color) {
|
|
586
|
+
const rgba = parseColor(color, this.#document);
|
|
587
|
+
if (!rgba && color.trim() && isDevMode()) console.warn(`[Mona Color Gradient] Can't read the color "${color}", so the controls show no color. The value stays as it is until a user changes it.`, this.#hostElementRef.nativeElement);
|
|
588
|
+
if (!rgba) {
|
|
589
|
+
this.clear();
|
|
590
|
+
return;
|
|
591
|
+
}
|
|
592
|
+
const hsv = rgba2hsva(rgba.r, rgba.g, rgba.b, rgba.a);
|
|
593
|
+
this.hsv.set({
|
|
594
|
+
h: hsv.h,
|
|
595
|
+
s: hsv.s,
|
|
596
|
+
v: hsv.v
|
|
597
|
+
});
|
|
598
|
+
this.updateRgb(rgba);
|
|
599
|
+
this.alpha.set(rgba.a ?? 255);
|
|
600
|
+
this.updateHexInputValue();
|
|
601
|
+
}
|
|
602
|
+
loadValue(value) {
|
|
603
|
+
this.#edited = false;
|
|
604
|
+
if (value === void 0) {
|
|
605
|
+
this.hsv.set({ ...DEFAULT_HSV });
|
|
606
|
+
this.rgb.set({ ...DEFAULT_RGB });
|
|
607
|
+
this.alpha.set(255);
|
|
608
|
+
this.updateHexInputValue();
|
|
609
|
+
} else if (value === null) this.clear();
|
|
610
|
+
else this.loadColorFromString(value);
|
|
611
|
+
this.lastSelectedColor.set(this.hex());
|
|
612
|
+
}
|
|
613
|
+
moveHandleToPointer(event) {
|
|
614
|
+
const { height, left, top, width } = this.hsvRectangle().nativeElement.getBoundingClientRect();
|
|
615
|
+
if (width <= 0 || height <= 0) return;
|
|
616
|
+
this.updateHsvValues((event.clientX - left) / width * 100, 100 - (event.clientY - top) / height * 100);
|
|
617
|
+
this.updateHexInputValue();
|
|
618
|
+
}
|
|
619
|
+
setHsvRectPointerEvents() {
|
|
620
|
+
const area = this.hsvRectangle().nativeElement;
|
|
621
|
+
const isPrimaryPress = (event) => event.button === 0 && !event.ctrlKey && !this.interactionDisabled();
|
|
622
|
+
fromEvent(area, "mousedown").pipe(filter(isPrimaryPress), takeUntilDestroyed(this.#destroyRef)).subscribe((event) => event.preventDefault());
|
|
623
|
+
fromEvent(area, "pointerdown").pipe(filter((event) => isPrimaryPress(event) && event.isPrimary), tap((event) => {
|
|
624
|
+
area.setPointerCapture?.(event.pointerId);
|
|
625
|
+
this.hsvHandle().nativeElement.focus({ preventScroll: true });
|
|
626
|
+
this.moveHandleToPointer(event);
|
|
627
|
+
}), switchMap(({ pointerId }) => {
|
|
628
|
+
const isSamePointer = (event) => event.pointerId === pointerId;
|
|
629
|
+
const end$ = merge(fromEvent(area, "pointerup"), fromEvent(area, "pointercancel"), fromEvent(area, "lostpointercapture")).pipe(filter(isSamePointer));
|
|
630
|
+
return fromEvent(area, "pointermove").pipe(filter(isSamePointer), takeUntil(end$));
|
|
631
|
+
}), takeUntilDestroyed(this.#destroyRef)).subscribe((event) => this.moveHandleToPointer(event));
|
|
632
|
+
}
|
|
633
|
+
syncValue(value) {
|
|
634
|
+
if (value === void 0) return;
|
|
635
|
+
if (this.#internalValueUpdatePending && value === this.#lastInternalValue) {
|
|
636
|
+
this.#internalValueUpdatePending = false;
|
|
637
|
+
this.#lastInternalValue = void 0;
|
|
638
|
+
return;
|
|
639
|
+
}
|
|
640
|
+
this.#internalValueUpdatePending = false;
|
|
641
|
+
this.#lastInternalValue = void 0;
|
|
642
|
+
this.loadValue(value);
|
|
643
|
+
}
|
|
644
|
+
updateHexInputValue() {
|
|
645
|
+
const rgb = this.rgb();
|
|
646
|
+
const hex = rgba2hex(rgb.r, rgb.g, rgb.b, this.alpha());
|
|
647
|
+
this.hexInputValue.set(hex);
|
|
648
|
+
}
|
|
649
|
+
updateHsvValues(saturation, value) {
|
|
650
|
+
this.#edited = true;
|
|
651
|
+
this.hsv.update((c) => ({
|
|
652
|
+
...c,
|
|
653
|
+
h: c.h ?? 0,
|
|
654
|
+
s: this.getValidChannelValue(saturation, "s"),
|
|
655
|
+
v: this.getValidChannelValue(value, "v")
|
|
656
|
+
}));
|
|
657
|
+
this.updateRgbFromHsv();
|
|
658
|
+
}
|
|
659
|
+
updateOtherNullChannels(channel) {
|
|
660
|
+
if (channel === "r" || channel === "g" || channel === "b") this.rgb.update((c) => ({
|
|
661
|
+
...c,
|
|
662
|
+
r: c.r ?? 0,
|
|
663
|
+
g: c.g ?? 0,
|
|
664
|
+
b: c.b ?? 0
|
|
665
|
+
}));
|
|
666
|
+
else if (channel === "h" || channel === "s" || channel === "v") this.hsv.update((c) => ({
|
|
667
|
+
...c,
|
|
668
|
+
h: c.h ?? 0,
|
|
669
|
+
s: c.s ?? 0,
|
|
670
|
+
v: c.v ?? 0
|
|
671
|
+
}));
|
|
672
|
+
else if (channel === "a") this.alpha.set(this.alpha() ?? 255);
|
|
673
|
+
}
|
|
674
|
+
updateRgb(rgba) {
|
|
675
|
+
this.rgb.update((c) => ({
|
|
676
|
+
...c,
|
|
677
|
+
r: rgba.r,
|
|
678
|
+
g: rgba.g,
|
|
679
|
+
b: rgba.b
|
|
680
|
+
}));
|
|
681
|
+
}
|
|
682
|
+
updateRgbFromHsv() {
|
|
683
|
+
const hsv = this.hsv();
|
|
684
|
+
const hue = hsv.h ?? 0;
|
|
685
|
+
const saturation = hsv.s ?? 0;
|
|
686
|
+
const value = hsv.v ?? 0;
|
|
687
|
+
const rgb = hsva2rgba(hue, saturation, value, this.alpha());
|
|
688
|
+
if (this.rgb().r === rgb.r && this.rgb().g === rgb.g && this.rgb().b === rgb.b) return;
|
|
689
|
+
this.rgb.update((c) => ({
|
|
690
|
+
...c,
|
|
691
|
+
r: rgb.r,
|
|
692
|
+
g: rgb.g,
|
|
693
|
+
b: rgb.b
|
|
694
|
+
}));
|
|
695
|
+
if (!this.showButtons()) this.emitValue();
|
|
696
|
+
}
|
|
697
|
+
static {
|
|
698
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
699
|
+
minVersion: "12.0.0",
|
|
700
|
+
version: "22.2.6",
|
|
701
|
+
ngImport: i0,
|
|
702
|
+
type: ColorGradientComponent,
|
|
703
|
+
deps: [],
|
|
704
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
705
|
+
});
|
|
706
|
+
}
|
|
707
|
+
static {
|
|
708
|
+
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
709
|
+
minVersion: "17.0.0",
|
|
710
|
+
version: "22.2.6",
|
|
711
|
+
type: ColorGradientComponent,
|
|
712
|
+
isStandalone: true,
|
|
713
|
+
selector: "mona-color-gradient",
|
|
714
|
+
inputs: {
|
|
715
|
+
ariaLabel: {
|
|
716
|
+
classPropertyName: "ariaLabel",
|
|
717
|
+
publicName: "aria-label",
|
|
718
|
+
isSignal: true,
|
|
719
|
+
isRequired: false,
|
|
720
|
+
transformFunction: null
|
|
721
|
+
},
|
|
722
|
+
ariaLabelledBy: {
|
|
723
|
+
classPropertyName: "ariaLabelledBy",
|
|
724
|
+
publicName: "aria-labelledby",
|
|
725
|
+
isSignal: true,
|
|
726
|
+
isRequired: false,
|
|
727
|
+
transformFunction: null
|
|
728
|
+
},
|
|
729
|
+
disabled: {
|
|
730
|
+
classPropertyName: "disabled",
|
|
731
|
+
publicName: "disabled",
|
|
732
|
+
isSignal: true,
|
|
733
|
+
isRequired: false,
|
|
734
|
+
transformFunction: null
|
|
735
|
+
},
|
|
736
|
+
format: {
|
|
737
|
+
classPropertyName: "format",
|
|
738
|
+
publicName: "format",
|
|
739
|
+
isSignal: true,
|
|
740
|
+
isRequired: false,
|
|
741
|
+
transformFunction: null
|
|
742
|
+
},
|
|
743
|
+
invalid: {
|
|
744
|
+
classPropertyName: "invalid",
|
|
745
|
+
publicName: "invalid",
|
|
746
|
+
isSignal: true,
|
|
747
|
+
isRequired: false,
|
|
748
|
+
transformFunction: null
|
|
749
|
+
},
|
|
750
|
+
opacity: {
|
|
751
|
+
classPropertyName: "opacity",
|
|
752
|
+
publicName: "opacity",
|
|
753
|
+
isSignal: true,
|
|
754
|
+
isRequired: false,
|
|
755
|
+
transformFunction: null
|
|
756
|
+
},
|
|
757
|
+
readonly: {
|
|
758
|
+
classPropertyName: "readonly",
|
|
759
|
+
publicName: "readonly",
|
|
760
|
+
isSignal: true,
|
|
761
|
+
isRequired: false,
|
|
762
|
+
transformFunction: null
|
|
763
|
+
},
|
|
764
|
+
required: {
|
|
765
|
+
classPropertyName: "required",
|
|
766
|
+
publicName: "required",
|
|
767
|
+
isSignal: true,
|
|
768
|
+
isRequired: false,
|
|
769
|
+
transformFunction: null
|
|
770
|
+
},
|
|
771
|
+
rounded: {
|
|
772
|
+
classPropertyName: "rounded",
|
|
773
|
+
publicName: "rounded",
|
|
774
|
+
isSignal: true,
|
|
775
|
+
isRequired: false,
|
|
776
|
+
transformFunction: null
|
|
777
|
+
},
|
|
778
|
+
showButtons: {
|
|
779
|
+
classPropertyName: "showButtons",
|
|
780
|
+
publicName: "showButtons",
|
|
781
|
+
isSignal: true,
|
|
782
|
+
isRequired: false,
|
|
783
|
+
transformFunction: null
|
|
784
|
+
},
|
|
785
|
+
showColorInputs: {
|
|
786
|
+
classPropertyName: "showColorInputs",
|
|
787
|
+
publicName: "showColorInputs",
|
|
788
|
+
isSignal: true,
|
|
789
|
+
isRequired: false,
|
|
790
|
+
transformFunction: null
|
|
791
|
+
},
|
|
792
|
+
showHexInput: {
|
|
793
|
+
classPropertyName: "showHexInput",
|
|
794
|
+
publicName: "showHexInput",
|
|
795
|
+
isSignal: true,
|
|
796
|
+
isRequired: false,
|
|
797
|
+
transformFunction: null
|
|
798
|
+
},
|
|
799
|
+
touched: {
|
|
800
|
+
classPropertyName: "touched",
|
|
801
|
+
publicName: "touched",
|
|
802
|
+
isSignal: true,
|
|
803
|
+
isRequired: false,
|
|
804
|
+
transformFunction: null
|
|
805
|
+
},
|
|
806
|
+
value: {
|
|
807
|
+
classPropertyName: "value",
|
|
808
|
+
publicName: "value",
|
|
809
|
+
isSignal: true,
|
|
810
|
+
isRequired: false,
|
|
811
|
+
transformFunction: null
|
|
812
|
+
}
|
|
813
|
+
},
|
|
814
|
+
outputs: {
|
|
815
|
+
apply: "apply",
|
|
816
|
+
cancel: "cancel",
|
|
817
|
+
touch: "touch",
|
|
818
|
+
value: "valueChange"
|
|
819
|
+
},
|
|
820
|
+
host: {
|
|
821
|
+
listeners: { "focusout": "onFocusOut($event)" },
|
|
822
|
+
properties: {
|
|
823
|
+
"class": "baseClasses()",
|
|
824
|
+
"attr.data-disabled": "effectiveDisabled()",
|
|
825
|
+
"attr.data-readonly": "readonly() || null",
|
|
826
|
+
"attr.data-invalid": "invalidState() || null",
|
|
827
|
+
"attr.role": "'group'",
|
|
828
|
+
"attr.aria-label": "labelledBy() ? null : ariaLabel() || messages().colorGradient",
|
|
829
|
+
"attr.aria-labelledby": "labelledBy()",
|
|
830
|
+
"attr.aria-invalid": "invalidState() ? 'true' : null"
|
|
831
|
+
}
|
|
832
|
+
},
|
|
833
|
+
viewQueries: [{
|
|
834
|
+
propertyName: "hsvHandle",
|
|
835
|
+
first: true,
|
|
836
|
+
predicate: ["hsvPointer"],
|
|
837
|
+
descendants: true,
|
|
838
|
+
isSignal: true
|
|
839
|
+
}, {
|
|
840
|
+
propertyName: "hsvRectangle",
|
|
841
|
+
first: true,
|
|
842
|
+
predicate: ["hsvRectangle"],
|
|
843
|
+
descendants: true,
|
|
844
|
+
isSignal: true
|
|
845
|
+
}],
|
|
846
|
+
ngImport: i0,
|
|
847
|
+
template: "<div [class]=\"hsvRectangleClasses()\" [style.background-color]=\"hsvRectangleBackground()\" #hsvRectangle>\n <div\n [class]=\"hsvRectangleHandleClasses()\"\n [style.left.%]=\"hsv().s ?? 0\"\n [style.top.%]=\"100 - (hsv().v ?? 100)\"\n [attr.tabindex]=\"effectiveDisabled() ? -1 : 0\"\n [attr.role]=\"'slider'\"\n [attr.aria-label]=\"messages().saturationAndValue\"\n [attr.aria-valuemin]=\"0\"\n [attr.aria-valuemax]=\"100\"\n [attr.aria-valuenow]=\"roundedSaturation()\"\n [attr.aria-valuetext]=\"messages().saturationAndValueText(roundedSaturation(), roundedValue())\"\n [attr.aria-disabled]=\"effectiveDisabled() || null\"\n [attr.aria-readonly]=\"readonly() || null\"\n (keydown)=\"onHsvHandleKeyDown($event)\"\n #hsvPointer></div>\n</div>\n<div class=\"flex items-center gap-2\">\n <div class=\"flex flex-1 flex-col gap-1 me-2 forced-color-adjust-none\">\n <mona-slider\n dir=\"ltr\"\n [aria-label]=\"messages().hue\"\n [minValue]=\"0\"\n [maxValue]=\"360\"\n [trackBackground]=\"'linear-gradient(to right, #ff0000, #ffff00, #00ff00, #00ffff, #0000ff, #ff00ff, #ff0000)'\"\n [selectionBackground]=\"'transparent'\"\n [handleClasses]=\"sliderHandleClasses()\"\n [trackSize]=\"sliderHeight\"\n [rounded]=\"rounded()\"\n [value]=\"roundedHue()\"\n [disabled]=\"effectiveDisabled()\"\n [readonly]=\"readonly()\"\n (valueChange)=\"onHueChange($event)\"></mona-slider>\n @if (opacity()) {\n <mona-slider\n dir=\"ltr\"\n [aria-label]=\"messages().alpha\"\n [ariaValueText]=\"alphaValueText()\"\n [minValue]=\"0\"\n [maxValue]=\"255\"\n [trackBackground]=\"alphaSliderBackground()\"\n [selectionBackground]=\"'transparent'\"\n [handleClasses]=\"sliderHandleClasses()\"\n [trackSize]=\"sliderHeight\"\n [rounded]=\"rounded()\"\n [value]=\"alpha()\"\n [disabled]=\"effectiveDisabled()\"\n [readonly]=\"readonly()\"\n (valueChange)=\"onAlphaChange($event)\"></mona-slider>\n }\n </div>\n @for (preview of colorPreviews(); track preview.type) {\n <div\n [class]=\"colorPreviewClasses()\"\n [class.cursor-pointer]=\"$index === 1\"\n [style.background-color]=\"preview.color\"\n [attr.title]=\"$index === 1 ? preview.title : null\"\n [attr.aria-label]=\"$index === 1 ? preview.title : null\"\n [attr.aria-hidden]=\"$index === 0 ? 'true' : null\"\n [attr.aria-disabled]=\"$index === 1 && interactionDisabled() ? 'true' : null\"\n [attr.role]=\"$index === 1 ? 'button' : null\"\n [attr.tabindex]=\"$index === 1 && !interactionDisabled() ? 0 : null\"\n (click)=\"preview.onClick?.()\"\n (keydown)=\"onPreviousColorKeyDown($event, preview.onClick)\"></div>\n }\n <button\n monaButton\n look=\"ghost\"\n size=\"small\"\n [disabled]=\"interactionDisabled()\"\n [attr.aria-label]=\"messages().clearColor\"\n (click)=\"onClearClick()\">\n <svg lucideDropletOff [size]=\"16\" aria-hidden=\"true\"></svg>\n </button>\n</div>\n<div class=\"flex flex-col gap-2\">\n @if (showColorInputs()) {\n <div class=\"flex gap-2\">\n <div class=\"flex gap-1\">\n @for (input of colorInputs(); track input.key) {\n <mona-numeric-text-box\n [aria-label]=\"input.ariaLabel\"\n [value]=\"input.value\"\n [minValue]=\"input.min\"\n [maxValue]=\"input.max\"\n [decimals]=\"0\"\n [spinners]=\"false\"\n [nullable]=\"false\"\n [rounded]=\"rounded()\"\n [size]=\"'small'\"\n class=\"w-18\"\n [disabled]=\"effectiveDisabled()\"\n [readonly]=\"readonly()\"\n (valueChange)=\"input.change($event)\">\n <ng-template monaNumericTextBoxPrefixTemplate>\n <ng-container\n [ngTemplateOutlet]=\"numericInputPrefixTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: input.label }\"></ng-container>\n </ng-template>\n </mona-numeric-text-box>\n }\n </div>\n <div class=\"flex flex-1 items-center justify-end\">\n <button\n monaButton\n look=\"ghost\"\n [rounded]=\"rounded()\"\n size=\"small\"\n [disabled]=\"effectiveDisabled()\"\n [attr.aria-label]=\"messages().switchColorMode\"\n (click)=\"onSwitchColorModeClick()\">\n <svg lucideChevronsUpDown [size]=\"16\" aria-hidden=\"true\"></svg>\n </button>\n </div>\n </div>\n }\n @if (showHexInput()) {\n <mona-text-box\n [aria-label]=\"messages().hexColor\"\n [rounded]=\"rounded()\"\n [value]=\"hex()\"\n [disabled]=\"effectiveDisabled()\"\n [readonly]=\"readonly()\"\n (valueChange)=\"onHexChange($event)\"\n (inputBlur)=\"onHexInputBlur()\"\n (inputFocus)=\"onHexInputFocus()\"\n class=\"w-full\">\n <ng-template monaTextBoxPrefixTemplate>\n <ng-container\n [ngTemplateOutlet]=\"numericInputPrefixTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: 'HEX', classes: 'w-auto px-2' }\"></ng-container>\n </ng-template>\n <ng-template monaTextBoxSuffixTemplate>\n <mona-dropdown-button\n look=\"ghost\"\n [disabled]=\"effectiveDisabled() || !selectedColor()\"\n [iconOnly]=\"true\"\n [aria-label]=\"messages().copyColor\"\n class=\"h-full\">\n <ng-template monaDropdownButtonTextTemplate>\n <svg lucideCopy [size]=\"12\" aria-hidden=\"true\"></svg>\n </ng-template>\n <mona-dropdown-button-item\n [label]=\"messages().copyAsHex\"\n (menuClick)=\"onCopyColorSelect('hex')\"></mona-dropdown-button-item>\n <mona-dropdown-button-item\n [label]=\"messages().copyAsRgb\"\n (menuClick)=\"onCopyColorSelect('rgb')\"></mona-dropdown-button-item>\n </mona-dropdown-button>\n </ng-template>\n </mona-text-box>\n }\n @if (showButtons()) {\n <div class=\"flex items-center justify-end gap-2\">\n <button\n monaButton\n [rounded]=\"rounded()\"\n look=\"primary\"\n [disabled]=\"interactionDisabled()\"\n (click)=\"onApply()\">\n {{ messages().apply }}\n </button>\n <button monaButton [rounded]=\"rounded()\" [disabled]=\"effectiveDisabled()\" (click)=\"onCancel()\">\n {{ messages().cancel }}\n </button>\n </div>\n }\n</div>\n\n<ng-template #numericInputPrefixTemplate let-text let-classes=\"classes\">\n <span\n [class]=\"classes\"\n class=\"inline-flex items-center justify-center select-none w-7.5 [background-color:var(--mona-input-addon-background,var(--color-secondary))] h-full text-foreground text-xs font-semibold border-e border-e-input-border\"\n aria-hidden=\"true\"\n >{{ text }}</span\n >\n</ng-template>\n",
|
|
848
|
+
dependencies: [
|
|
849
|
+
{
|
|
850
|
+
kind: "component",
|
|
851
|
+
type: LucideDropletOff,
|
|
852
|
+
selector: "svg[lucideDropletOff]"
|
|
853
|
+
},
|
|
854
|
+
{
|
|
855
|
+
kind: "component",
|
|
856
|
+
type: LucideChevronsUpDown,
|
|
857
|
+
selector: "svg[lucideChevronsUpDown]"
|
|
858
|
+
},
|
|
859
|
+
{
|
|
860
|
+
kind: "component",
|
|
861
|
+
type: NumericTextBoxComponent,
|
|
862
|
+
selector: "mona-numeric-text-box",
|
|
863
|
+
inputs: [
|
|
864
|
+
"formatter",
|
|
865
|
+
"maxValue",
|
|
866
|
+
"minValue",
|
|
867
|
+
"step",
|
|
868
|
+
"value"
|
|
869
|
+
],
|
|
870
|
+
outputs: ["valueChange"]
|
|
871
|
+
},
|
|
872
|
+
{
|
|
873
|
+
kind: "directive",
|
|
874
|
+
type: NumericTextBoxPrefixTemplateDirective,
|
|
875
|
+
selector: "ng-template[monaNumericTextBoxPrefixTemplate]"
|
|
876
|
+
},
|
|
877
|
+
{
|
|
878
|
+
kind: "directive",
|
|
879
|
+
type: ButtonDirective,
|
|
880
|
+
selector: "button[monaButton]",
|
|
881
|
+
inputs: [
|
|
882
|
+
"aria-haspopup",
|
|
883
|
+
"disabled",
|
|
884
|
+
"iconOnly",
|
|
885
|
+
"loading",
|
|
886
|
+
"look",
|
|
887
|
+
"rounded",
|
|
888
|
+
"selected",
|
|
889
|
+
"size",
|
|
890
|
+
"tabindex",
|
|
891
|
+
"toggleable",
|
|
892
|
+
"type",
|
|
893
|
+
"class",
|
|
894
|
+
"value"
|
|
895
|
+
],
|
|
896
|
+
outputs: ["lookChange", "selectedChange"]
|
|
897
|
+
},
|
|
898
|
+
{
|
|
899
|
+
kind: "component",
|
|
900
|
+
type: TextBoxComponent,
|
|
901
|
+
selector: "mona-text-box",
|
|
902
|
+
inputs: [
|
|
903
|
+
"aria-describedby",
|
|
904
|
+
"aria-label",
|
|
905
|
+
"aria-labelledby",
|
|
906
|
+
"clearButton",
|
|
907
|
+
"disabled",
|
|
908
|
+
"inputAttributes",
|
|
909
|
+
"inputClass",
|
|
910
|
+
"inputId",
|
|
911
|
+
"inputStyle",
|
|
912
|
+
"invalid",
|
|
913
|
+
"maxLength",
|
|
914
|
+
"minLength",
|
|
915
|
+
"name",
|
|
916
|
+
"placeholder",
|
|
917
|
+
"readonly",
|
|
918
|
+
"required",
|
|
919
|
+
"rounded",
|
|
920
|
+
"size",
|
|
921
|
+
"touched",
|
|
922
|
+
"type",
|
|
923
|
+
"class",
|
|
924
|
+
"value"
|
|
925
|
+
],
|
|
926
|
+
outputs: [
|
|
927
|
+
"inputBlur",
|
|
928
|
+
"inputFocus",
|
|
929
|
+
"touch",
|
|
930
|
+
"valueChange"
|
|
931
|
+
]
|
|
932
|
+
},
|
|
933
|
+
{
|
|
934
|
+
kind: "directive",
|
|
935
|
+
type: TextBoxPrefixTemplateDirective,
|
|
936
|
+
selector: "ng-template[monaTextBoxPrefixTemplate]"
|
|
937
|
+
},
|
|
938
|
+
{
|
|
939
|
+
kind: "directive",
|
|
940
|
+
type: TextBoxSuffixTemplateDirective,
|
|
941
|
+
selector: "ng-template[monaTextBoxSuffixTemplate]"
|
|
942
|
+
},
|
|
943
|
+
{
|
|
944
|
+
kind: "component",
|
|
945
|
+
type: SliderComponent,
|
|
946
|
+
selector: "mona-slider",
|
|
947
|
+
inputs: [
|
|
948
|
+
"max",
|
|
949
|
+
"min",
|
|
950
|
+
"value"
|
|
951
|
+
],
|
|
952
|
+
outputs: ["valueChange"]
|
|
953
|
+
},
|
|
954
|
+
{
|
|
955
|
+
kind: "directive",
|
|
956
|
+
type: NgTemplateOutlet,
|
|
957
|
+
selector: "[ngTemplateOutlet]",
|
|
958
|
+
inputs: [
|
|
959
|
+
"ngTemplateOutletContext",
|
|
960
|
+
"ngTemplateOutlet",
|
|
961
|
+
"ngTemplateOutletInjector"
|
|
962
|
+
]
|
|
963
|
+
},
|
|
964
|
+
{
|
|
965
|
+
kind: "component",
|
|
966
|
+
type: DropdownButtonComponent,
|
|
967
|
+
selector: "mona-dropdown-button",
|
|
968
|
+
inputs: [
|
|
969
|
+
"aria-label",
|
|
970
|
+
"aria-labelledby",
|
|
971
|
+
"disabled",
|
|
972
|
+
"iconOnly",
|
|
973
|
+
"loading",
|
|
974
|
+
"look",
|
|
975
|
+
"popupWidth",
|
|
976
|
+
"rounded",
|
|
977
|
+
"showArrow",
|
|
978
|
+
"size",
|
|
979
|
+
"text",
|
|
980
|
+
"class"
|
|
981
|
+
],
|
|
982
|
+
outputs: ["menuItemClick"]
|
|
983
|
+
},
|
|
984
|
+
{
|
|
985
|
+
kind: "component",
|
|
986
|
+
type: DropdownButtonItemComponent,
|
|
987
|
+
selector: "mona-dropdown-button-item"
|
|
988
|
+
},
|
|
989
|
+
{
|
|
990
|
+
kind: "directive",
|
|
991
|
+
type: DropdownButtonTextTemplateDirective,
|
|
992
|
+
selector: "ng-template[monaDropdownButtonTextTemplate]"
|
|
993
|
+
},
|
|
994
|
+
{
|
|
995
|
+
kind: "component",
|
|
996
|
+
type: LucideCopy,
|
|
997
|
+
selector: "svg[lucideCopy]"
|
|
998
|
+
}
|
|
999
|
+
]
|
|
1000
|
+
});
|
|
1001
|
+
}
|
|
1002
|
+
};
|
|
1003
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
1004
|
+
minVersion: "12.0.0",
|
|
1005
|
+
version: "22.2.6",
|
|
1006
|
+
ngImport: i0,
|
|
1007
|
+
type: ColorGradientComponent,
|
|
1008
|
+
decorators: [{
|
|
1009
|
+
type: Component,
|
|
1010
|
+
args: [{
|
|
1011
|
+
selector: "mona-color-gradient",
|
|
1012
|
+
imports: [
|
|
1013
|
+
LucideDropletOff,
|
|
1014
|
+
LucideChevronsUpDown,
|
|
1015
|
+
NumericTextBoxComponent,
|
|
1016
|
+
NumericTextBoxPrefixTemplateDirective,
|
|
1017
|
+
ButtonDirective,
|
|
1018
|
+
TextBoxComponent,
|
|
1019
|
+
TextBoxPrefixTemplateDirective,
|
|
1020
|
+
TextBoxSuffixTemplateDirective,
|
|
1021
|
+
SliderComponent,
|
|
1022
|
+
NgTemplateOutlet,
|
|
1023
|
+
DropdownButtonComponent,
|
|
1024
|
+
DropdownButtonItemComponent,
|
|
1025
|
+
DropdownButtonTextTemplateDirective,
|
|
1026
|
+
LucideCopy
|
|
1027
|
+
],
|
|
1028
|
+
host: {
|
|
1029
|
+
"[class]": "baseClasses()",
|
|
1030
|
+
"[attr.data-disabled]": "effectiveDisabled()",
|
|
1031
|
+
"[attr.data-readonly]": "readonly() || null",
|
|
1032
|
+
"(focusout)": "onFocusOut($event)",
|
|
1033
|
+
"[attr.data-invalid]": "invalidState() || null",
|
|
1034
|
+
"[attr.role]": "'group'",
|
|
1035
|
+
"[attr.aria-label]": "labelledBy() ? null : ariaLabel() || messages().colorGradient",
|
|
1036
|
+
"[attr.aria-labelledby]": "labelledBy()",
|
|
1037
|
+
"[attr.aria-invalid]": "invalidState() ? 'true' : null"
|
|
1038
|
+
},
|
|
1039
|
+
template: "<div [class]=\"hsvRectangleClasses()\" [style.background-color]=\"hsvRectangleBackground()\" #hsvRectangle>\n <div\n [class]=\"hsvRectangleHandleClasses()\"\n [style.left.%]=\"hsv().s ?? 0\"\n [style.top.%]=\"100 - (hsv().v ?? 100)\"\n [attr.tabindex]=\"effectiveDisabled() ? -1 : 0\"\n [attr.role]=\"'slider'\"\n [attr.aria-label]=\"messages().saturationAndValue\"\n [attr.aria-valuemin]=\"0\"\n [attr.aria-valuemax]=\"100\"\n [attr.aria-valuenow]=\"roundedSaturation()\"\n [attr.aria-valuetext]=\"messages().saturationAndValueText(roundedSaturation(), roundedValue())\"\n [attr.aria-disabled]=\"effectiveDisabled() || null\"\n [attr.aria-readonly]=\"readonly() || null\"\n (keydown)=\"onHsvHandleKeyDown($event)\"\n #hsvPointer></div>\n</div>\n<div class=\"flex items-center gap-2\">\n <div class=\"flex flex-1 flex-col gap-1 me-2 forced-color-adjust-none\">\n <mona-slider\n dir=\"ltr\"\n [aria-label]=\"messages().hue\"\n [minValue]=\"0\"\n [maxValue]=\"360\"\n [trackBackground]=\"'linear-gradient(to right, #ff0000, #ffff00, #00ff00, #00ffff, #0000ff, #ff00ff, #ff0000)'\"\n [selectionBackground]=\"'transparent'\"\n [handleClasses]=\"sliderHandleClasses()\"\n [trackSize]=\"sliderHeight\"\n [rounded]=\"rounded()\"\n [value]=\"roundedHue()\"\n [disabled]=\"effectiveDisabled()\"\n [readonly]=\"readonly()\"\n (valueChange)=\"onHueChange($event)\"></mona-slider>\n @if (opacity()) {\n <mona-slider\n dir=\"ltr\"\n [aria-label]=\"messages().alpha\"\n [ariaValueText]=\"alphaValueText()\"\n [minValue]=\"0\"\n [maxValue]=\"255\"\n [trackBackground]=\"alphaSliderBackground()\"\n [selectionBackground]=\"'transparent'\"\n [handleClasses]=\"sliderHandleClasses()\"\n [trackSize]=\"sliderHeight\"\n [rounded]=\"rounded()\"\n [value]=\"alpha()\"\n [disabled]=\"effectiveDisabled()\"\n [readonly]=\"readonly()\"\n (valueChange)=\"onAlphaChange($event)\"></mona-slider>\n }\n </div>\n @for (preview of colorPreviews(); track preview.type) {\n <div\n [class]=\"colorPreviewClasses()\"\n [class.cursor-pointer]=\"$index === 1\"\n [style.background-color]=\"preview.color\"\n [attr.title]=\"$index === 1 ? preview.title : null\"\n [attr.aria-label]=\"$index === 1 ? preview.title : null\"\n [attr.aria-hidden]=\"$index === 0 ? 'true' : null\"\n [attr.aria-disabled]=\"$index === 1 && interactionDisabled() ? 'true' : null\"\n [attr.role]=\"$index === 1 ? 'button' : null\"\n [attr.tabindex]=\"$index === 1 && !interactionDisabled() ? 0 : null\"\n (click)=\"preview.onClick?.()\"\n (keydown)=\"onPreviousColorKeyDown($event, preview.onClick)\"></div>\n }\n <button\n monaButton\n look=\"ghost\"\n size=\"small\"\n [disabled]=\"interactionDisabled()\"\n [attr.aria-label]=\"messages().clearColor\"\n (click)=\"onClearClick()\">\n <svg lucideDropletOff [size]=\"16\" aria-hidden=\"true\"></svg>\n </button>\n</div>\n<div class=\"flex flex-col gap-2\">\n @if (showColorInputs()) {\n <div class=\"flex gap-2\">\n <div class=\"flex gap-1\">\n @for (input of colorInputs(); track input.key) {\n <mona-numeric-text-box\n [aria-label]=\"input.ariaLabel\"\n [value]=\"input.value\"\n [minValue]=\"input.min\"\n [maxValue]=\"input.max\"\n [decimals]=\"0\"\n [spinners]=\"false\"\n [nullable]=\"false\"\n [rounded]=\"rounded()\"\n [size]=\"'small'\"\n class=\"w-18\"\n [disabled]=\"effectiveDisabled()\"\n [readonly]=\"readonly()\"\n (valueChange)=\"input.change($event)\">\n <ng-template monaNumericTextBoxPrefixTemplate>\n <ng-container\n [ngTemplateOutlet]=\"numericInputPrefixTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: input.label }\"></ng-container>\n </ng-template>\n </mona-numeric-text-box>\n }\n </div>\n <div class=\"flex flex-1 items-center justify-end\">\n <button\n monaButton\n look=\"ghost\"\n [rounded]=\"rounded()\"\n size=\"small\"\n [disabled]=\"effectiveDisabled()\"\n [attr.aria-label]=\"messages().switchColorMode\"\n (click)=\"onSwitchColorModeClick()\">\n <svg lucideChevronsUpDown [size]=\"16\" aria-hidden=\"true\"></svg>\n </button>\n </div>\n </div>\n }\n @if (showHexInput()) {\n <mona-text-box\n [aria-label]=\"messages().hexColor\"\n [rounded]=\"rounded()\"\n [value]=\"hex()\"\n [disabled]=\"effectiveDisabled()\"\n [readonly]=\"readonly()\"\n (valueChange)=\"onHexChange($event)\"\n (inputBlur)=\"onHexInputBlur()\"\n (inputFocus)=\"onHexInputFocus()\"\n class=\"w-full\">\n <ng-template monaTextBoxPrefixTemplate>\n <ng-container\n [ngTemplateOutlet]=\"numericInputPrefixTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: 'HEX', classes: 'w-auto px-2' }\"></ng-container>\n </ng-template>\n <ng-template monaTextBoxSuffixTemplate>\n <mona-dropdown-button\n look=\"ghost\"\n [disabled]=\"effectiveDisabled() || !selectedColor()\"\n [iconOnly]=\"true\"\n [aria-label]=\"messages().copyColor\"\n class=\"h-full\">\n <ng-template monaDropdownButtonTextTemplate>\n <svg lucideCopy [size]=\"12\" aria-hidden=\"true\"></svg>\n </ng-template>\n <mona-dropdown-button-item\n [label]=\"messages().copyAsHex\"\n (menuClick)=\"onCopyColorSelect('hex')\"></mona-dropdown-button-item>\n <mona-dropdown-button-item\n [label]=\"messages().copyAsRgb\"\n (menuClick)=\"onCopyColorSelect('rgb')\"></mona-dropdown-button-item>\n </mona-dropdown-button>\n </ng-template>\n </mona-text-box>\n }\n @if (showButtons()) {\n <div class=\"flex items-center justify-end gap-2\">\n <button\n monaButton\n [rounded]=\"rounded()\"\n look=\"primary\"\n [disabled]=\"interactionDisabled()\"\n (click)=\"onApply()\">\n {{ messages().apply }}\n </button>\n <button monaButton [rounded]=\"rounded()\" [disabled]=\"effectiveDisabled()\" (click)=\"onCancel()\">\n {{ messages().cancel }}\n </button>\n </div>\n }\n</div>\n\n<ng-template #numericInputPrefixTemplate let-text let-classes=\"classes\">\n <span\n [class]=\"classes\"\n class=\"inline-flex items-center justify-center select-none w-7.5 [background-color:var(--mona-input-addon-background,var(--color-secondary))] h-full text-foreground text-xs font-semibold border-e border-e-input-border\"\n aria-hidden=\"true\"\n >{{ text }}</span\n >\n</ng-template>\n"
|
|
1040
|
+
}]
|
|
1041
|
+
}],
|
|
1042
|
+
ctorParameters: () => [],
|
|
1043
|
+
propDecorators: {
|
|
1044
|
+
hsvHandle: [{
|
|
1045
|
+
type: i0.ViewChild,
|
|
1046
|
+
args: ["hsvPointer", { isSignal: true }]
|
|
1047
|
+
}],
|
|
1048
|
+
hsvRectangle: [{
|
|
1049
|
+
type: i0.ViewChild,
|
|
1050
|
+
args: ["hsvRectangle", { isSignal: true }]
|
|
1051
|
+
}],
|
|
1052
|
+
apply: [{
|
|
1053
|
+
type: i0.Output,
|
|
1054
|
+
args: ["apply"]
|
|
1055
|
+
}],
|
|
1056
|
+
ariaLabel: [{
|
|
1057
|
+
type: i0.Input,
|
|
1058
|
+
args: [{
|
|
1059
|
+
isSignal: true,
|
|
1060
|
+
alias: "aria-label",
|
|
1061
|
+
required: false
|
|
1062
|
+
}]
|
|
1063
|
+
}],
|
|
1064
|
+
ariaLabelledBy: [{
|
|
1065
|
+
type: i0.Input,
|
|
1066
|
+
args: [{
|
|
1067
|
+
isSignal: true,
|
|
1068
|
+
alias: "aria-labelledby",
|
|
1069
|
+
required: false
|
|
1070
|
+
}]
|
|
1071
|
+
}],
|
|
1072
|
+
cancel: [{
|
|
1073
|
+
type: i0.Output,
|
|
1074
|
+
args: ["cancel"]
|
|
1075
|
+
}],
|
|
1076
|
+
disabled: [{
|
|
1077
|
+
type: i0.Input,
|
|
1078
|
+
args: [{
|
|
1079
|
+
isSignal: true,
|
|
1080
|
+
alias: "disabled",
|
|
1081
|
+
required: false
|
|
1082
|
+
}]
|
|
1083
|
+
}],
|
|
1084
|
+
format: [{
|
|
1085
|
+
type: i0.Input,
|
|
1086
|
+
args: [{
|
|
1087
|
+
isSignal: true,
|
|
1088
|
+
alias: "format",
|
|
1089
|
+
required: false
|
|
1090
|
+
}]
|
|
1091
|
+
}],
|
|
1092
|
+
invalid: [{
|
|
1093
|
+
type: i0.Input,
|
|
1094
|
+
args: [{
|
|
1095
|
+
isSignal: true,
|
|
1096
|
+
alias: "invalid",
|
|
1097
|
+
required: false
|
|
1098
|
+
}]
|
|
1099
|
+
}],
|
|
1100
|
+
opacity: [{
|
|
1101
|
+
type: i0.Input,
|
|
1102
|
+
args: [{
|
|
1103
|
+
isSignal: true,
|
|
1104
|
+
alias: "opacity",
|
|
1105
|
+
required: false
|
|
1106
|
+
}]
|
|
1107
|
+
}],
|
|
1108
|
+
readonly: [{
|
|
1109
|
+
type: i0.Input,
|
|
1110
|
+
args: [{
|
|
1111
|
+
isSignal: true,
|
|
1112
|
+
alias: "readonly",
|
|
1113
|
+
required: false
|
|
1114
|
+
}]
|
|
1115
|
+
}],
|
|
1116
|
+
required: [{
|
|
1117
|
+
type: i0.Input,
|
|
1118
|
+
args: [{
|
|
1119
|
+
isSignal: true,
|
|
1120
|
+
alias: "required",
|
|
1121
|
+
required: false
|
|
1122
|
+
}]
|
|
1123
|
+
}],
|
|
1124
|
+
rounded: [{
|
|
1125
|
+
type: i0.Input,
|
|
1126
|
+
args: [{
|
|
1127
|
+
isSignal: true,
|
|
1128
|
+
alias: "rounded",
|
|
1129
|
+
required: false
|
|
1130
|
+
}]
|
|
1131
|
+
}],
|
|
1132
|
+
showButtons: [{
|
|
1133
|
+
type: i0.Input,
|
|
1134
|
+
args: [{
|
|
1135
|
+
isSignal: true,
|
|
1136
|
+
alias: "showButtons",
|
|
1137
|
+
required: false
|
|
1138
|
+
}]
|
|
1139
|
+
}],
|
|
1140
|
+
showColorInputs: [{
|
|
1141
|
+
type: i0.Input,
|
|
1142
|
+
args: [{
|
|
1143
|
+
isSignal: true,
|
|
1144
|
+
alias: "showColorInputs",
|
|
1145
|
+
required: false
|
|
1146
|
+
}]
|
|
1147
|
+
}],
|
|
1148
|
+
showHexInput: [{
|
|
1149
|
+
type: i0.Input,
|
|
1150
|
+
args: [{
|
|
1151
|
+
isSignal: true,
|
|
1152
|
+
alias: "showHexInput",
|
|
1153
|
+
required: false
|
|
1154
|
+
}]
|
|
1155
|
+
}],
|
|
1156
|
+
touch: [{
|
|
1157
|
+
type: i0.Output,
|
|
1158
|
+
args: ["touch"]
|
|
1159
|
+
}],
|
|
1160
|
+
touched: [{
|
|
1161
|
+
type: i0.Input,
|
|
1162
|
+
args: [{
|
|
1163
|
+
isSignal: true,
|
|
1164
|
+
alias: "touched",
|
|
1165
|
+
required: false
|
|
1166
|
+
}]
|
|
1167
|
+
}],
|
|
1168
|
+
value: [{
|
|
1169
|
+
type: i0.Input,
|
|
1170
|
+
args: [{
|
|
1171
|
+
isSignal: true,
|
|
1172
|
+
alias: "value",
|
|
1173
|
+
required: false
|
|
1174
|
+
}]
|
|
1175
|
+
}, {
|
|
1176
|
+
type: i0.Output,
|
|
1177
|
+
args: ["valueChange"]
|
|
1178
|
+
}]
|
|
1179
|
+
}
|
|
1180
|
+
});
|
|
858
1181
|
export { COLOR_GRADIENT_DEFAULT_MESSAGES, ColorGradientComponent };
|
|
859
|
-
|
|
1182
|
+
|
|
1183
|
+
//# sourceMappingURL=nanahoshi-mona-ui-color-gradient.mjs.map
|