@shival99/z-ui 2.0.2 → 2.0.3
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/shival99-z-ui-components-z-editor.mjs +988 -204
- package/fesm2022/shival99-z-ui-components-z-editor.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-input.mjs +456 -16
- package/fesm2022/shival99-z-ui-components-z-input.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-tooltip.mjs +22 -7
- package/fesm2022/shival99-z-ui-components-z-tooltip.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-i18n.mjs +34 -0
- package/fesm2022/shival99-z-ui-i18n.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-utils.mjs +752 -1
- package/fesm2022/shival99-z-ui-utils.mjs.map +1 -1
- package/package.json +1 -1
- package/types/shival99-z-ui-components-z-autocomplete.d.ts +1 -1
- package/types/shival99-z-ui-components-z-calendar.d.ts +4 -4
- package/types/shival99-z-ui-components-z-editor.d.ts +142 -8
- package/types/shival99-z-ui-components-z-input.d.ts +83 -0
- package/types/shival99-z-ui-components-z-select.d.ts +1 -1
- package/types/shival99-z-ui-components-z-table.d.ts +1 -1
- package/types/shival99-z-ui-components-z-tooltip.d.ts +1 -0
- package/types/shival99-z-ui-utils.d.ts +18 -2
|
@@ -6,7 +6,10 @@ import * as i1 from '@angular/forms';
|
|
|
6
6
|
import { NgControl, NgModel, PristineChangeEvent, TouchedChangeEvent, FormsModule, ReactiveFormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
7
7
|
import { hexToHsl, lightnessToSliderValue, DEFAULT_COLORS, BlossomColorPickerComponent } from '@dayflow/blossom-color-picker-angular';
|
|
8
8
|
import { TranslatePipe } from '@ngx-translate/core';
|
|
9
|
+
import { ZButtonComponent } from '@shival99/z-ui/components/z-button';
|
|
9
10
|
import { ZIconComponent } from '@shival99/z-ui/components/z-icon';
|
|
11
|
+
import { ZPopoverDirective } from '@shival99/z-ui/components/z-popover';
|
|
12
|
+
import { ZSelectComponent } from '@shival99/z-ui/components/z-select';
|
|
10
13
|
import { ZToastService } from '@shival99/z-ui/components/z-toast';
|
|
11
14
|
import { ZTranslateService, ZCacheService } from '@shival99/z-ui/services';
|
|
12
15
|
import { zTransform, zUuid, zMergeClasses, zCreateEvent } from '@shival99/z-ui/utils';
|
|
@@ -76,6 +79,7 @@ class ZInputComponent {
|
|
|
76
79
|
_toastService = inject(ZToastService);
|
|
77
80
|
_zTranslate = inject(ZTranslateService);
|
|
78
81
|
inputRef = viewChild('inputEl', ...(ngDevMode ? [{ debugName: "inputRef" }] : []));
|
|
82
|
+
nativeColorInputRef = viewChild('nativeColorInputEl', ...(ngDevMode ? [{ debugName: "nativeColorInputRef" }] : []));
|
|
79
83
|
zOnSearch = output();
|
|
80
84
|
zOnChange = output();
|
|
81
85
|
zOnBlur = output();
|
|
@@ -135,6 +139,12 @@ class ZInputComponent {
|
|
|
135
139
|
alpha: 100,
|
|
136
140
|
layer: 'outer',
|
|
137
141
|
}, ...(ngDevMode ? [{ debugName: "_blossomColor" }] : []));
|
|
142
|
+
_colorPickerHsv = signal({ hue: 258, saturation: 65, value: 85 }, ...(ngDevMode ? [{ debugName: "_colorPickerHsv" }] : []));
|
|
143
|
+
_colorPickerRgb = signal({ red: 79, green: 70, blue: 229 }, ...(ngDevMode ? [{ debugName: "_colorPickerRgb" }] : []));
|
|
144
|
+
_colorPickerHsl = signal({ hue: 243, saturation: 75, lightness: 59 }, ...(ngDevMode ? [{ debugName: "_colorPickerHsl" }] : []));
|
|
145
|
+
_colorPickerAlpha = signal(100, ...(ngDevMode ? [{ debugName: "_colorPickerAlpha" }] : []));
|
|
146
|
+
_colorPickerFormat = signal('hex', ...(ngDevMode ? [{ debugName: "_colorPickerFormat" }] : []));
|
|
147
|
+
_colorPickerSavedColors = signal([], ...(ngDevMode ? [{ debugName: "_colorPickerSavedColors" }] : []));
|
|
138
148
|
inputId = zUuid('z-input');
|
|
139
149
|
suggestHistory = signal([], ...(ngDevMode ? [{ debugName: "suggestHistory" }] : []));
|
|
140
150
|
suggestActiveIndex = signal(-1, ...(ngDevMode ? [{ debugName: "suggestActiveIndex" }] : []));
|
|
@@ -177,6 +187,8 @@ class ZInputComponent {
|
|
|
177
187
|
return val === null || val === undefined ? '' : String(val);
|
|
178
188
|
}, ...(ngDevMode ? [{ debugName: "displayValue" }] : []));
|
|
179
189
|
normalizedColorValue = computed(() => this._normalizeHexColor(this._value()), ...(ngDevMode ? [{ debugName: "normalizedColorValue" }] : []));
|
|
190
|
+
colorMode = computed(() => this.zColorConfig().mode ?? 'blossom', ...(ngDevMode ? [{ debugName: "colorMode" }] : []));
|
|
191
|
+
isBlossomColorMode = computed(() => this.colorMode() === 'blossom', ...(ngDevMode ? [{ debugName: "isBlossomColorMode" }] : []));
|
|
180
192
|
blossomCoreBorderColor = computed(() => {
|
|
181
193
|
const color = this.normalizedColorValue();
|
|
182
194
|
if (color === '#FFFFFF' || color === '#000000') {
|
|
@@ -185,6 +197,61 @@ class ZInputComponent {
|
|
|
185
197
|
return color;
|
|
186
198
|
}, ...(ngDevMode ? [{ debugName: "blossomCoreBorderColor" }] : []));
|
|
187
199
|
blossomColor = this._blossomColor.asReadonly();
|
|
200
|
+
colorPickerHsv = this._colorPickerHsv.asReadonly();
|
|
201
|
+
colorPickerRgbValue = this._colorPickerRgb.asReadonly();
|
|
202
|
+
colorPickerHslValue = this._colorPickerHsl.asReadonly();
|
|
203
|
+
colorPickerAlpha = this._colorPickerAlpha.asReadonly();
|
|
204
|
+
colorPickerFormat = this._colorPickerFormat.asReadonly();
|
|
205
|
+
colorPickerFormatOptions = [
|
|
206
|
+
{ label: 'HEX', value: 'hex' },
|
|
207
|
+
{ label: 'RGB', value: 'rgb' },
|
|
208
|
+
{ label: 'HSL', value: 'hsl' },
|
|
209
|
+
{ label: 'HSV', value: 'hsv' },
|
|
210
|
+
];
|
|
211
|
+
colorPickerHueColor = computed(() => `hsl(${this.colorPickerHsv().hue} 100% 50%)`, ...(ngDevMode ? [{ debugName: "colorPickerHueColor" }] : []));
|
|
212
|
+
colorPickerSvStyle = computed(() => ({
|
|
213
|
+
background: `linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, ${this.colorPickerHueColor()})`,
|
|
214
|
+
}), ...(ngDevMode ? [{ debugName: "colorPickerSvStyle" }] : []));
|
|
215
|
+
colorPickerCursorStyle = computed(() => {
|
|
216
|
+
const hsv = this.colorPickerHsv();
|
|
217
|
+
return {
|
|
218
|
+
left: `${hsv.saturation}%`,
|
|
219
|
+
top: `${100 - hsv.value}%`,
|
|
220
|
+
};
|
|
221
|
+
}, ...(ngDevMode ? [{ debugName: "colorPickerCursorStyle" }] : []));
|
|
222
|
+
defaultColorPickerSavedColors = computed(() => {
|
|
223
|
+
const { savedColors } = this.zColorConfig();
|
|
224
|
+
if (savedColors) {
|
|
225
|
+
return this._normalizeColorList(savedColors);
|
|
226
|
+
}
|
|
227
|
+
return this._normalizeColorList([
|
|
228
|
+
'#16A34A',
|
|
229
|
+
'#2563EB',
|
|
230
|
+
'#4F46E5',
|
|
231
|
+
'#7C3AED',
|
|
232
|
+
'#C026D3',
|
|
233
|
+
'#DB2777',
|
|
234
|
+
'#DC2626',
|
|
235
|
+
'#EA580C',
|
|
236
|
+
'#7F56D9',
|
|
237
|
+
'#111827',
|
|
238
|
+
'#155E75',
|
|
239
|
+
'#A3A310',
|
|
240
|
+
'#0EA5E9',
|
|
241
|
+
'#D946EF',
|
|
242
|
+
'#E11D48',
|
|
243
|
+
'#22C55E',
|
|
244
|
+
]);
|
|
245
|
+
}, ...(ngDevMode ? [{ debugName: "defaultColorPickerSavedColors" }] : []));
|
|
246
|
+
colorPickerSavedColors = computed(() => {
|
|
247
|
+
const cachedColors = this._colorPickerSavedColors();
|
|
248
|
+
const fallbackColors = this.defaultColorPickerSavedColors();
|
|
249
|
+
return this._normalizeColorList([...cachedColors, ...fallbackColors]).slice(0, 8);
|
|
250
|
+
}, ...(ngDevMode ? [{ debugName: "colorPickerSavedColors" }] : []));
|
|
251
|
+
colorPickerSavedSwatches = computed(() => this.colorPickerSavedColors().map(color => ({
|
|
252
|
+
color,
|
|
253
|
+
isLight: this._isLightHexColor(color),
|
|
254
|
+
})), ...(ngDevMode ? [{ debugName: "colorPickerSavedSwatches" }] : []));
|
|
188
255
|
blossomCoreSize = computed(() => {
|
|
189
256
|
const size = this.zSize();
|
|
190
257
|
if (size === 'sm') {
|
|
@@ -340,7 +407,9 @@ class ZInputComponent {
|
|
|
340
407
|
_onChange = () => void 0;
|
|
341
408
|
_onTouched = () => void 0;
|
|
342
409
|
_ngControl = null;
|
|
410
|
+
_colorPickerPopoverControl = null;
|
|
343
411
|
ngOnInit() {
|
|
412
|
+
this._loadColorPickerSavedColors();
|
|
344
413
|
queueMicrotask(() => {
|
|
345
414
|
try {
|
|
346
415
|
this._ngControl = this._injector.get(NgControl, null);
|
|
@@ -384,7 +453,7 @@ class ZInputComponent {
|
|
|
384
453
|
writeValue(value) {
|
|
385
454
|
this._value.set(value);
|
|
386
455
|
if (this.zType() === 'color') {
|
|
387
|
-
this.
|
|
456
|
+
this._syncColorStateFromHex(this._normalizeHexColor(value));
|
|
388
457
|
}
|
|
389
458
|
}
|
|
390
459
|
registerOnChange(fn) {
|
|
@@ -472,11 +541,7 @@ class ZInputComponent {
|
|
|
472
541
|
const { value: rawValue } = event.target;
|
|
473
542
|
let value = rawValue;
|
|
474
543
|
if (this.zType() === 'number') {
|
|
475
|
-
|
|
476
|
-
value = cleanValue === '' ? null : parseFloat(cleanValue);
|
|
477
|
-
if (value !== null && isNaN(value)) {
|
|
478
|
-
value = null;
|
|
479
|
-
}
|
|
544
|
+
value = this._parseNumberValue(value);
|
|
480
545
|
}
|
|
481
546
|
this._value.set(value);
|
|
482
547
|
this.uiState.update(s => ({ ...s, dirty: true }));
|
|
@@ -489,14 +554,10 @@ class ZInputComponent {
|
|
|
489
554
|
let value = rawValue;
|
|
490
555
|
if (this.zType() === 'color' && typeof rawValue === 'string') {
|
|
491
556
|
value = this._normalizeHexColor(rawValue);
|
|
492
|
-
this.
|
|
557
|
+
this._syncColorStateFromHex(value);
|
|
493
558
|
}
|
|
494
559
|
if (this.zType() === 'number' && typeof rawValue === 'string') {
|
|
495
|
-
|
|
496
|
-
value = cleanValue === '' ? null : parseFloat(cleanValue);
|
|
497
|
-
if (value !== null && isNaN(value)) {
|
|
498
|
-
value = null;
|
|
499
|
-
}
|
|
560
|
+
value = this._parseNumberValue(rawValue);
|
|
500
561
|
}
|
|
501
562
|
this._value.set(value);
|
|
502
563
|
this.uiState.update(s => ({ ...s, dirty: true }));
|
|
@@ -656,6 +717,108 @@ class ZInputComponent {
|
|
|
656
717
|
this._blossomColor.set(color);
|
|
657
718
|
this.zOnColorCollapse.emit(color);
|
|
658
719
|
}
|
|
720
|
+
onColorPickerControl(control) {
|
|
721
|
+
this._colorPickerPopoverControl = control;
|
|
722
|
+
}
|
|
723
|
+
onColorPickerOpen() {
|
|
724
|
+
this._syncColorPickerFromHex(this.normalizedColorValue());
|
|
725
|
+
this._loadColorPickerSavedColors();
|
|
726
|
+
}
|
|
727
|
+
onColorPickerFormatChange(value) {
|
|
728
|
+
if (!value || Array.isArray(value)) {
|
|
729
|
+
return;
|
|
730
|
+
}
|
|
731
|
+
this._colorPickerFormat.set(value);
|
|
732
|
+
}
|
|
733
|
+
onColorPickerHexChange(value) {
|
|
734
|
+
const raw = String(value ?? '').trim();
|
|
735
|
+
if (!/^#?[0-9a-fA-F]{3}$/.test(raw) && !/^#?[0-9a-fA-F]{6}$/.test(raw)) {
|
|
736
|
+
return;
|
|
737
|
+
}
|
|
738
|
+
this._commitColor(this._normalizeHexColor(raw.startsWith('#') ? raw : `#${raw}`));
|
|
739
|
+
}
|
|
740
|
+
onColorPickerAlphaValueChange(value) {
|
|
741
|
+
const alpha = Number(value ?? 100);
|
|
742
|
+
if (Number.isNaN(alpha)) {
|
|
743
|
+
return;
|
|
744
|
+
}
|
|
745
|
+
this._setColorPickerAlpha(alpha);
|
|
746
|
+
}
|
|
747
|
+
onColorPickerRgbChange(channel, value) {
|
|
748
|
+
const channelValue = this._parseBoundedNumber(value, 0, 255);
|
|
749
|
+
if (channelValue === null) {
|
|
750
|
+
return;
|
|
751
|
+
}
|
|
752
|
+
const rgb = this.colorPickerRgbValue();
|
|
753
|
+
const nextRgb = { ...rgb, [channel]: channelValue };
|
|
754
|
+
this._commitColor(this._rgbToHex(nextRgb));
|
|
755
|
+
}
|
|
756
|
+
onColorPickerHslChange(channel, value) {
|
|
757
|
+
const max = channel === 'hue' ? 360 : 100;
|
|
758
|
+
const channelValue = this._parseBoundedNumber(value, 0, max);
|
|
759
|
+
if (channelValue === null) {
|
|
760
|
+
return;
|
|
761
|
+
}
|
|
762
|
+
const hsl = this.colorPickerHslValue();
|
|
763
|
+
const nextHsl = { ...hsl, [channel]: channelValue };
|
|
764
|
+
this._commitColor(this._hslToHex(nextHsl));
|
|
765
|
+
}
|
|
766
|
+
onColorPickerHsvValueChange(channel, value) {
|
|
767
|
+
const max = channel === 'hue' ? 360 : 100;
|
|
768
|
+
const channelValue = this._parseBoundedNumber(value, 0, max);
|
|
769
|
+
if (channelValue === null) {
|
|
770
|
+
return;
|
|
771
|
+
}
|
|
772
|
+
const nextHsv = { ...this.colorPickerHsv(), [channel]: channelValue };
|
|
773
|
+
this._colorPickerHsv.set(nextHsv);
|
|
774
|
+
this._commitColor(this._hsvToHex(nextHsv));
|
|
775
|
+
}
|
|
776
|
+
onColorPickerHueInput(event) {
|
|
777
|
+
const input = event.target;
|
|
778
|
+
const hue = Number(input?.value ?? 0);
|
|
779
|
+
this._colorPickerHsv.update(color => ({ ...color, hue }));
|
|
780
|
+
this._commitColor(this._hsvToHex(this._colorPickerHsv()));
|
|
781
|
+
}
|
|
782
|
+
onColorPickerAlphaInput(event) {
|
|
783
|
+
const input = event.target;
|
|
784
|
+
const alpha = Number(input?.value ?? 100);
|
|
785
|
+
this._setColorPickerAlpha(alpha);
|
|
786
|
+
}
|
|
787
|
+
onColorPickerSvPointerDown(event) {
|
|
788
|
+
this._updateColorPickerSv(event);
|
|
789
|
+
const target = event.currentTarget;
|
|
790
|
+
target.setPointerCapture(event.pointerId);
|
|
791
|
+
}
|
|
792
|
+
onColorPickerSvPointerMove(event) {
|
|
793
|
+
if (!event.buttons) {
|
|
794
|
+
return;
|
|
795
|
+
}
|
|
796
|
+
this._updateColorPickerSv(event);
|
|
797
|
+
}
|
|
798
|
+
selectSavedColor(color) {
|
|
799
|
+
this._commitColor(color);
|
|
800
|
+
}
|
|
801
|
+
addCurrentColorToSaved() {
|
|
802
|
+
const color = this.normalizedColorValue();
|
|
803
|
+
if (!/^#[0-9A-F]{6}$/.test(color)) {
|
|
804
|
+
return;
|
|
805
|
+
}
|
|
806
|
+
const nextColors = this._normalizeColorList([color, ...this.colorPickerSavedColors()]).slice(0, 8);
|
|
807
|
+
this._colorPickerSavedColors.set(nextColors);
|
|
808
|
+
ZCacheService.set(this._colorPickerCacheKey(), nextColors);
|
|
809
|
+
}
|
|
810
|
+
async openNativeColorPicker() {
|
|
811
|
+
const eyeDropper = this._getEyeDropper();
|
|
812
|
+
if (eyeDropper) {
|
|
813
|
+
const result = await eyeDropper.open();
|
|
814
|
+
this._commitColor(result.sRGBHex);
|
|
815
|
+
return;
|
|
816
|
+
}
|
|
817
|
+
this.nativeColorInputRef()?.nativeElement.click();
|
|
818
|
+
}
|
|
819
|
+
closeColorPicker() {
|
|
820
|
+
this._colorPickerPopoverControl?.close();
|
|
821
|
+
}
|
|
659
822
|
_emitControl() {
|
|
660
823
|
this.zControl.emit({
|
|
661
824
|
valid: () => this.valid(),
|
|
@@ -767,6 +930,17 @@ class ZInputComponent {
|
|
|
767
930
|
const history = ZCacheService.get(cacheKey, []) ?? [];
|
|
768
931
|
this.suggestHistory.set(history);
|
|
769
932
|
}
|
|
933
|
+
_colorPickerCacheKey() {
|
|
934
|
+
const configuredKey = this.zColorConfig().cacheKey;
|
|
935
|
+
if (configuredKey) {
|
|
936
|
+
return `input-color-picker-${configuredKey}`;
|
|
937
|
+
}
|
|
938
|
+
return 'input-color-picker-saved-colors';
|
|
939
|
+
}
|
|
940
|
+
_loadColorPickerSavedColors() {
|
|
941
|
+
const savedColors = ZCacheService.get(this._colorPickerCacheKey(), []) ?? [];
|
|
942
|
+
this._colorPickerSavedColors.set(this._normalizeColorList(savedColors).slice(0, 8));
|
|
943
|
+
}
|
|
770
944
|
_incrementValue(multiplier) {
|
|
771
945
|
const currentValue = this._value();
|
|
772
946
|
const numValue = typeof currentValue === 'number' ? currentValue : parseFloat(String(currentValue)) || 0;
|
|
@@ -799,6 +973,28 @@ class ZInputComponent {
|
|
|
799
973
|
}
|
|
800
974
|
return cleaned;
|
|
801
975
|
}
|
|
976
|
+
_parseNumberValue(value) {
|
|
977
|
+
const cleanValue = this._cleanNumberValue(value);
|
|
978
|
+
if (cleanValue === '') {
|
|
979
|
+
return null;
|
|
980
|
+
}
|
|
981
|
+
let numberValue = parseFloat(cleanValue);
|
|
982
|
+
if (isNaN(numberValue)) {
|
|
983
|
+
return null;
|
|
984
|
+
}
|
|
985
|
+
const min = this.zMin();
|
|
986
|
+
const max = this.zMax();
|
|
987
|
+
if (min !== undefined && numberValue < min) {
|
|
988
|
+
numberValue = min;
|
|
989
|
+
}
|
|
990
|
+
if (max !== undefined && numberValue > max) {
|
|
991
|
+
numberValue = max;
|
|
992
|
+
}
|
|
993
|
+
if (!this.zAllowNegative() && numberValue < 0) {
|
|
994
|
+
return 0;
|
|
995
|
+
}
|
|
996
|
+
return numberValue;
|
|
997
|
+
}
|
|
802
998
|
_getEffectiveMask() {
|
|
803
999
|
const mask = this.zMask();
|
|
804
1000
|
if (mask) {
|
|
@@ -881,6 +1077,9 @@ class ZInputComponent {
|
|
|
881
1077
|
return errors;
|
|
882
1078
|
}
|
|
883
1079
|
_normalizeHexColor(value) {
|
|
1080
|
+
return this._tryNormalizeHexColor(value) ?? '#000000';
|
|
1081
|
+
}
|
|
1082
|
+
_tryNormalizeHexColor(value) {
|
|
884
1083
|
const raw = String(value ?? '')
|
|
885
1084
|
.trim()
|
|
886
1085
|
.toUpperCase();
|
|
@@ -891,7 +1090,7 @@ class ZInputComponent {
|
|
|
891
1090
|
const [r, g, b] = raw.slice(1).split('');
|
|
892
1091
|
return `#${r}${r}${g}${g}${b}${b}`;
|
|
893
1092
|
}
|
|
894
|
-
return
|
|
1093
|
+
return null;
|
|
895
1094
|
}
|
|
896
1095
|
_syncBlossomColorFromHex(hex) {
|
|
897
1096
|
const { h, s, l } = hexToHsl(hex);
|
|
@@ -905,6 +1104,243 @@ class ZInputComponent {
|
|
|
905
1104
|
layer: current.layer,
|
|
906
1105
|
});
|
|
907
1106
|
}
|
|
1107
|
+
_syncColorStateFromHex(hex) {
|
|
1108
|
+
this._syncBlossomColorFromHex(hex);
|
|
1109
|
+
this._syncColorPickerFromHex(hex);
|
|
1110
|
+
}
|
|
1111
|
+
_syncColorPickerFromHex(hex) {
|
|
1112
|
+
const hsv = this._hexToHsv(hex);
|
|
1113
|
+
const rgb = this._hsvToRgb(hsv);
|
|
1114
|
+
this._colorPickerHsv.set(hsv);
|
|
1115
|
+
this._colorPickerRgb.set(rgb);
|
|
1116
|
+
this._colorPickerHsl.set(this._rgbToHsl(rgb));
|
|
1117
|
+
}
|
|
1118
|
+
_commitColor(hex) {
|
|
1119
|
+
const color = this._normalizeHexColor(hex);
|
|
1120
|
+
this._value.set(color);
|
|
1121
|
+
this._syncColorStateFromHex(color);
|
|
1122
|
+
this.uiState.update(s => ({ ...s, dirty: true }));
|
|
1123
|
+
this._onChange(color);
|
|
1124
|
+
this._changeSubject.next(color);
|
|
1125
|
+
if (this.zAsyncValidators().length > 0 && this.zAsyncValidateOn() === 'change') {
|
|
1126
|
+
this._asyncValidationSubject.next(color);
|
|
1127
|
+
}
|
|
1128
|
+
}
|
|
1129
|
+
_setColorPickerAlpha(alpha) {
|
|
1130
|
+
const boundedAlpha = Math.min(100, Math.max(0, Math.round(alpha)));
|
|
1131
|
+
this._colorPickerAlpha.set(boundedAlpha);
|
|
1132
|
+
}
|
|
1133
|
+
_parseBoundedNumber(value, min, max) {
|
|
1134
|
+
const numericValue = Number(value);
|
|
1135
|
+
if (Number.isNaN(numericValue)) {
|
|
1136
|
+
return null;
|
|
1137
|
+
}
|
|
1138
|
+
return Math.min(max, Math.max(min, Math.round(numericValue)));
|
|
1139
|
+
}
|
|
1140
|
+
_normalizeColorList(colors) {
|
|
1141
|
+
const result = [];
|
|
1142
|
+
for (const color of colors) {
|
|
1143
|
+
const normalized = this._tryNormalizeHexColor(color);
|
|
1144
|
+
if (!normalized) {
|
|
1145
|
+
continue;
|
|
1146
|
+
}
|
|
1147
|
+
if (result.includes(normalized)) {
|
|
1148
|
+
continue;
|
|
1149
|
+
}
|
|
1150
|
+
result.push(normalized);
|
|
1151
|
+
}
|
|
1152
|
+
return result;
|
|
1153
|
+
}
|
|
1154
|
+
_isLightHexColor(hex) {
|
|
1155
|
+
const normalized = this._normalizeHexColor(hex).slice(1);
|
|
1156
|
+
const red = parseInt(normalized.slice(0, 2), 16);
|
|
1157
|
+
const green = parseInt(normalized.slice(2, 4), 16);
|
|
1158
|
+
const blue = parseInt(normalized.slice(4, 6), 16);
|
|
1159
|
+
const luminance = (0.299 * red + 0.587 * green + 0.114 * blue) / 255;
|
|
1160
|
+
return luminance > 0.82;
|
|
1161
|
+
}
|
|
1162
|
+
_getEyeDropper() {
|
|
1163
|
+
const maybeWindow = window;
|
|
1164
|
+
if (!maybeWindow.EyeDropper) {
|
|
1165
|
+
return null;
|
|
1166
|
+
}
|
|
1167
|
+
return new maybeWindow.EyeDropper();
|
|
1168
|
+
}
|
|
1169
|
+
_updateColorPickerSv(event) {
|
|
1170
|
+
const target = event.currentTarget;
|
|
1171
|
+
const rect = target.getBoundingClientRect();
|
|
1172
|
+
const saturation = ((event.clientX - rect.left) / rect.width) * 100;
|
|
1173
|
+
const value = 100 - ((event.clientY - rect.top) / rect.height) * 100;
|
|
1174
|
+
this._colorPickerHsv.update(color => ({
|
|
1175
|
+
...color,
|
|
1176
|
+
saturation: Math.min(100, Math.max(0, saturation)),
|
|
1177
|
+
value: Math.min(100, Math.max(0, value)),
|
|
1178
|
+
}));
|
|
1179
|
+
this._commitColor(this._hsvToHex(this._colorPickerHsv()));
|
|
1180
|
+
}
|
|
1181
|
+
_hexToHsv(hex) {
|
|
1182
|
+
const normalized = this._normalizeHexColor(hex).slice(1);
|
|
1183
|
+
const red = parseInt(normalized.slice(0, 2), 16) / 255;
|
|
1184
|
+
const green = parseInt(normalized.slice(2, 4), 16) / 255;
|
|
1185
|
+
const blue = parseInt(normalized.slice(4, 6), 16) / 255;
|
|
1186
|
+
const max = Math.max(red, green, blue);
|
|
1187
|
+
const min = Math.min(red, green, blue);
|
|
1188
|
+
const delta = max - min;
|
|
1189
|
+
let hue = 0;
|
|
1190
|
+
if (delta !== 0) {
|
|
1191
|
+
if (max === red) {
|
|
1192
|
+
hue = ((green - blue) / delta) % 6;
|
|
1193
|
+
}
|
|
1194
|
+
if (max === green) {
|
|
1195
|
+
hue = (blue - red) / delta + 2;
|
|
1196
|
+
}
|
|
1197
|
+
if (max === blue) {
|
|
1198
|
+
hue = (red - green) / delta + 4;
|
|
1199
|
+
}
|
|
1200
|
+
hue = Math.round(hue * 60);
|
|
1201
|
+
if (hue < 0) {
|
|
1202
|
+
hue += 360;
|
|
1203
|
+
}
|
|
1204
|
+
}
|
|
1205
|
+
return {
|
|
1206
|
+
hue,
|
|
1207
|
+
saturation: max === 0 ? 0 : Math.round((delta / max) * 100),
|
|
1208
|
+
value: Math.round(max * 100),
|
|
1209
|
+
};
|
|
1210
|
+
}
|
|
1211
|
+
_hsvToRgb(color) {
|
|
1212
|
+
const hex = this._hsvToHex(color).slice(1);
|
|
1213
|
+
return {
|
|
1214
|
+
red: parseInt(hex.slice(0, 2), 16),
|
|
1215
|
+
green: parseInt(hex.slice(2, 4), 16),
|
|
1216
|
+
blue: parseInt(hex.slice(4, 6), 16),
|
|
1217
|
+
};
|
|
1218
|
+
}
|
|
1219
|
+
_rgbToHex(color) {
|
|
1220
|
+
return [color.red, color.green, color.blue]
|
|
1221
|
+
.map(channel => Math.min(255, Math.max(0, channel)).toString(16).padStart(2, '0'))
|
|
1222
|
+
.join('')
|
|
1223
|
+
.toUpperCase()
|
|
1224
|
+
.replace(/^/, '#');
|
|
1225
|
+
}
|
|
1226
|
+
_rgbToHsl(color) {
|
|
1227
|
+
const red = color.red / 255;
|
|
1228
|
+
const green = color.green / 255;
|
|
1229
|
+
const blue = color.blue / 255;
|
|
1230
|
+
const max = Math.max(red, green, blue);
|
|
1231
|
+
const min = Math.min(red, green, blue);
|
|
1232
|
+
const delta = max - min;
|
|
1233
|
+
const lightness = (max + min) / 2;
|
|
1234
|
+
let hue = 0;
|
|
1235
|
+
let saturation = 0;
|
|
1236
|
+
if (delta !== 0) {
|
|
1237
|
+
saturation = delta / (1 - Math.abs(2 * lightness - 1));
|
|
1238
|
+
if (max === red) {
|
|
1239
|
+
hue = ((green - blue) / delta) % 6;
|
|
1240
|
+
}
|
|
1241
|
+
if (max === green) {
|
|
1242
|
+
hue = (blue - red) / delta + 2;
|
|
1243
|
+
}
|
|
1244
|
+
if (max === blue) {
|
|
1245
|
+
hue = (red - green) / delta + 4;
|
|
1246
|
+
}
|
|
1247
|
+
hue = Math.round(hue * 60);
|
|
1248
|
+
if (hue < 0) {
|
|
1249
|
+
hue += 360;
|
|
1250
|
+
}
|
|
1251
|
+
}
|
|
1252
|
+
return {
|
|
1253
|
+
hue,
|
|
1254
|
+
saturation: Math.round(saturation * 100),
|
|
1255
|
+
lightness: Math.round(lightness * 100),
|
|
1256
|
+
};
|
|
1257
|
+
}
|
|
1258
|
+
_hslToHex(color) {
|
|
1259
|
+
const saturation = color.saturation / 100;
|
|
1260
|
+
const lightness = color.lightness / 100;
|
|
1261
|
+
const chroma = (1 - Math.abs(2 * lightness - 1)) * saturation;
|
|
1262
|
+
const hueSection = color.hue / 60;
|
|
1263
|
+
const x = chroma * (1 - Math.abs((hueSection % 2) - 1));
|
|
1264
|
+
const match = lightness - chroma / 2;
|
|
1265
|
+
let red = chroma;
|
|
1266
|
+
let green = 0;
|
|
1267
|
+
let blue = x;
|
|
1268
|
+
if (hueSection < 1) {
|
|
1269
|
+
red = chroma;
|
|
1270
|
+
green = x;
|
|
1271
|
+
blue = 0;
|
|
1272
|
+
}
|
|
1273
|
+
if (hueSection >= 1 && hueSection < 2) {
|
|
1274
|
+
red = x;
|
|
1275
|
+
green = chroma;
|
|
1276
|
+
blue = 0;
|
|
1277
|
+
}
|
|
1278
|
+
if (hueSection >= 2 && hueSection < 3) {
|
|
1279
|
+
red = 0;
|
|
1280
|
+
green = chroma;
|
|
1281
|
+
blue = x;
|
|
1282
|
+
}
|
|
1283
|
+
if (hueSection >= 3 && hueSection < 4) {
|
|
1284
|
+
red = 0;
|
|
1285
|
+
green = x;
|
|
1286
|
+
blue = chroma;
|
|
1287
|
+
}
|
|
1288
|
+
if (hueSection >= 4 && hueSection < 5) {
|
|
1289
|
+
red = x;
|
|
1290
|
+
green = 0;
|
|
1291
|
+
blue = chroma;
|
|
1292
|
+
}
|
|
1293
|
+
return [red, green, blue]
|
|
1294
|
+
.map(channel => Math.round((channel + match) * 255)
|
|
1295
|
+
.toString(16)
|
|
1296
|
+
.padStart(2, '0'))
|
|
1297
|
+
.join('')
|
|
1298
|
+
.toUpperCase()
|
|
1299
|
+
.replace(/^/, '#');
|
|
1300
|
+
}
|
|
1301
|
+
_hsvToHex(color) {
|
|
1302
|
+
const saturation = color.saturation / 100;
|
|
1303
|
+
const value = color.value / 100;
|
|
1304
|
+
const chroma = value * saturation;
|
|
1305
|
+
const hueSection = color.hue / 60;
|
|
1306
|
+
const x = chroma * (1 - Math.abs((hueSection % 2) - 1));
|
|
1307
|
+
const match = value - chroma;
|
|
1308
|
+
let red = chroma;
|
|
1309
|
+
let green = 0;
|
|
1310
|
+
let blue = x;
|
|
1311
|
+
if (hueSection < 1) {
|
|
1312
|
+
red = chroma;
|
|
1313
|
+
green = x;
|
|
1314
|
+
blue = 0;
|
|
1315
|
+
}
|
|
1316
|
+
if (hueSection >= 1 && hueSection < 2) {
|
|
1317
|
+
red = x;
|
|
1318
|
+
green = chroma;
|
|
1319
|
+
blue = 0;
|
|
1320
|
+
}
|
|
1321
|
+
if (hueSection >= 2 && hueSection < 3) {
|
|
1322
|
+
red = 0;
|
|
1323
|
+
green = chroma;
|
|
1324
|
+
blue = x;
|
|
1325
|
+
}
|
|
1326
|
+
if (hueSection >= 3 && hueSection < 4) {
|
|
1327
|
+
red = 0;
|
|
1328
|
+
green = x;
|
|
1329
|
+
blue = chroma;
|
|
1330
|
+
}
|
|
1331
|
+
if (hueSection >= 4 && hueSection < 5) {
|
|
1332
|
+
red = x;
|
|
1333
|
+
green = 0;
|
|
1334
|
+
blue = chroma;
|
|
1335
|
+
}
|
|
1336
|
+
return [red, green, blue]
|
|
1337
|
+
.map(channel => Math.round((channel + match) * 255)
|
|
1338
|
+
.toString(16)
|
|
1339
|
+
.padStart(2, '0'))
|
|
1340
|
+
.join('')
|
|
1341
|
+
.toUpperCase()
|
|
1342
|
+
.replace(/^/, '#');
|
|
1343
|
+
}
|
|
908
1344
|
_generateColorPalette(count) {
|
|
909
1345
|
const safeCount = Math.max(1, Math.floor(count));
|
|
910
1346
|
const basePalette = [...DEFAULT_COLORS];
|
|
@@ -934,7 +1370,7 @@ class ZInputComponent {
|
|
|
934
1370
|
useExisting: forwardRef(() => ZInputComponent),
|
|
935
1371
|
multi: true,
|
|
936
1372
|
},
|
|
937
|
-
], viewQueries: [{ propertyName: "inputRef", first: true, predicate: ["inputEl"], descendants: true, isSignal: true }], exportAs: ["zInput"], ngImport: i0, template: "<div class=\"z-input-wrapper flex w-full flex-col gap-2\">\n @if (zLabel()) {\n <label [for]=\"inputId\" class=\"text-xs leading-none font-medium\" [class]=\"zLabelClass()\">\n {{ zLabel() | translate }}\n @if (zRequired()) {\n <span class=\"text-destructive! ml-0.5\">*</span>\n }\n </label>\n }\n\n @if (typeConfig().isTextarea) {\n <div class=\"relative w-full\" [class]=\"textareaClasses()\" [class.overflow-auto]=\"zAutoSizeContent()\">\n <textarea\n #inputEl\n [id]=\"inputId\"\n [placeholder]=\"zPlaceholder() | translate\"\n class=\"z-input-native placeholder:text-muted-foreground m-0 block min-h-14 w-full resize-none bg-transparent p-2 text-sm outline-none\"\n [class.resize-y]=\"zResize() && !isDisabled() && !zReadonly()\"\n [class.field-sizing-content]=\"zAutoSizeContent()\"\n [disabled]=\"isDisabled()\"\n [readonly]=\"zReadonly()\"\n [autocomplete]=\"zAutoComplete()\"\n [rows]=\"zRows()\"\n [attr.maxlength]=\"zMaxLength()\"\n [ngModel]=\"displayValue()\"\n (ngModelChange)=\"onModelChange($event)\"\n (blur)=\"onBlur($event)\"\n (focus)=\"onFocus($event)\"\n (keydown)=\"onKeydown($event)\"></textarea>\n @if (zMaxLength()) {\n <div class=\"flex justify-end pr-1 pb-1\">\n <span class=\"text-muted-foreground text-xs\">{{ displayValue().length }} / {{ zMaxLength() }}</span>\n </div>\n }\n @if (zResize() && !isDisabled() && !zReadonly() && !zMaxLength()) {\n <svg\n class=\"text-muted-foreground pointer-events-none absolute right-0.5 bottom-0.5 opacity-40\"\n width=\"12\"\n height=\"12\"\n viewBox=\"0 0 12 12\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"1.5\">\n <path d=\"M10 2L2 10\" />\n <path d=\"M10 6L6 10\" />\n </svg>\n }\n </div>\n } @else {\n <div class=\"relative w-full\">\n <div class=\"z-input-container flex w-full items-center\" [class]=\"inputClasses()\">\n <!-- Color picker square (prefix for color type) -->\n @if (typeConfig().isColor) {\n <div class=\"z-[10] shrink-0\">\n <blossom-color-picker\n class=\"z-input-blossom flex items-center justify-center [&>div:first-child]:flex\"\n [style.--z-bcp-core-size.px]=\"blossomOptions().coreSize\"\n [style.--z-bcp-core-border-color]=\"blossomCoreBorderColor()\"\n [value]=\"blossomColor()\"\n [defaultValue]=\"blossomOptions().defaultValue\"\n [colors]=\"blossomColors()\"\n [disabled]=\"isDisabled() || zReadonly()\"\n [openOnHover]=\"blossomOptions().openOnHover\"\n [initialExpanded]=\"blossomOptions().initialExpanded\"\n [animationDuration]=\"blossomOptions().animationDuration\"\n [showAlphaSlider]=\"blossomOptions().showAlphaSlider\"\n [coreSize]=\"blossomOptions().coreSize\"\n [petalSize]=\"blossomOptions().petalSize\"\n [showCoreColor]=\"blossomOptions().showCoreColor\"\n [sliderPosition]=\"blossomOptions().sliderPosition\"\n [adaptivePositioning]=\"blossomOptions().adaptivePositioning\"\n (colorChange)=\"onBlossomColorChange($event)\"\n (colorCollapse)=\"onBlossomColorCollapse($event)\" />\n </div>\n }\n\n @if (slotConfig().hasPrefix && !typeConfig().isColor) {\n <div class=\"text-muted-foreground left-3 flex items-center justify-center\">\n @if (zSearch()) {\n <z-icon zType=\"lucideSearch\" zSize=\"16\" />\n } @else if (slotConfig().isPrefixTemplate) {\n <ng-container *ngTemplateOutlet=\"$any(zPrefix())\" />\n } @else {\n {{ zPrefix() }}\n }\n </div>\n }\n\n <input\n #inputEl\n [id]=\"inputId\"\n [type]=\"typeConfig().isColor ? 'text' : maskConfig().effectiveType\"\n [placeholder]=\"zPlaceholder() | translate\"\n class=\"z-input-native placeholder:text-muted-foreground h-full min-w-0 flex-1 bg-transparent text-sm outline-none\"\n [disabled]=\"isDisabled()\"\n [readonly]=\"typeConfig().isColor ? true : zReadonly()\"\n [attr.min]=\"zMin()\"\n [attr.max]=\"zMax()\"\n [attr.step]=\"zStep()\"\n [autocomplete]=\"zAutoComplete()\"\n [ngModel]=\"typeConfig().isColor ? normalizedColorValue() : displayValue()\"\n (ngModelChange)=\"onModelChange($event)\"\n (blur)=\"onBlur($event)\"\n (focus)=\"onFocus($event)\"\n (keydown)=\"onKeydown($event); onSuggestKeydown($event)\"\n [mask]=\"maskConfig().effectiveMask\"\n [thousandSeparator]=\"zThousandSeparator()\"\n [decimalMarker]=\"maskConfig().effectiveDecimalMarker\"\n [allowNegativeNumbers]=\"zAllowNegative()\"\n [dropSpecialCharacters]=\"false\" />\n\n @if (slotConfig().hasSuffix && !typeConfig().isColor) {\n <div class=\"text-muted-foreground flex items-center justify-center text-sm\">\n @if (slotConfig().isSuffixTemplate) {\n <ng-container *ngTemplateOutlet=\"$any(zSuffix())\" />\n } @else {\n {{ zSuffix() }}\n }\n </div>\n }\n\n <!-- Async validation loading indicator -->\n @if (isValidating()) {\n <div class=\"text-muted-foreground flex items-center justify-center\">\n <z-icon zType=\"lucideLoader2\" zSize=\"16\" class=\"animate-spin\" />\n </div>\n }\n\n <!-- Clear button -->\n @if (showClearButton()) {\n <button\n type=\"button\"\n tabindex=\"-1\"\n class=\"text-muted-foreground hover:text-foreground flex size-5 shrink-0 cursor-pointer items-center justify-center rounded-sm transition-colors\"\n (mousedown)=\"$event.preventDefault()\"\n (click)=\"clearValue($event)\">\n <z-icon zType=\"lucideX\" zSize=\"14\" />\n </button>\n }\n\n <!-- Copy button for color type -->\n @if (typeConfig().isColor) {\n <button\n type=\"button\"\n tabindex=\"-1\"\n class=\"text-muted-foreground hover:text-foreground hover:bg-accent flex size-6 shrink-0 cursor-pointer items-center justify-center rounded-sm transition-all\"\n (mousedown)=\"$event.preventDefault()\"\n (click)=\"copyColorToClipboard()\">\n <span class=\"relative flex size-4 items-center justify-center\">\n <z-icon\n zType=\"lucideCopy\"\n [class]=\"uiState().colorCopied ? 'scale-0 rotate-90 opacity-0' : 'scale-100 rotate-0 opacity-100'\"\n class=\"absolute transition-all duration-200 ease-out\"\n zSize=\"14\" />\n <z-icon\n zType=\"lucideCheck\"\n [class]=\"\n uiState().colorCopied ? 'text-success scale-100 rotate-0 opacity-100' : 'scale-0 -rotate-90 opacity-0'\n \"\n class=\"absolute transition-all duration-200 ease-out\"\n zSize=\"14\" />\n </span>\n </button>\n }\n\n @if (showArrows() && !isDisabled()) {\n <div class=\"-mr-1 flex h-[calc(100%-0.25rem)] shrink-0 flex-col\">\n <button\n type=\"button\"\n tabindex=\"-1\"\n class=\"text-muted-foreground hover:bg-accent hover:text-foreground flex w-5 flex-1 cursor-pointer items-center justify-center rounded-sm transition-all\"\n (mousedown)=\"$event.preventDefault()\"\n (click)=\"onArrowClick($event, 'up')\">\n <z-icon zType=\"lucideChevronUp\" zSize=\"12\" />\n </button>\n <button\n type=\"button\"\n tabindex=\"-1\"\n class=\"text-muted-foreground hover:bg-accent hover:text-foreground flex w-5 flex-1 cursor-pointer items-center justify-center rounded-sm transition-all\"\n (mousedown)=\"$event.preventDefault()\"\n (click)=\"onArrowClick($event, 'down')\">\n <z-icon zType=\"lucideChevronDown\" zSize=\"12\" />\n </button>\n </div>\n }\n\n @if (typeConfig().isPassword && zShowPasswordToggle()) {\n <button\n type=\"button\"\n tabindex=\"-1\"\n class=\"text-muted-foreground hover:text-foreground flex size-6 shrink-0 cursor-pointer items-center justify-center rounded-sm transition-all\"\n (mousedown)=\"$event.preventDefault()\"\n (click)=\"togglePasswordVisibility()\">\n @if (uiState().passwordVisible) {\n <z-icon zType=\"lucideEyeOff\" zSize=\"16\" />\n } @else {\n <z-icon zType=\"lucideEye\" zSize=\"16\" />\n }\n </button>\n }\n </div>\n\n @if (hasAutoSuggest() && uiState().showSuggestPopover && suggestHistory().length > 0) {\n <div\n class=\"bg-popover text-popover-foreground border-border z-animate-in z-fade-in z-duration-200 z-slide-in-from-top-4 absolute top-full left-0 z-50 mt-1 flex w-full flex-col gap-[0.1875rem] rounded-sm border p-1 shadow-md\">\n @for (item of filteredSuggestHistory(); track item; let i = $index) {\n <button\n type=\"button\"\n class=\"hover:bg-primary/10 hover:text-foreground flex w-full cursor-pointer items-center gap-2 rounded-sm px-2 py-1.5 text-left text-sm transition-colors\"\n [class.bg-primary/15]=\"suggestActiveIndex() === i\"\n [class.text-primary]=\"suggestActiveIndex() === i\"\n (mousedown)=\"selectSuggestItem(item)\">\n <z-icon zType=\"lucideClock\" zSize=\"14\" class=\"text-muted-foreground shrink-0\" />\n <span class=\"truncate\">{{ item }}</span>\n </button>\n }\n </div>\n }\n </div>\n }\n\n @if (hasError()) {\n <p class=\"text-destructive animate-in fade-in slide-in-from-top-1 m-0 text-xs duration-200\">\n {{ errorMessage() }}\n </p>\n }\n</div>\n", styles: [".z-input-native{text-overflow:ellipsis;overflow:hidden}.z-input-native:-webkit-autofill,.z-input-native:-webkit-autofill:hover,.z-input-native:-webkit-autofill:focus,.z-input-native:-webkit-autofill:active{-webkit-box-shadow:0 0 0 1000px white inset!important;-webkit-text-fill-color:var(--color-foreground)!important;transition:background-color 9999s ease-in-out 0s!important;caret-color:var(--color-foreground)}:is(.dark,.dark *) .z-input-native:-webkit-autofill,:is(.dark,.dark *) .z-input-native:-webkit-autofill:hover,:is(.dark,.dark *) .z-input-native:-webkit-autofill:focus,:is(.dark,.dark *) .z-input-native:-webkit-autofill:active{-webkit-box-shadow:0 0 0 1000px var(--input-autofill) inset!important;transition:background-color 9999s ease-in-out 0s!important}textarea.z-input-native::-webkit-resizer{display:none}input[type=number].z-input-native::-webkit-inner-spin-button,input[type=number].z-input-native::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}input[type=number].z-input-native{-moz-appearance:textfield;appearance:textfield}input[type=color]{cursor:pointer}input[type=color]::-webkit-color-swatch-wrapper{padding:0}input[type=color]::-webkit-color-swatch{border:none;border-radius:var(--radius-sm)}input[type=color]::-moz-color-swatch{border:none;border-radius:var(--radius-sm)}.z-input-container{position:relative;overflow:visible}.z-input-container:has(.z-input-blossom .bcp-core[aria-expanded=true]){z-index:40}.z-input-blossom,.z-input-blossom .bcp-root{position:relative;z-index:41;overflow:visible}.z-input-blossom .bcp-container{z-index:42!important}.z-input-blossom .bcp-core{width:var(--z-bcp-core-size, 1.125rem)!important;height:var(--z-bcp-core-size, 1.125rem)!important;min-width:var(--z-bcp-core-size, 1.125rem)!important;min-height:var(--z-bcp-core-size, 1.125rem)!important;border-radius:var(--radius-xs, .125rem)!important;border:1px solid var(--z-bcp-core-border-color, rgba(0, 0, 0, .14))!important;box-shadow:none!important;transition:border-radius .18s cubic-bezier(.22,1,.36,1),border-color .16s ease,transform .18s cubic-bezier(.22,1,.36,1)!important}.z-input-blossom .bcp-core[aria-expanded=true]{border-radius:624.9375rem!important;border-color:transparent!important;box-shadow:0 3px 10px #00000029!important;transform:scale(1.03)!important}.z-input-blossom .bcp-core[aria-expanded=false]{transform:scale(1)!important}\n"], dependencies: [{ kind: "component", type: BlossomColorPickerComponent, selector: "blossom-color-picker", inputs: ["value", "defaultValue", "colors", "disabled", "openOnHover", "initialExpanded", "animationDuration", "showAlphaSlider", "coreSize", "petalSize", "showCoreColor", "sliderPosition", "adaptivePositioning", "circularBarWidth", "sliderWidth", "sliderOffset", "collapsible"], outputs: ["colorChange", "colorCollapse"] }, { 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: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: NgxMaskDirective, selector: "input[mask], textarea[mask]", inputs: ["mask", "specialCharacters", "patterns", "prefix", "suffix", "thousandSeparator", "decimalMarker", "dropSpecialCharacters", "hiddenInput", "showMaskTyped", "placeHolderCharacter", "shownMaskExpression", "clearIfNotMatch", "validation", "separatorLimit", "allowNegativeNumbers", "leadZeroDateTime", "leadZero", "triggerOnMaskChange", "apm", "inputTransformFn", "outputTransformFn", "keepCharacterPositions", "instantPrefix"], outputs: ["maskFilled"], exportAs: ["mask", "ngxMask"] }, { kind: "component", type: ZIconComponent, selector: "z-icon, [z-icon]", inputs: ["class", "zType", "zSize", "zStrokeWidth", "zSvg"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
1373
|
+
], viewQueries: [{ propertyName: "inputRef", first: true, predicate: ["inputEl"], descendants: true, isSignal: true }, { propertyName: "nativeColorInputRef", first: true, predicate: ["nativeColorInputEl"], descendants: true, isSignal: true }], exportAs: ["zInput"], ngImport: i0, template: "<div class=\"z-input-wrapper flex w-full flex-col gap-2\">\n @if (zLabel()) {\n <label [for]=\"inputId\" class=\"text-xs leading-none font-medium\" [class]=\"zLabelClass()\">\n {{ zLabel() | translate }}\n @if (zRequired()) {\n <span class=\"text-destructive! ml-0.5\">*</span>\n }\n </label>\n }\n\n @if (typeConfig().isTextarea) {\n <div class=\"relative w-full\" [class]=\"textareaClasses()\" [class.overflow-auto]=\"zAutoSizeContent()\">\n <textarea\n #inputEl\n [id]=\"inputId\"\n [placeholder]=\"zPlaceholder() | translate\"\n class=\"z-input-native placeholder:text-muted-foreground m-0 block min-h-14 w-full resize-none bg-transparent p-2 text-sm outline-none\"\n [class.resize-y]=\"zResize() && !isDisabled() && !zReadonly()\"\n [class.field-sizing-content]=\"zAutoSizeContent()\"\n [disabled]=\"isDisabled()\"\n [readonly]=\"zReadonly()\"\n [autocomplete]=\"zAutoComplete()\"\n [rows]=\"zRows()\"\n [attr.maxlength]=\"zMaxLength()\"\n [ngModel]=\"displayValue()\"\n (ngModelChange)=\"onModelChange($event)\"\n (blur)=\"onBlur($event)\"\n (focus)=\"onFocus($event)\"\n (keydown)=\"onKeydown($event)\"></textarea>\n @if (zMaxLength()) {\n <div class=\"flex justify-end pr-1 pb-1\">\n <span class=\"text-muted-foreground text-xs\">{{ displayValue().length }} / {{ zMaxLength() }}</span>\n </div>\n }\n @if (zResize() && !isDisabled() && !zReadonly() && !zMaxLength()) {\n <svg\n class=\"text-muted-foreground pointer-events-none absolute right-0.5 bottom-0.5 opacity-40\"\n width=\"12\"\n height=\"12\"\n viewBox=\"0 0 12 12\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"1.5\">\n <path d=\"M10 2L2 10\" />\n <path d=\"M10 6L6 10\" />\n </svg>\n }\n </div>\n } @else {\n <div class=\"relative w-full\">\n <div class=\"z-input-container flex w-full items-center\" [class]=\"inputClasses()\">\n <!-- Color picker square (prefix for color type) -->\n @if (typeConfig().isColor) {\n <div class=\"z-[10] shrink-0\">\n @if (isBlossomColorMode()) {\n <blossom-color-picker\n class=\"z-input-blossom flex items-center justify-center [&>div:first-child]:flex\"\n [style.--z-bcp-core-size.px]=\"blossomOptions().coreSize\"\n [style.--z-bcp-core-border-color]=\"blossomCoreBorderColor()\"\n [value]=\"blossomColor()\"\n [defaultValue]=\"blossomOptions().defaultValue\"\n [colors]=\"blossomColors()\"\n [disabled]=\"isDisabled() || zReadonly()\"\n [openOnHover]=\"blossomOptions().openOnHover\"\n [initialExpanded]=\"blossomOptions().initialExpanded\"\n [animationDuration]=\"blossomOptions().animationDuration\"\n [showAlphaSlider]=\"blossomOptions().showAlphaSlider\"\n [coreSize]=\"blossomOptions().coreSize\"\n [petalSize]=\"blossomOptions().petalSize\"\n [showCoreColor]=\"blossomOptions().showCoreColor\"\n [sliderPosition]=\"blossomOptions().sliderPosition\"\n [adaptivePositioning]=\"blossomOptions().adaptivePositioning\"\n (colorChange)=\"onBlossomColorChange($event)\"\n (colorCollapse)=\"onBlossomColorCollapse($event)\" />\n } @else {\n <button\n type=\"button\"\n class=\"z-input-color-trigger\"\n z-popover\n [zPopoverContent]=\"colorPickerPopover\"\n zTrigger=\"click\"\n zPosition=\"bottom-left\"\n zClass=\"z-input-color-picker-popover\"\n [zOffset]=\"8\"\n [zPopoverWidth]=\"330\"\n [zDisabled]=\"isDisabled() || zReadonly()\"\n [style.--z-bcp-core-size.px]=\"blossomOptions().coreSize\"\n [style.background]=\"normalizedColorValue()\"\n (zControl)=\"onColorPickerControl($event)\"\n (zShow)=\"onColorPickerOpen()\"\n (mousedown)=\"$event.preventDefault()\"\n [attr.aria-label]=\"'Color picker'\"></button>\n }\n </div>\n }\n\n @if (slotConfig().hasPrefix && !typeConfig().isColor) {\n <div class=\"text-muted-foreground left-3 flex items-center justify-center\">\n @if (zSearch()) {\n <z-icon zType=\"lucideSearch\" zSize=\"16\" />\n } @else if (slotConfig().isPrefixTemplate) {\n <ng-container *ngTemplateOutlet=\"$any(zPrefix())\" />\n } @else {\n {{ zPrefix() }}\n }\n </div>\n }\n\n <input\n #inputEl\n [id]=\"inputId\"\n [type]=\"typeConfig().isColor ? 'text' : maskConfig().effectiveType\"\n [placeholder]=\"zPlaceholder() | translate\"\n class=\"z-input-native placeholder:text-muted-foreground h-full min-w-0 flex-1 bg-transparent text-sm outline-none\"\n [disabled]=\"isDisabled()\"\n [readonly]=\"typeConfig().isColor ? true : zReadonly()\"\n [attr.min]=\"zMin()\"\n [attr.max]=\"zMax()\"\n [attr.step]=\"zStep()\"\n [autocomplete]=\"zAutoComplete()\"\n [ngModel]=\"typeConfig().isColor ? normalizedColorValue() : displayValue()\"\n (ngModelChange)=\"onModelChange($event)\"\n (blur)=\"onBlur($event)\"\n (focus)=\"onFocus($event)\"\n (keydown)=\"onKeydown($event); onSuggestKeydown($event)\"\n [mask]=\"maskConfig().effectiveMask\"\n [thousandSeparator]=\"zThousandSeparator()\"\n [decimalMarker]=\"maskConfig().effectiveDecimalMarker\"\n [allowNegativeNumbers]=\"zAllowNegative()\"\n [dropSpecialCharacters]=\"false\" />\n\n @if (slotConfig().hasSuffix && !typeConfig().isColor) {\n <div class=\"text-muted-foreground flex items-center justify-center text-sm\">\n @if (slotConfig().isSuffixTemplate) {\n <ng-container *ngTemplateOutlet=\"$any(zSuffix())\" />\n } @else {\n {{ zSuffix() }}\n }\n </div>\n }\n\n <!-- Async validation loading indicator -->\n @if (isValidating()) {\n <div class=\"text-muted-foreground flex items-center justify-center\">\n <z-icon zType=\"lucideLoader2\" zSize=\"16\" class=\"animate-spin\" />\n </div>\n }\n\n <!-- Clear button -->\n @if (showClearButton()) {\n <button\n type=\"button\"\n tabindex=\"-1\"\n class=\"text-muted-foreground hover:text-foreground flex size-5 shrink-0 cursor-pointer items-center justify-center rounded-sm transition-colors\"\n (mousedown)=\"$event.preventDefault()\"\n (click)=\"clearValue($event)\">\n <z-icon zType=\"lucideX\" zSize=\"14\" />\n </button>\n }\n\n <!-- Copy button for color type -->\n @if (typeConfig().isColor) {\n <input\n #nativeColorInputEl\n type=\"color\"\n class=\"z-input-native-color\"\n [ngModel]=\"normalizedColorValue()\"\n (ngModelChange)=\"onColorPickerHexChange($event)\"\n tabindex=\"-1\"\n aria-hidden=\"true\" />\n\n <button\n type=\"button\"\n tabindex=\"-1\"\n class=\"text-muted-foreground hover:text-foreground hover:bg-accent flex size-6 shrink-0 cursor-pointer items-center justify-center rounded-sm transition-all\"\n (mousedown)=\"$event.preventDefault()\"\n (click)=\"copyColorToClipboard()\">\n <span class=\"relative flex size-4 items-center justify-center\">\n <z-icon\n zType=\"lucideCopy\"\n [class]=\"uiState().colorCopied ? 'scale-0 rotate-90 opacity-0' : 'scale-100 rotate-0 opacity-100'\"\n class=\"absolute transition-all duration-200 ease-out\"\n zSize=\"14\" />\n <z-icon\n zType=\"lucideCheck\"\n [class]=\"\n uiState().colorCopied ? 'text-success scale-100 rotate-0 opacity-100' : 'scale-0 -rotate-90 opacity-0'\n \"\n class=\"absolute transition-all duration-200 ease-out\"\n zSize=\"14\" />\n </span>\n </button>\n }\n\n @if (showArrows() && !isDisabled()) {\n <div class=\"-mr-1 flex h-[calc(100%-0.25rem)] shrink-0 flex-col\">\n <button\n type=\"button\"\n tabindex=\"-1\"\n class=\"text-muted-foreground hover:bg-accent hover:text-foreground flex w-5 flex-1 cursor-pointer items-center justify-center rounded-sm transition-all\"\n (mousedown)=\"$event.preventDefault()\"\n (click)=\"onArrowClick($event, 'up')\">\n <z-icon zType=\"lucideChevronUp\" zSize=\"12\" />\n </button>\n <button\n type=\"button\"\n tabindex=\"-1\"\n class=\"text-muted-foreground hover:bg-accent hover:text-foreground flex w-5 flex-1 cursor-pointer items-center justify-center rounded-sm transition-all\"\n (mousedown)=\"$event.preventDefault()\"\n (click)=\"onArrowClick($event, 'down')\">\n <z-icon zType=\"lucideChevronDown\" zSize=\"12\" />\n </button>\n </div>\n }\n\n @if (typeConfig().isPassword && zShowPasswordToggle()) {\n <button\n type=\"button\"\n tabindex=\"-1\"\n class=\"text-muted-foreground hover:text-foreground flex size-6 shrink-0 cursor-pointer items-center justify-center rounded-sm transition-all\"\n (mousedown)=\"$event.preventDefault()\"\n (click)=\"togglePasswordVisibility()\">\n @if (uiState().passwordVisible) {\n <z-icon zType=\"lucideEyeOff\" zSize=\"16\" />\n } @else {\n <z-icon zType=\"lucideEye\" zSize=\"16\" />\n }\n </button>\n }\n </div>\n\n @if (hasAutoSuggest() && uiState().showSuggestPopover && suggestHistory().length > 0) {\n <div\n class=\"bg-popover text-popover-foreground border-border z-animate-in z-fade-in z-duration-200 z-slide-in-from-top-4 absolute top-full left-0 z-50 mt-1 flex w-full flex-col gap-[0.1875rem] rounded-sm border p-1 shadow-md\">\n @for (item of filteredSuggestHistory(); track item; let i = $index) {\n <button\n type=\"button\"\n class=\"hover:bg-primary/10 hover:text-foreground flex w-full cursor-pointer items-center gap-2 rounded-sm px-2 py-1.5 text-left text-sm transition-colors\"\n [class.bg-primary/15]=\"suggestActiveIndex() === i\"\n [class.text-primary]=\"suggestActiveIndex() === i\"\n (mousedown)=\"selectSuggestItem(item)\">\n <z-icon zType=\"lucideClock\" zSize=\"14\" class=\"text-muted-foreground shrink-0\" />\n <span class=\"truncate\">{{ item }}</span>\n </button>\n }\n </div>\n }\n </div>\n }\n\n <ng-template #colorPickerPopover>\n <div class=\"z-input-color-picker\" [style.--z-input-color-picker-current]=\"normalizedColorValue()\">\n <div\n class=\"z-input-color-picker-plane\"\n [style]=\"colorPickerSvStyle()\"\n (pointerdown)=\"onColorPickerSvPointerDown($event)\"\n (pointermove)=\"onColorPickerSvPointerMove($event)\">\n <span class=\"z-input-color-picker-cursor\" [style]=\"colorPickerCursorStyle()\"></span>\n </div>\n\n <div class=\"z-input-color-picker-controls\">\n <button\n type=\"button\"\n z-button\n zType=\"outline\"\n zSize=\"sm\"\n aria-label=\"Pick color\"\n zTypeIcon=\"lucidePencil\"\n (click)=\"openNativeColorPicker()\"></button>\n <div class=\"z-input-color-picker-sliders\">\n <input\n type=\"range\"\n min=\"0\"\n max=\"360\"\n [ngModel]=\"colorPickerHsv().hue\"\n class=\"z-input-color-picker-hue\"\n (input)=\"onColorPickerHueInput($event)\" />\n <input\n type=\"range\"\n min=\"0\"\n max=\"100\"\n [ngModel]=\"colorPickerAlpha()\"\n class=\"z-input-color-picker-alpha\"\n (input)=\"onColorPickerAlphaInput($event)\" />\n </div>\n </div>\n\n <div class=\"flex flex-col gap-2\">\n <div class=\"z-input-color-picker-fields\">\n <z-select\n zSize=\"sm\"\n class=\"z-input-color-picker-format\"\n [zOptions]=\"colorPickerFormatOptions\"\n [zShowSearch]=\"false\"\n [zTranslateLabels]=\"false\"\n [ngModel]=\"colorPickerFormat()\"\n (ngModelChange)=\"onColorPickerFormatChange($event)\" />\n <div class=\"z-input-color-picker-value-group\">\n @switch (colorPickerFormat()) {\n @case ('rgb') {\n <div class=\"z-input-color-picker-channel-group\">\n <z-input\n zType=\"number\"\n zSize=\"sm\"\n zPlaceholder=\"R\"\n [zMin]=\"0\"\n [zMax]=\"255\"\n [zShowArrows]=\"false\"\n [ngModel]=\"colorPickerRgbValue().red\"\n (ngModelChange)=\"onColorPickerRgbChange('red', $event)\" />\n <z-input\n zType=\"number\"\n zSize=\"sm\"\n zPlaceholder=\"G\"\n [zMin]=\"0\"\n [zMax]=\"255\"\n [zShowArrows]=\"false\"\n [ngModel]=\"colorPickerRgbValue().green\"\n (ngModelChange)=\"onColorPickerRgbChange('green', $event)\" />\n <z-input\n zType=\"number\"\n zSize=\"sm\"\n zPlaceholder=\"B\"\n [zMin]=\"0\"\n [zMax]=\"255\"\n [zShowArrows]=\"false\"\n [ngModel]=\"colorPickerRgbValue().blue\"\n (ngModelChange)=\"onColorPickerRgbChange('blue', $event)\" />\n </div>\n }\n @case ('hsl') {\n <div class=\"z-input-color-picker-channel-group\">\n <z-input\n zType=\"number\"\n zSize=\"sm\"\n zPlaceholder=\"H\"\n [zMin]=\"0\"\n [zMax]=\"360\"\n [zShowArrows]=\"false\"\n [ngModel]=\"colorPickerHslValue().hue\"\n (ngModelChange)=\"onColorPickerHslChange('hue', $event)\" />\n <z-input\n zType=\"number\"\n zSize=\"sm\"\n zPlaceholder=\"S\"\n [zMin]=\"0\"\n [zMax]=\"100\"\n [zShowArrows]=\"false\"\n [ngModel]=\"colorPickerHslValue().saturation\"\n (ngModelChange)=\"onColorPickerHslChange('saturation', $event)\" />\n <z-input\n zType=\"number\"\n zSize=\"sm\"\n zPlaceholder=\"L\"\n [zMin]=\"0\"\n [zMax]=\"100\"\n [zShowArrows]=\"false\"\n [ngModel]=\"colorPickerHslValue().lightness\"\n (ngModelChange)=\"onColorPickerHslChange('lightness', $event)\" />\n </div>\n }\n @case ('hsv') {\n <div class=\"z-input-color-picker-channel-group\">\n <z-input\n zType=\"number\"\n zSize=\"sm\"\n zPlaceholder=\"H\"\n [zMin]=\"0\"\n [zMax]=\"360\"\n [zShowArrows]=\"false\"\n [ngModel]=\"colorPickerHsv().hue\"\n (ngModelChange)=\"onColorPickerHsvValueChange('hue', $event)\" />\n <z-input\n zType=\"number\"\n zSize=\"sm\"\n zPlaceholder=\"S\"\n [zMin]=\"0\"\n [zMax]=\"100\"\n [zShowArrows]=\"false\"\n [ngModel]=\"colorPickerHsv().saturation\"\n (ngModelChange)=\"onColorPickerHsvValueChange('saturation', $event)\" />\n <z-input\n zType=\"number\"\n zSize=\"sm\"\n zPlaceholder=\"V\"\n [zMin]=\"0\"\n [zMax]=\"100\"\n [zShowArrows]=\"false\"\n [ngModel]=\"colorPickerHsv().value\"\n (ngModelChange)=\"onColorPickerHsvValueChange('value', $event)\" />\n </div>\n }\n @default {\n <z-input\n zSize=\"sm\"\n class=\"z-input-color-picker-hex-input\"\n [ngModel]=\"normalizedColorValue()\"\n (ngModelChange)=\"onColorPickerHexChange($event)\" />\n }\n }\n <z-input\n zType=\"number\"\n zSize=\"sm\"\n class=\"z-input-color-picker-alpha-input\"\n [zMin]=\"0\"\n [zMax]=\"100\"\n zSuffix=\"%\"\n [zShowArrows]=\"false\"\n [ngModel]=\"colorPickerAlpha()\"\n (ngModelChange)=\"onColorPickerAlphaValueChange($event)\" />\n </div>\n </div>\n\n <div class=\"z-input-color-picker-saved-head\">\n <span>{{ 'i18n_z_ui_input_saved_colors' | translate }}</span>\n <button type=\"button\" z-button zType=\"ghost\" zSize=\"sm\" (click)=\"addCurrentColorToSaved()\">\n {{ 'i18n_z_ui_input_add_color' | translate }}\n </button>\n </div>\n <div class=\"z-input-color-picker-swatches\">\n @for (swatch of colorPickerSavedSwatches(); track swatch.color) {\n <button\n type=\"button\"\n class=\"z-input-color-picker-swatch rounded-[3px]!\"\n [class.z-input-color-picker-swatch-active]=\"swatch.color === normalizedColorValue()\"\n [class.z-input-color-picker-swatch-light]=\"swatch.isLight\"\n [style.--z-input-color-picker-swatch-color]=\"swatch.color\"\n [attr.aria-label]=\"swatch.color\"\n (click)=\"selectSavedColor(swatch.color)\"></button>\n }\n </div>\n </div>\n </div>\n </ng-template>\n\n @if (hasError()) {\n <p class=\"text-destructive animate-in fade-in slide-in-from-top-1 m-0 text-xs duration-200\">\n {{ errorMessage() }}\n </p>\n }\n</div>\n", styles: [".z-input-native{text-overflow:ellipsis;overflow:hidden}.z-input-native:-webkit-autofill,.z-input-native:-webkit-autofill:hover,.z-input-native:-webkit-autofill:focus,.z-input-native:-webkit-autofill:active{-webkit-box-shadow:0 0 0 1000px white inset!important;-webkit-text-fill-color:var(--color-foreground)!important;transition:background-color 9999s ease-in-out 0s!important;caret-color:var(--color-foreground)}:is(.dark,.dark *) .z-input-native:-webkit-autofill,:is(.dark,.dark *) .z-input-native:-webkit-autofill:hover,:is(.dark,.dark *) .z-input-native:-webkit-autofill:focus,:is(.dark,.dark *) .z-input-native:-webkit-autofill:active{-webkit-box-shadow:0 0 0 1000px var(--input-autofill) inset!important;transition:background-color 9999s ease-in-out 0s!important}textarea.z-input-native::-webkit-resizer{display:none}input[type=number].z-input-native::-webkit-inner-spin-button,input[type=number].z-input-native::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}input[type=number].z-input-native{-moz-appearance:textfield;appearance:textfield}input[type=color]{cursor:pointer}input[type=color]::-webkit-color-swatch-wrapper{padding:0}input[type=color]::-webkit-color-swatch{border:none;border-radius:var(--radius-sm)}input[type=color]::-moz-color-swatch{border:none;border-radius:var(--radius-sm)}.z-input-container{position:relative;overflow:visible}.z-input-container:has(.z-input-blossom .bcp-core[aria-expanded=true]){z-index:40}.z-input-blossom,.z-input-blossom .bcp-root{position:relative;z-index:41;overflow:visible}.z-input-blossom .bcp-container{z-index:42!important}.z-input-blossom .bcp-core{width:var(--z-bcp-core-size, 1.125rem)!important;height:var(--z-bcp-core-size, 1.125rem)!important;min-width:var(--z-bcp-core-size, 1.125rem)!important;min-height:var(--z-bcp-core-size, 1.125rem)!important;border-radius:var(--radius-xs, .125rem)!important;border:1px solid var(--z-bcp-core-border-color, rgba(0, 0, 0, .14))!important;box-shadow:none!important;transition:border-radius .18s cubic-bezier(.22,1,.36,1),border-color .16s ease,transform .18s cubic-bezier(.22,1,.36,1)!important}.z-input-blossom .bcp-core[aria-expanded=true]{border-radius:624.9375rem!important;border-color:transparent!important;box-shadow:0 3px 10px #00000029!important;transform:scale(1.03)!important}.z-input-blossom .bcp-core[aria-expanded=false]{transform:scale(1)!important}.z-input-color-trigger{display:block;width:var(--z-bcp-core-size, 1.625rem);height:var(--z-bcp-core-size, 1.625rem);align-self:center;cursor:pointer;border:1px solid var(--border);border-radius:var(--radius-xs, .125rem);box-shadow:none}.z-input-native-color{position:absolute;width:0;height:0;opacity:0;pointer-events:none}.z-input-color-picker-popover{padding:.75rem;border-radius:.5rem}.z-input-color-picker{display:flex;flex-direction:column;width:18.75rem;gap:.875rem}.z-input-color-picker-plane{position:relative;height:11.5rem;cursor:crosshair;border:1px solid var(--border);border-radius:.375rem;overflow:hidden}.z-input-color-picker-cursor{position:absolute;width:1.25rem;height:1.25rem;border:3px solid white;border-radius:999px;box-shadow:0 0 0 1px #0003;translate:-50% -50%;pointer-events:none}.z-input-color-picker-controls{display:grid;grid-template-columns:2.25rem minmax(0,1fr);align-items:center;gap:.5rem}.z-input-color-picker-sliders{display:flex;min-width:0;flex-direction:column;gap:.375rem}.z-input-color-picker-hue,.z-input-color-picker-alpha{width:100%;height:.625rem;cursor:pointer;appearance:none;border-radius:999px}.z-input-color-picker-hue{background:linear-gradient(to right,red,#ff0,#0f0,#0ff,#00f,#f0f,red)}.z-input-color-picker-alpha{background:linear-gradient(to right,transparent,var(--z-input-color-picker-current, var(--primary))),conic-gradient(#d1d5db 25%,#fff 0 50%,#d1d5db 0 75%,#fff 0);background-position:0 0,0 0;background-size:auto,.5rem .5rem}.z-input-color-picker-hue::-webkit-slider-thumb,.z-input-color-picker-alpha::-webkit-slider-thumb{width:1rem;height:1rem;appearance:none;border:3px solid white;border-radius:999px;background:var(--primary);box-shadow:0 1px 4px #0000004d}.z-input-color-picker-fields{display:grid;grid-template-columns:5.2rem minmax(0,1fr);gap:.5rem}.z-input-color-picker-format .z-select-trigger{min-height:2rem}.z-input-color-picker-value-group{display:grid;grid-template-columns:minmax(0,1fr) 3.85rem;min-width:0}.z-input-color-picker-value-group .z-input-wrapper{gap:0}.z-input-color-picker-value-group .z-input-container{min-height:2rem;border-radius:0}.z-input-color-picker-value-group>z-input:first-child .z-input-container,.z-input-color-picker-value-group>.z-input-color-picker-channel-group:first-child z-input:first-child .z-input-container{border-top-left-radius:var(--radius-sm, .25rem);border-bottom-left-radius:var(--radius-sm, .25rem)}.z-input-color-picker-value-group>z-input:last-child .z-input-container{border-left-width:0;border-top-right-radius:var(--radius-sm, .25rem);border-bottom-right-radius:var(--radius-sm, .25rem)}.z-input-color-picker-value-group .z-input-container:focus-within{position:relative;z-index:1;border-left-width:1px}.z-input-color-picker-hex-input .z-input-native{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace}.z-input-color-picker-channel-group{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));min-width:0}.z-input-color-picker-channel-group z-input:not(:first-child) .z-input-container{border-left-width:0}.z-input-color-picker-channel-group .z-input-native,.z-input-color-picker-alpha-input .z-input-native{text-align:center}.z-input-color-picker-saved-head{display:flex;align-items:center;justify-content:space-between;font-size:.875rem;font-weight:400}.z-input-color-picker-saved-head .z-button{height:1.75rem;padding-inline:.25rem;font-weight:400}.z-input-color-picker-swatches{display:flex;justify-content:space-between;gap:.375rem}.z-input-color-picker-swatch{width:1.75rem;height:1.75rem;cursor:pointer;border:0;border-radius:var(--radius-sm);background:var(--z-input-color-picker-swatch-color)}.z-input-color-picker-swatch-light{background:linear-gradient(var(--z-input-color-picker-swatch-color),var(--z-input-color-picker-swatch-color)),conic-gradient(#d1d5db 25%,#fff 0 50%,#d1d5db 0 75%,#fff 0);background-size:auto,.5rem .5rem;box-shadow:inset 0 0 0 1px #00000029}.z-input-color-picker-swatch-active{box-shadow:0 0 0 2px var(--background),0 0 0 4px var(--primary)}.z-input-color-picker-swatch-light.z-input-color-picker-swatch-active{box-shadow:inset 0 0 0 1px #00000029,0 0 0 2px var(--background),0 0 0 4px var(--primary)}\n"], dependencies: [{ kind: "component", type: i0.forwardRef(() => ZInputComponent), selector: "z-input", inputs: ["class", "zType", "zSize", "zAlign", "zLabel", "zLabelClass", "zPlaceholder", "zRequired", "zDisabled", "zReadonly", "zPrefix", "zSuffix", "zMin", "zMax", "zStep", "zShowArrows", "zMask", "zDecimalPlaces", "zAllowNegative", "zThousandSeparator", "zDecimalMarker", "zValidators", "zAsyncValidators", "zAsyncDebounce", "zAsyncValidateOn", "zShowPasswordToggle", "zSearch", "zDebounce", "zAutofocus", "zAutoComplete", "zAllowClear", "zAutoSizeContent", "zRows", "zResize", "zMaxLength", "zAutoSuggest", "zColorConfig"], outputs: ["zOnSearch", "zOnChange", "zOnBlur", "zOnFocus", "zOnKeydown", "zOnEnter", "zOnColorCollapse", "zControl", "zEvent"], exportAs: ["zInput"] }, { kind: "component", type: i0.forwardRef(() => BlossomColorPickerComponent), selector: "blossom-color-picker", inputs: ["value", "defaultValue", "colors", "disabled", "openOnHover", "initialExpanded", "animationDuration", "showAlphaSlider", "coreSize", "petalSize", "showCoreColor", "sliderPosition", "adaptivePositioning", "circularBarWidth", "sliderWidth", "sliderOffset", "collapsible"], outputs: ["colorChange", "colorCollapse"] }, { kind: "ngmodule", type: i0.forwardRef(() => FormsModule) }, { kind: "directive", type: i0.forwardRef(() => 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: i0.forwardRef(() => i1.RangeValueAccessor), selector: "input[type=range][formControlName],input[type=range][formControl],input[type=range][ngModel]" }, { kind: "directive", type: i0.forwardRef(() => i1.NgControlStatus), selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i0.forwardRef(() => i1.NgModel), selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: i0.forwardRef(() => ReactiveFormsModule) }, { kind: "directive", type: i0.forwardRef(() => NgxMaskDirective), selector: "input[mask], textarea[mask]", inputs: ["mask", "specialCharacters", "patterns", "prefix", "suffix", "thousandSeparator", "decimalMarker", "dropSpecialCharacters", "hiddenInput", "showMaskTyped", "placeHolderCharacter", "shownMaskExpression", "clearIfNotMatch", "validation", "separatorLimit", "allowNegativeNumbers", "leadZeroDateTime", "leadZero", "triggerOnMaskChange", "apm", "inputTransformFn", "outputTransformFn", "keepCharacterPositions", "instantPrefix"], outputs: ["maskFilled"], exportAs: ["mask", "ngxMask"] }, { kind: "component", type: i0.forwardRef(() => ZButtonComponent), selector: "z-button, button[z-button], a[z-button]", inputs: ["class", "zType", "zSize", "zShape", "zLabel", "zLoading", "zDisabled", "zTypeIcon", "zSizeIcon", "zStrokeWidthIcon", "zWave"], exportAs: ["zButton"] }, { kind: "component", type: i0.forwardRef(() => ZIconComponent), selector: "z-icon, [z-icon]", inputs: ["class", "zType", "zSize", "zStrokeWidth", "zSvg"] }, { kind: "directive", type: i0.forwardRef(() => ZPopoverDirective), selector: "[z-popover]", inputs: ["zPopoverContent", "zPosition", "zTrigger", "zClass", "zShowDelay", "zHideDelay", "zDisabled", "zOffset", "zPopoverWidth", "zManualClose", "zScrollClose", "zShowArrow"], outputs: ["zShow", "zHide", "zHideStart", "zControl", "zPositionChange"], exportAs: ["zPopover"] }, { kind: "component", type: i0.forwardRef(() => ZSelectComponent), selector: "z-select", inputs: ["class", "zMode", "zSize", "zLabel", "zLabelClass", "zPlaceholder", "zRequired", "zDisabled", "zReadonly", "zLoading", "zPrefix", "zAllowClear", "zWrap", "zShowSearch", "zPlaceholderSearch", "zDebounce", "zNotFoundText", "zEmptyText", "zEmptyIcon", "zMaxTagCount", "zDropdownMaxHeight", "zOptionHeight", "zVirtualScroll", "zShowAction", "zOptions", "zConfig", "zTranslateLabels", "zKey", "zSearchServer", "zLoadingMore", "zEnableLoadMore", "zScrollDistance", "zMaxVisible", "zScrollClose", "zPosition", "zSelectedTemplate", "zOptionTemplate", "zActionTemplate", "zAsyncValidators", "zAsyncDebounce", "zAsyncValidateOn", "zValidators"], outputs: ["zOnSearch", "zOnLoadMore", "zOnBlur", "zOnFocus", "zControl", "zEvent"], exportAs: ["zSelect"] }, { kind: "directive", type: i0.forwardRef(() => NgTemplateOutlet), selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "pipe", type: i0.forwardRef(() => TranslatePipe), name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
938
1374
|
}
|
|
939
1375
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.9", ngImport: i0, type: ZInputComponent, decorators: [{
|
|
940
1376
|
type: Component,
|
|
@@ -943,9 +1379,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.9", ngImpor
|
|
|
943
1379
|
FormsModule,
|
|
944
1380
|
ReactiveFormsModule,
|
|
945
1381
|
NgxMaskDirective,
|
|
1382
|
+
ZButtonComponent,
|
|
946
1383
|
ZIconComponent,
|
|
1384
|
+
ZPopoverDirective,
|
|
1385
|
+
ZSelectComponent,
|
|
947
1386
|
NgTemplateOutlet,
|
|
948
1387
|
TranslatePipe,
|
|
1388
|
+
forwardRef(() => ZInputComponent),
|
|
949
1389
|
], standalone: true, providers: [
|
|
950
1390
|
provideNgxMask(),
|
|
951
1391
|
{
|
|
@@ -953,8 +1393,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.9", ngImpor
|
|
|
953
1393
|
useExisting: forwardRef(() => ZInputComponent),
|
|
954
1394
|
multi: true,
|
|
955
1395
|
},
|
|
956
|
-
], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, exportAs: 'zInput', template: "<div class=\"z-input-wrapper flex w-full flex-col gap-2\">\n @if (zLabel()) {\n <label [for]=\"inputId\" class=\"text-xs leading-none font-medium\" [class]=\"zLabelClass()\">\n {{ zLabel() | translate }}\n @if (zRequired()) {\n <span class=\"text-destructive! ml-0.5\">*</span>\n }\n </label>\n }\n\n @if (typeConfig().isTextarea) {\n <div class=\"relative w-full\" [class]=\"textareaClasses()\" [class.overflow-auto]=\"zAutoSizeContent()\">\n <textarea\n #inputEl\n [id]=\"inputId\"\n [placeholder]=\"zPlaceholder() | translate\"\n class=\"z-input-native placeholder:text-muted-foreground m-0 block min-h-14 w-full resize-none bg-transparent p-2 text-sm outline-none\"\n [class.resize-y]=\"zResize() && !isDisabled() && !zReadonly()\"\n [class.field-sizing-content]=\"zAutoSizeContent()\"\n [disabled]=\"isDisabled()\"\n [readonly]=\"zReadonly()\"\n [autocomplete]=\"zAutoComplete()\"\n [rows]=\"zRows()\"\n [attr.maxlength]=\"zMaxLength()\"\n [ngModel]=\"displayValue()\"\n (ngModelChange)=\"onModelChange($event)\"\n (blur)=\"onBlur($event)\"\n (focus)=\"onFocus($event)\"\n (keydown)=\"onKeydown($event)\"></textarea>\n @if (zMaxLength()) {\n <div class=\"flex justify-end pr-1 pb-1\">\n <span class=\"text-muted-foreground text-xs\">{{ displayValue().length }} / {{ zMaxLength() }}</span>\n </div>\n }\n @if (zResize() && !isDisabled() && !zReadonly() && !zMaxLength()) {\n <svg\n class=\"text-muted-foreground pointer-events-none absolute right-0.5 bottom-0.5 opacity-40\"\n width=\"12\"\n height=\"12\"\n viewBox=\"0 0 12 12\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"1.5\">\n <path d=\"M10 2L2 10\" />\n <path d=\"M10 6L6 10\" />\n </svg>\n }\n </div>\n } @else {\n <div class=\"relative w-full\">\n <div class=\"z-input-container flex w-full items-center\" [class]=\"inputClasses()\">\n <!-- Color picker square (prefix for color type) -->\n @if (typeConfig().isColor) {\n <div class=\"z-[10] shrink-0\">\n <blossom-color-picker\n class=\"z-input-blossom flex items-center justify-center [&>div:first-child]:flex\"\n [style.--z-bcp-core-size.px]=\"blossomOptions().coreSize\"\n [style.--z-bcp-core-border-color]=\"blossomCoreBorderColor()\"\n [value]=\"blossomColor()\"\n [defaultValue]=\"blossomOptions().defaultValue\"\n [colors]=\"blossomColors()\"\n [disabled]=\"isDisabled() || zReadonly()\"\n [openOnHover]=\"blossomOptions().openOnHover\"\n [initialExpanded]=\"blossomOptions().initialExpanded\"\n [animationDuration]=\"blossomOptions().animationDuration\"\n [showAlphaSlider]=\"blossomOptions().showAlphaSlider\"\n [coreSize]=\"blossomOptions().coreSize\"\n [petalSize]=\"blossomOptions().petalSize\"\n [showCoreColor]=\"blossomOptions().showCoreColor\"\n [sliderPosition]=\"blossomOptions().sliderPosition\"\n [adaptivePositioning]=\"blossomOptions().adaptivePositioning\"\n (colorChange)=\"onBlossomColorChange($event)\"\n (colorCollapse)=\"onBlossomColorCollapse($event)\" />\n </div>\n }\n\n @if (slotConfig().hasPrefix && !typeConfig().isColor) {\n <div class=\"text-muted-foreground left-3 flex items-center justify-center\">\n @if (zSearch()) {\n <z-icon zType=\"lucideSearch\" zSize=\"16\" />\n } @else if (slotConfig().isPrefixTemplate) {\n <ng-container *ngTemplateOutlet=\"$any(zPrefix())\" />\n } @else {\n {{ zPrefix() }}\n }\n </div>\n }\n\n <input\n #inputEl\n [id]=\"inputId\"\n [type]=\"typeConfig().isColor ? 'text' : maskConfig().effectiveType\"\n [placeholder]=\"zPlaceholder() | translate\"\n class=\"z-input-native placeholder:text-muted-foreground h-full min-w-0 flex-1 bg-transparent text-sm outline-none\"\n [disabled]=\"isDisabled()\"\n [readonly]=\"typeConfig().isColor ? true : zReadonly()\"\n [attr.min]=\"zMin()\"\n [attr.max]=\"zMax()\"\n [attr.step]=\"zStep()\"\n [autocomplete]=\"zAutoComplete()\"\n [ngModel]=\"typeConfig().isColor ? normalizedColorValue() : displayValue()\"\n (ngModelChange)=\"onModelChange($event)\"\n (blur)=\"onBlur($event)\"\n (focus)=\"onFocus($event)\"\n (keydown)=\"onKeydown($event); onSuggestKeydown($event)\"\n [mask]=\"maskConfig().effectiveMask\"\n [thousandSeparator]=\"zThousandSeparator()\"\n [decimalMarker]=\"maskConfig().effectiveDecimalMarker\"\n [allowNegativeNumbers]=\"zAllowNegative()\"\n [dropSpecialCharacters]=\"false\" />\n\n @if (slotConfig().hasSuffix && !typeConfig().isColor) {\n <div class=\"text-muted-foreground flex items-center justify-center text-sm\">\n @if (slotConfig().isSuffixTemplate) {\n <ng-container *ngTemplateOutlet=\"$any(zSuffix())\" />\n } @else {\n {{ zSuffix() }}\n }\n </div>\n }\n\n <!-- Async validation loading indicator -->\n @if (isValidating()) {\n <div class=\"text-muted-foreground flex items-center justify-center\">\n <z-icon zType=\"lucideLoader2\" zSize=\"16\" class=\"animate-spin\" />\n </div>\n }\n\n <!-- Clear button -->\n @if (showClearButton()) {\n <button\n type=\"button\"\n tabindex=\"-1\"\n class=\"text-muted-foreground hover:text-foreground flex size-5 shrink-0 cursor-pointer items-center justify-center rounded-sm transition-colors\"\n (mousedown)=\"$event.preventDefault()\"\n (click)=\"clearValue($event)\">\n <z-icon zType=\"lucideX\" zSize=\"14\" />\n </button>\n }\n\n <!-- Copy button for color type -->\n @if (typeConfig().isColor) {\n <button\n type=\"button\"\n tabindex=\"-1\"\n class=\"text-muted-foreground hover:text-foreground hover:bg-accent flex size-6 shrink-0 cursor-pointer items-center justify-center rounded-sm transition-all\"\n (mousedown)=\"$event.preventDefault()\"\n (click)=\"copyColorToClipboard()\">\n <span class=\"relative flex size-4 items-center justify-center\">\n <z-icon\n zType=\"lucideCopy\"\n [class]=\"uiState().colorCopied ? 'scale-0 rotate-90 opacity-0' : 'scale-100 rotate-0 opacity-100'\"\n class=\"absolute transition-all duration-200 ease-out\"\n zSize=\"14\" />\n <z-icon\n zType=\"lucideCheck\"\n [class]=\"\n uiState().colorCopied ? 'text-success scale-100 rotate-0 opacity-100' : 'scale-0 -rotate-90 opacity-0'\n \"\n class=\"absolute transition-all duration-200 ease-out\"\n zSize=\"14\" />\n </span>\n </button>\n }\n\n @if (showArrows() && !isDisabled()) {\n <div class=\"-mr-1 flex h-[calc(100%-0.25rem)] shrink-0 flex-col\">\n <button\n type=\"button\"\n tabindex=\"-1\"\n class=\"text-muted-foreground hover:bg-accent hover:text-foreground flex w-5 flex-1 cursor-pointer items-center justify-center rounded-sm transition-all\"\n (mousedown)=\"$event.preventDefault()\"\n (click)=\"onArrowClick($event, 'up')\">\n <z-icon zType=\"lucideChevronUp\" zSize=\"12\" />\n </button>\n <button\n type=\"button\"\n tabindex=\"-1\"\n class=\"text-muted-foreground hover:bg-accent hover:text-foreground flex w-5 flex-1 cursor-pointer items-center justify-center rounded-sm transition-all\"\n (mousedown)=\"$event.preventDefault()\"\n (click)=\"onArrowClick($event, 'down')\">\n <z-icon zType=\"lucideChevronDown\" zSize=\"12\" />\n </button>\n </div>\n }\n\n @if (typeConfig().isPassword && zShowPasswordToggle()) {\n <button\n type=\"button\"\n tabindex=\"-1\"\n class=\"text-muted-foreground hover:text-foreground flex size-6 shrink-0 cursor-pointer items-center justify-center rounded-sm transition-all\"\n (mousedown)=\"$event.preventDefault()\"\n (click)=\"togglePasswordVisibility()\">\n @if (uiState().passwordVisible) {\n <z-icon zType=\"lucideEyeOff\" zSize=\"16\" />\n } @else {\n <z-icon zType=\"lucideEye\" zSize=\"16\" />\n }\n </button>\n }\n </div>\n\n @if (hasAutoSuggest() && uiState().showSuggestPopover && suggestHistory().length > 0) {\n <div\n class=\"bg-popover text-popover-foreground border-border z-animate-in z-fade-in z-duration-200 z-slide-in-from-top-4 absolute top-full left-0 z-50 mt-1 flex w-full flex-col gap-[0.1875rem] rounded-sm border p-1 shadow-md\">\n @for (item of filteredSuggestHistory(); track item; let i = $index) {\n <button\n type=\"button\"\n class=\"hover:bg-primary/10 hover:text-foreground flex w-full cursor-pointer items-center gap-2 rounded-sm px-2 py-1.5 text-left text-sm transition-colors\"\n [class.bg-primary/15]=\"suggestActiveIndex() === i\"\n [class.text-primary]=\"suggestActiveIndex() === i\"\n (mousedown)=\"selectSuggestItem(item)\">\n <z-icon zType=\"lucideClock\" zSize=\"14\" class=\"text-muted-foreground shrink-0\" />\n <span class=\"truncate\">{{ item }}</span>\n </button>\n }\n </div>\n }\n </div>\n }\n\n @if (hasError()) {\n <p class=\"text-destructive animate-in fade-in slide-in-from-top-1 m-0 text-xs duration-200\">\n {{ errorMessage() }}\n </p>\n }\n</div>\n", styles: [".z-input-native{text-overflow:ellipsis;overflow:hidden}.z-input-native:-webkit-autofill,.z-input-native:-webkit-autofill:hover,.z-input-native:-webkit-autofill:focus,.z-input-native:-webkit-autofill:active{-webkit-box-shadow:0 0 0 1000px white inset!important;-webkit-text-fill-color:var(--color-foreground)!important;transition:background-color 9999s ease-in-out 0s!important;caret-color:var(--color-foreground)}:is(.dark,.dark *) .z-input-native:-webkit-autofill,:is(.dark,.dark *) .z-input-native:-webkit-autofill:hover,:is(.dark,.dark *) .z-input-native:-webkit-autofill:focus,:is(.dark,.dark *) .z-input-native:-webkit-autofill:active{-webkit-box-shadow:0 0 0 1000px var(--input-autofill) inset!important;transition:background-color 9999s ease-in-out 0s!important}textarea.z-input-native::-webkit-resizer{display:none}input[type=number].z-input-native::-webkit-inner-spin-button,input[type=number].z-input-native::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}input[type=number].z-input-native{-moz-appearance:textfield;appearance:textfield}input[type=color]{cursor:pointer}input[type=color]::-webkit-color-swatch-wrapper{padding:0}input[type=color]::-webkit-color-swatch{border:none;border-radius:var(--radius-sm)}input[type=color]::-moz-color-swatch{border:none;border-radius:var(--radius-sm)}.z-input-container{position:relative;overflow:visible}.z-input-container:has(.z-input-blossom .bcp-core[aria-expanded=true]){z-index:40}.z-input-blossom,.z-input-blossom .bcp-root{position:relative;z-index:41;overflow:visible}.z-input-blossom .bcp-container{z-index:42!important}.z-input-blossom .bcp-core{width:var(--z-bcp-core-size, 1.125rem)!important;height:var(--z-bcp-core-size, 1.125rem)!important;min-width:var(--z-bcp-core-size, 1.125rem)!important;min-height:var(--z-bcp-core-size, 1.125rem)!important;border-radius:var(--radius-xs, .125rem)!important;border:1px solid var(--z-bcp-core-border-color, rgba(0, 0, 0, .14))!important;box-shadow:none!important;transition:border-radius .18s cubic-bezier(.22,1,.36,1),border-color .16s ease,transform .18s cubic-bezier(.22,1,.36,1)!important}.z-input-blossom .bcp-core[aria-expanded=true]{border-radius:624.9375rem!important;border-color:transparent!important;box-shadow:0 3px 10px #00000029!important;transform:scale(1.03)!important}.z-input-blossom .bcp-core[aria-expanded=false]{transform:scale(1)!important}\n"] }]
|
|
957
|
-
}], propDecorators: { inputRef: [{ type: i0.ViewChild, args: ['inputEl', { isSignal: true }] }], zOnSearch: [{ type: i0.Output, args: ["zOnSearch"] }], zOnChange: [{ type: i0.Output, args: ["zOnChange"] }], zOnBlur: [{ type: i0.Output, args: ["zOnBlur"] }], zOnFocus: [{ type: i0.Output, args: ["zOnFocus"] }], zOnKeydown: [{ type: i0.Output, args: ["zOnKeydown"] }], zOnEnter: [{ type: i0.Output, args: ["zOnEnter"] }], zOnColorCollapse: [{ type: i0.Output, args: ["zOnColorCollapse"] }], zControl: [{ type: i0.Output, args: ["zControl"] }], zEvent: [{ type: i0.Output, args: ["zEvent"] }], class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], zType: [{ type: i0.Input, args: [{ isSignal: true, alias: "zType", required: false }] }], zSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "zSize", required: false }] }], zAlign: [{ type: i0.Input, args: [{ isSignal: true, alias: "zAlign", required: false }] }], zLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "zLabel", required: false }] }], zLabelClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "zLabelClass", required: false }] }], zPlaceholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "zPlaceholder", required: false }] }], zRequired: [{ type: i0.Input, args: [{ isSignal: true, alias: "zRequired", required: false }] }], zDisabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "zDisabled", required: false }] }], zReadonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "zReadonly", required: false }] }], zPrefix: [{ type: i0.Input, args: [{ isSignal: true, alias: "zPrefix", required: false }] }], zSuffix: [{ type: i0.Input, args: [{ isSignal: true, alias: "zSuffix", required: false }] }], zMin: [{ type: i0.Input, args: [{ isSignal: true, alias: "zMin", required: false }] }], zMax: [{ type: i0.Input, args: [{ isSignal: true, alias: "zMax", required: false }] }], zStep: [{ type: i0.Input, args: [{ isSignal: true, alias: "zStep", required: false }] }], zShowArrows: [{ type: i0.Input, args: [{ isSignal: true, alias: "zShowArrows", required: false }] }], zMask: [{ type: i0.Input, args: [{ isSignal: true, alias: "zMask", required: false }] }], zDecimalPlaces: [{ type: i0.Input, args: [{ isSignal: true, alias: "zDecimalPlaces", required: false }] }], zAllowNegative: [{ type: i0.Input, args: [{ isSignal: true, alias: "zAllowNegative", required: false }] }], zThousandSeparator: [{ type: i0.Input, args: [{ isSignal: true, alias: "zThousandSeparator", required: false }] }], zDecimalMarker: [{ type: i0.Input, args: [{ isSignal: true, alias: "zDecimalMarker", required: false }] }], zValidators: [{ type: i0.Input, args: [{ isSignal: true, alias: "zValidators", required: false }] }], zAsyncValidators: [{ type: i0.Input, args: [{ isSignal: true, alias: "zAsyncValidators", required: false }] }], zAsyncDebounce: [{ type: i0.Input, args: [{ isSignal: true, alias: "zAsyncDebounce", required: false }] }], zAsyncValidateOn: [{ type: i0.Input, args: [{ isSignal: true, alias: "zAsyncValidateOn", required: false }] }], zShowPasswordToggle: [{ type: i0.Input, args: [{ isSignal: true, alias: "zShowPasswordToggle", required: false }] }], zSearch: [{ type: i0.Input, args: [{ isSignal: true, alias: "zSearch", required: false }] }], zDebounce: [{ type: i0.Input, args: [{ isSignal: true, alias: "zDebounce", required: false }] }], zAutofocus: [{ type: i0.Input, args: [{ isSignal: true, alias: "zAutofocus", required: false }] }], zAutoComplete: [{ type: i0.Input, args: [{ isSignal: true, alias: "zAutoComplete", required: false }] }], zAllowClear: [{ type: i0.Input, args: [{ isSignal: true, alias: "zAllowClear", required: false }] }], zAutoSizeContent: [{ type: i0.Input, args: [{ isSignal: true, alias: "zAutoSizeContent", required: false }] }], zRows: [{ type: i0.Input, args: [{ isSignal: true, alias: "zRows", required: false }] }], zResize: [{ type: i0.Input, args: [{ isSignal: true, alias: "zResize", required: false }] }], zMaxLength: [{ type: i0.Input, args: [{ isSignal: true, alias: "zMaxLength", required: false }] }], zAutoSuggest: [{ type: i0.Input, args: [{ isSignal: true, alias: "zAutoSuggest", required: false }] }], zColorConfig: [{ type: i0.Input, args: [{ isSignal: true, alias: "zColorConfig", required: false }] }] } });
|
|
1396
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, exportAs: 'zInput', template: "<div class=\"z-input-wrapper flex w-full flex-col gap-2\">\n @if (zLabel()) {\n <label [for]=\"inputId\" class=\"text-xs leading-none font-medium\" [class]=\"zLabelClass()\">\n {{ zLabel() | translate }}\n @if (zRequired()) {\n <span class=\"text-destructive! ml-0.5\">*</span>\n }\n </label>\n }\n\n @if (typeConfig().isTextarea) {\n <div class=\"relative w-full\" [class]=\"textareaClasses()\" [class.overflow-auto]=\"zAutoSizeContent()\">\n <textarea\n #inputEl\n [id]=\"inputId\"\n [placeholder]=\"zPlaceholder() | translate\"\n class=\"z-input-native placeholder:text-muted-foreground m-0 block min-h-14 w-full resize-none bg-transparent p-2 text-sm outline-none\"\n [class.resize-y]=\"zResize() && !isDisabled() && !zReadonly()\"\n [class.field-sizing-content]=\"zAutoSizeContent()\"\n [disabled]=\"isDisabled()\"\n [readonly]=\"zReadonly()\"\n [autocomplete]=\"zAutoComplete()\"\n [rows]=\"zRows()\"\n [attr.maxlength]=\"zMaxLength()\"\n [ngModel]=\"displayValue()\"\n (ngModelChange)=\"onModelChange($event)\"\n (blur)=\"onBlur($event)\"\n (focus)=\"onFocus($event)\"\n (keydown)=\"onKeydown($event)\"></textarea>\n @if (zMaxLength()) {\n <div class=\"flex justify-end pr-1 pb-1\">\n <span class=\"text-muted-foreground text-xs\">{{ displayValue().length }} / {{ zMaxLength() }}</span>\n </div>\n }\n @if (zResize() && !isDisabled() && !zReadonly() && !zMaxLength()) {\n <svg\n class=\"text-muted-foreground pointer-events-none absolute right-0.5 bottom-0.5 opacity-40\"\n width=\"12\"\n height=\"12\"\n viewBox=\"0 0 12 12\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"1.5\">\n <path d=\"M10 2L2 10\" />\n <path d=\"M10 6L6 10\" />\n </svg>\n }\n </div>\n } @else {\n <div class=\"relative w-full\">\n <div class=\"z-input-container flex w-full items-center\" [class]=\"inputClasses()\">\n <!-- Color picker square (prefix for color type) -->\n @if (typeConfig().isColor) {\n <div class=\"z-[10] shrink-0\">\n @if (isBlossomColorMode()) {\n <blossom-color-picker\n class=\"z-input-blossom flex items-center justify-center [&>div:first-child]:flex\"\n [style.--z-bcp-core-size.px]=\"blossomOptions().coreSize\"\n [style.--z-bcp-core-border-color]=\"blossomCoreBorderColor()\"\n [value]=\"blossomColor()\"\n [defaultValue]=\"blossomOptions().defaultValue\"\n [colors]=\"blossomColors()\"\n [disabled]=\"isDisabled() || zReadonly()\"\n [openOnHover]=\"blossomOptions().openOnHover\"\n [initialExpanded]=\"blossomOptions().initialExpanded\"\n [animationDuration]=\"blossomOptions().animationDuration\"\n [showAlphaSlider]=\"blossomOptions().showAlphaSlider\"\n [coreSize]=\"blossomOptions().coreSize\"\n [petalSize]=\"blossomOptions().petalSize\"\n [showCoreColor]=\"blossomOptions().showCoreColor\"\n [sliderPosition]=\"blossomOptions().sliderPosition\"\n [adaptivePositioning]=\"blossomOptions().adaptivePositioning\"\n (colorChange)=\"onBlossomColorChange($event)\"\n (colorCollapse)=\"onBlossomColorCollapse($event)\" />\n } @else {\n <button\n type=\"button\"\n class=\"z-input-color-trigger\"\n z-popover\n [zPopoverContent]=\"colorPickerPopover\"\n zTrigger=\"click\"\n zPosition=\"bottom-left\"\n zClass=\"z-input-color-picker-popover\"\n [zOffset]=\"8\"\n [zPopoverWidth]=\"330\"\n [zDisabled]=\"isDisabled() || zReadonly()\"\n [style.--z-bcp-core-size.px]=\"blossomOptions().coreSize\"\n [style.background]=\"normalizedColorValue()\"\n (zControl)=\"onColorPickerControl($event)\"\n (zShow)=\"onColorPickerOpen()\"\n (mousedown)=\"$event.preventDefault()\"\n [attr.aria-label]=\"'Color picker'\"></button>\n }\n </div>\n }\n\n @if (slotConfig().hasPrefix && !typeConfig().isColor) {\n <div class=\"text-muted-foreground left-3 flex items-center justify-center\">\n @if (zSearch()) {\n <z-icon zType=\"lucideSearch\" zSize=\"16\" />\n } @else if (slotConfig().isPrefixTemplate) {\n <ng-container *ngTemplateOutlet=\"$any(zPrefix())\" />\n } @else {\n {{ zPrefix() }}\n }\n </div>\n }\n\n <input\n #inputEl\n [id]=\"inputId\"\n [type]=\"typeConfig().isColor ? 'text' : maskConfig().effectiveType\"\n [placeholder]=\"zPlaceholder() | translate\"\n class=\"z-input-native placeholder:text-muted-foreground h-full min-w-0 flex-1 bg-transparent text-sm outline-none\"\n [disabled]=\"isDisabled()\"\n [readonly]=\"typeConfig().isColor ? true : zReadonly()\"\n [attr.min]=\"zMin()\"\n [attr.max]=\"zMax()\"\n [attr.step]=\"zStep()\"\n [autocomplete]=\"zAutoComplete()\"\n [ngModel]=\"typeConfig().isColor ? normalizedColorValue() : displayValue()\"\n (ngModelChange)=\"onModelChange($event)\"\n (blur)=\"onBlur($event)\"\n (focus)=\"onFocus($event)\"\n (keydown)=\"onKeydown($event); onSuggestKeydown($event)\"\n [mask]=\"maskConfig().effectiveMask\"\n [thousandSeparator]=\"zThousandSeparator()\"\n [decimalMarker]=\"maskConfig().effectiveDecimalMarker\"\n [allowNegativeNumbers]=\"zAllowNegative()\"\n [dropSpecialCharacters]=\"false\" />\n\n @if (slotConfig().hasSuffix && !typeConfig().isColor) {\n <div class=\"text-muted-foreground flex items-center justify-center text-sm\">\n @if (slotConfig().isSuffixTemplate) {\n <ng-container *ngTemplateOutlet=\"$any(zSuffix())\" />\n } @else {\n {{ zSuffix() }}\n }\n </div>\n }\n\n <!-- Async validation loading indicator -->\n @if (isValidating()) {\n <div class=\"text-muted-foreground flex items-center justify-center\">\n <z-icon zType=\"lucideLoader2\" zSize=\"16\" class=\"animate-spin\" />\n </div>\n }\n\n <!-- Clear button -->\n @if (showClearButton()) {\n <button\n type=\"button\"\n tabindex=\"-1\"\n class=\"text-muted-foreground hover:text-foreground flex size-5 shrink-0 cursor-pointer items-center justify-center rounded-sm transition-colors\"\n (mousedown)=\"$event.preventDefault()\"\n (click)=\"clearValue($event)\">\n <z-icon zType=\"lucideX\" zSize=\"14\" />\n </button>\n }\n\n <!-- Copy button for color type -->\n @if (typeConfig().isColor) {\n <input\n #nativeColorInputEl\n type=\"color\"\n class=\"z-input-native-color\"\n [ngModel]=\"normalizedColorValue()\"\n (ngModelChange)=\"onColorPickerHexChange($event)\"\n tabindex=\"-1\"\n aria-hidden=\"true\" />\n\n <button\n type=\"button\"\n tabindex=\"-1\"\n class=\"text-muted-foreground hover:text-foreground hover:bg-accent flex size-6 shrink-0 cursor-pointer items-center justify-center rounded-sm transition-all\"\n (mousedown)=\"$event.preventDefault()\"\n (click)=\"copyColorToClipboard()\">\n <span class=\"relative flex size-4 items-center justify-center\">\n <z-icon\n zType=\"lucideCopy\"\n [class]=\"uiState().colorCopied ? 'scale-0 rotate-90 opacity-0' : 'scale-100 rotate-0 opacity-100'\"\n class=\"absolute transition-all duration-200 ease-out\"\n zSize=\"14\" />\n <z-icon\n zType=\"lucideCheck\"\n [class]=\"\n uiState().colorCopied ? 'text-success scale-100 rotate-0 opacity-100' : 'scale-0 -rotate-90 opacity-0'\n \"\n class=\"absolute transition-all duration-200 ease-out\"\n zSize=\"14\" />\n </span>\n </button>\n }\n\n @if (showArrows() && !isDisabled()) {\n <div class=\"-mr-1 flex h-[calc(100%-0.25rem)] shrink-0 flex-col\">\n <button\n type=\"button\"\n tabindex=\"-1\"\n class=\"text-muted-foreground hover:bg-accent hover:text-foreground flex w-5 flex-1 cursor-pointer items-center justify-center rounded-sm transition-all\"\n (mousedown)=\"$event.preventDefault()\"\n (click)=\"onArrowClick($event, 'up')\">\n <z-icon zType=\"lucideChevronUp\" zSize=\"12\" />\n </button>\n <button\n type=\"button\"\n tabindex=\"-1\"\n class=\"text-muted-foreground hover:bg-accent hover:text-foreground flex w-5 flex-1 cursor-pointer items-center justify-center rounded-sm transition-all\"\n (mousedown)=\"$event.preventDefault()\"\n (click)=\"onArrowClick($event, 'down')\">\n <z-icon zType=\"lucideChevronDown\" zSize=\"12\" />\n </button>\n </div>\n }\n\n @if (typeConfig().isPassword && zShowPasswordToggle()) {\n <button\n type=\"button\"\n tabindex=\"-1\"\n class=\"text-muted-foreground hover:text-foreground flex size-6 shrink-0 cursor-pointer items-center justify-center rounded-sm transition-all\"\n (mousedown)=\"$event.preventDefault()\"\n (click)=\"togglePasswordVisibility()\">\n @if (uiState().passwordVisible) {\n <z-icon zType=\"lucideEyeOff\" zSize=\"16\" />\n } @else {\n <z-icon zType=\"lucideEye\" zSize=\"16\" />\n }\n </button>\n }\n </div>\n\n @if (hasAutoSuggest() && uiState().showSuggestPopover && suggestHistory().length > 0) {\n <div\n class=\"bg-popover text-popover-foreground border-border z-animate-in z-fade-in z-duration-200 z-slide-in-from-top-4 absolute top-full left-0 z-50 mt-1 flex w-full flex-col gap-[0.1875rem] rounded-sm border p-1 shadow-md\">\n @for (item of filteredSuggestHistory(); track item; let i = $index) {\n <button\n type=\"button\"\n class=\"hover:bg-primary/10 hover:text-foreground flex w-full cursor-pointer items-center gap-2 rounded-sm px-2 py-1.5 text-left text-sm transition-colors\"\n [class.bg-primary/15]=\"suggestActiveIndex() === i\"\n [class.text-primary]=\"suggestActiveIndex() === i\"\n (mousedown)=\"selectSuggestItem(item)\">\n <z-icon zType=\"lucideClock\" zSize=\"14\" class=\"text-muted-foreground shrink-0\" />\n <span class=\"truncate\">{{ item }}</span>\n </button>\n }\n </div>\n }\n </div>\n }\n\n <ng-template #colorPickerPopover>\n <div class=\"z-input-color-picker\" [style.--z-input-color-picker-current]=\"normalizedColorValue()\">\n <div\n class=\"z-input-color-picker-plane\"\n [style]=\"colorPickerSvStyle()\"\n (pointerdown)=\"onColorPickerSvPointerDown($event)\"\n (pointermove)=\"onColorPickerSvPointerMove($event)\">\n <span class=\"z-input-color-picker-cursor\" [style]=\"colorPickerCursorStyle()\"></span>\n </div>\n\n <div class=\"z-input-color-picker-controls\">\n <button\n type=\"button\"\n z-button\n zType=\"outline\"\n zSize=\"sm\"\n aria-label=\"Pick color\"\n zTypeIcon=\"lucidePencil\"\n (click)=\"openNativeColorPicker()\"></button>\n <div class=\"z-input-color-picker-sliders\">\n <input\n type=\"range\"\n min=\"0\"\n max=\"360\"\n [ngModel]=\"colorPickerHsv().hue\"\n class=\"z-input-color-picker-hue\"\n (input)=\"onColorPickerHueInput($event)\" />\n <input\n type=\"range\"\n min=\"0\"\n max=\"100\"\n [ngModel]=\"colorPickerAlpha()\"\n class=\"z-input-color-picker-alpha\"\n (input)=\"onColorPickerAlphaInput($event)\" />\n </div>\n </div>\n\n <div class=\"flex flex-col gap-2\">\n <div class=\"z-input-color-picker-fields\">\n <z-select\n zSize=\"sm\"\n class=\"z-input-color-picker-format\"\n [zOptions]=\"colorPickerFormatOptions\"\n [zShowSearch]=\"false\"\n [zTranslateLabels]=\"false\"\n [ngModel]=\"colorPickerFormat()\"\n (ngModelChange)=\"onColorPickerFormatChange($event)\" />\n <div class=\"z-input-color-picker-value-group\">\n @switch (colorPickerFormat()) {\n @case ('rgb') {\n <div class=\"z-input-color-picker-channel-group\">\n <z-input\n zType=\"number\"\n zSize=\"sm\"\n zPlaceholder=\"R\"\n [zMin]=\"0\"\n [zMax]=\"255\"\n [zShowArrows]=\"false\"\n [ngModel]=\"colorPickerRgbValue().red\"\n (ngModelChange)=\"onColorPickerRgbChange('red', $event)\" />\n <z-input\n zType=\"number\"\n zSize=\"sm\"\n zPlaceholder=\"G\"\n [zMin]=\"0\"\n [zMax]=\"255\"\n [zShowArrows]=\"false\"\n [ngModel]=\"colorPickerRgbValue().green\"\n (ngModelChange)=\"onColorPickerRgbChange('green', $event)\" />\n <z-input\n zType=\"number\"\n zSize=\"sm\"\n zPlaceholder=\"B\"\n [zMin]=\"0\"\n [zMax]=\"255\"\n [zShowArrows]=\"false\"\n [ngModel]=\"colorPickerRgbValue().blue\"\n (ngModelChange)=\"onColorPickerRgbChange('blue', $event)\" />\n </div>\n }\n @case ('hsl') {\n <div class=\"z-input-color-picker-channel-group\">\n <z-input\n zType=\"number\"\n zSize=\"sm\"\n zPlaceholder=\"H\"\n [zMin]=\"0\"\n [zMax]=\"360\"\n [zShowArrows]=\"false\"\n [ngModel]=\"colorPickerHslValue().hue\"\n (ngModelChange)=\"onColorPickerHslChange('hue', $event)\" />\n <z-input\n zType=\"number\"\n zSize=\"sm\"\n zPlaceholder=\"S\"\n [zMin]=\"0\"\n [zMax]=\"100\"\n [zShowArrows]=\"false\"\n [ngModel]=\"colorPickerHslValue().saturation\"\n (ngModelChange)=\"onColorPickerHslChange('saturation', $event)\" />\n <z-input\n zType=\"number\"\n zSize=\"sm\"\n zPlaceholder=\"L\"\n [zMin]=\"0\"\n [zMax]=\"100\"\n [zShowArrows]=\"false\"\n [ngModel]=\"colorPickerHslValue().lightness\"\n (ngModelChange)=\"onColorPickerHslChange('lightness', $event)\" />\n </div>\n }\n @case ('hsv') {\n <div class=\"z-input-color-picker-channel-group\">\n <z-input\n zType=\"number\"\n zSize=\"sm\"\n zPlaceholder=\"H\"\n [zMin]=\"0\"\n [zMax]=\"360\"\n [zShowArrows]=\"false\"\n [ngModel]=\"colorPickerHsv().hue\"\n (ngModelChange)=\"onColorPickerHsvValueChange('hue', $event)\" />\n <z-input\n zType=\"number\"\n zSize=\"sm\"\n zPlaceholder=\"S\"\n [zMin]=\"0\"\n [zMax]=\"100\"\n [zShowArrows]=\"false\"\n [ngModel]=\"colorPickerHsv().saturation\"\n (ngModelChange)=\"onColorPickerHsvValueChange('saturation', $event)\" />\n <z-input\n zType=\"number\"\n zSize=\"sm\"\n zPlaceholder=\"V\"\n [zMin]=\"0\"\n [zMax]=\"100\"\n [zShowArrows]=\"false\"\n [ngModel]=\"colorPickerHsv().value\"\n (ngModelChange)=\"onColorPickerHsvValueChange('value', $event)\" />\n </div>\n }\n @default {\n <z-input\n zSize=\"sm\"\n class=\"z-input-color-picker-hex-input\"\n [ngModel]=\"normalizedColorValue()\"\n (ngModelChange)=\"onColorPickerHexChange($event)\" />\n }\n }\n <z-input\n zType=\"number\"\n zSize=\"sm\"\n class=\"z-input-color-picker-alpha-input\"\n [zMin]=\"0\"\n [zMax]=\"100\"\n zSuffix=\"%\"\n [zShowArrows]=\"false\"\n [ngModel]=\"colorPickerAlpha()\"\n (ngModelChange)=\"onColorPickerAlphaValueChange($event)\" />\n </div>\n </div>\n\n <div class=\"z-input-color-picker-saved-head\">\n <span>{{ 'i18n_z_ui_input_saved_colors' | translate }}</span>\n <button type=\"button\" z-button zType=\"ghost\" zSize=\"sm\" (click)=\"addCurrentColorToSaved()\">\n {{ 'i18n_z_ui_input_add_color' | translate }}\n </button>\n </div>\n <div class=\"z-input-color-picker-swatches\">\n @for (swatch of colorPickerSavedSwatches(); track swatch.color) {\n <button\n type=\"button\"\n class=\"z-input-color-picker-swatch rounded-[3px]!\"\n [class.z-input-color-picker-swatch-active]=\"swatch.color === normalizedColorValue()\"\n [class.z-input-color-picker-swatch-light]=\"swatch.isLight\"\n [style.--z-input-color-picker-swatch-color]=\"swatch.color\"\n [attr.aria-label]=\"swatch.color\"\n (click)=\"selectSavedColor(swatch.color)\"></button>\n }\n </div>\n </div>\n </div>\n </ng-template>\n\n @if (hasError()) {\n <p class=\"text-destructive animate-in fade-in slide-in-from-top-1 m-0 text-xs duration-200\">\n {{ errorMessage() }}\n </p>\n }\n</div>\n", styles: [".z-input-native{text-overflow:ellipsis;overflow:hidden}.z-input-native:-webkit-autofill,.z-input-native:-webkit-autofill:hover,.z-input-native:-webkit-autofill:focus,.z-input-native:-webkit-autofill:active{-webkit-box-shadow:0 0 0 1000px white inset!important;-webkit-text-fill-color:var(--color-foreground)!important;transition:background-color 9999s ease-in-out 0s!important;caret-color:var(--color-foreground)}:is(.dark,.dark *) .z-input-native:-webkit-autofill,:is(.dark,.dark *) .z-input-native:-webkit-autofill:hover,:is(.dark,.dark *) .z-input-native:-webkit-autofill:focus,:is(.dark,.dark *) .z-input-native:-webkit-autofill:active{-webkit-box-shadow:0 0 0 1000px var(--input-autofill) inset!important;transition:background-color 9999s ease-in-out 0s!important}textarea.z-input-native::-webkit-resizer{display:none}input[type=number].z-input-native::-webkit-inner-spin-button,input[type=number].z-input-native::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}input[type=number].z-input-native{-moz-appearance:textfield;appearance:textfield}input[type=color]{cursor:pointer}input[type=color]::-webkit-color-swatch-wrapper{padding:0}input[type=color]::-webkit-color-swatch{border:none;border-radius:var(--radius-sm)}input[type=color]::-moz-color-swatch{border:none;border-radius:var(--radius-sm)}.z-input-container{position:relative;overflow:visible}.z-input-container:has(.z-input-blossom .bcp-core[aria-expanded=true]){z-index:40}.z-input-blossom,.z-input-blossom .bcp-root{position:relative;z-index:41;overflow:visible}.z-input-blossom .bcp-container{z-index:42!important}.z-input-blossom .bcp-core{width:var(--z-bcp-core-size, 1.125rem)!important;height:var(--z-bcp-core-size, 1.125rem)!important;min-width:var(--z-bcp-core-size, 1.125rem)!important;min-height:var(--z-bcp-core-size, 1.125rem)!important;border-radius:var(--radius-xs, .125rem)!important;border:1px solid var(--z-bcp-core-border-color, rgba(0, 0, 0, .14))!important;box-shadow:none!important;transition:border-radius .18s cubic-bezier(.22,1,.36,1),border-color .16s ease,transform .18s cubic-bezier(.22,1,.36,1)!important}.z-input-blossom .bcp-core[aria-expanded=true]{border-radius:624.9375rem!important;border-color:transparent!important;box-shadow:0 3px 10px #00000029!important;transform:scale(1.03)!important}.z-input-blossom .bcp-core[aria-expanded=false]{transform:scale(1)!important}.z-input-color-trigger{display:block;width:var(--z-bcp-core-size, 1.625rem);height:var(--z-bcp-core-size, 1.625rem);align-self:center;cursor:pointer;border:1px solid var(--border);border-radius:var(--radius-xs, .125rem);box-shadow:none}.z-input-native-color{position:absolute;width:0;height:0;opacity:0;pointer-events:none}.z-input-color-picker-popover{padding:.75rem;border-radius:.5rem}.z-input-color-picker{display:flex;flex-direction:column;width:18.75rem;gap:.875rem}.z-input-color-picker-plane{position:relative;height:11.5rem;cursor:crosshair;border:1px solid var(--border);border-radius:.375rem;overflow:hidden}.z-input-color-picker-cursor{position:absolute;width:1.25rem;height:1.25rem;border:3px solid white;border-radius:999px;box-shadow:0 0 0 1px #0003;translate:-50% -50%;pointer-events:none}.z-input-color-picker-controls{display:grid;grid-template-columns:2.25rem minmax(0,1fr);align-items:center;gap:.5rem}.z-input-color-picker-sliders{display:flex;min-width:0;flex-direction:column;gap:.375rem}.z-input-color-picker-hue,.z-input-color-picker-alpha{width:100%;height:.625rem;cursor:pointer;appearance:none;border-radius:999px}.z-input-color-picker-hue{background:linear-gradient(to right,red,#ff0,#0f0,#0ff,#00f,#f0f,red)}.z-input-color-picker-alpha{background:linear-gradient(to right,transparent,var(--z-input-color-picker-current, var(--primary))),conic-gradient(#d1d5db 25%,#fff 0 50%,#d1d5db 0 75%,#fff 0);background-position:0 0,0 0;background-size:auto,.5rem .5rem}.z-input-color-picker-hue::-webkit-slider-thumb,.z-input-color-picker-alpha::-webkit-slider-thumb{width:1rem;height:1rem;appearance:none;border:3px solid white;border-radius:999px;background:var(--primary);box-shadow:0 1px 4px #0000004d}.z-input-color-picker-fields{display:grid;grid-template-columns:5.2rem minmax(0,1fr);gap:.5rem}.z-input-color-picker-format .z-select-trigger{min-height:2rem}.z-input-color-picker-value-group{display:grid;grid-template-columns:minmax(0,1fr) 3.85rem;min-width:0}.z-input-color-picker-value-group .z-input-wrapper{gap:0}.z-input-color-picker-value-group .z-input-container{min-height:2rem;border-radius:0}.z-input-color-picker-value-group>z-input:first-child .z-input-container,.z-input-color-picker-value-group>.z-input-color-picker-channel-group:first-child z-input:first-child .z-input-container{border-top-left-radius:var(--radius-sm, .25rem);border-bottom-left-radius:var(--radius-sm, .25rem)}.z-input-color-picker-value-group>z-input:last-child .z-input-container{border-left-width:0;border-top-right-radius:var(--radius-sm, .25rem);border-bottom-right-radius:var(--radius-sm, .25rem)}.z-input-color-picker-value-group .z-input-container:focus-within{position:relative;z-index:1;border-left-width:1px}.z-input-color-picker-hex-input .z-input-native{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace}.z-input-color-picker-channel-group{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));min-width:0}.z-input-color-picker-channel-group z-input:not(:first-child) .z-input-container{border-left-width:0}.z-input-color-picker-channel-group .z-input-native,.z-input-color-picker-alpha-input .z-input-native{text-align:center}.z-input-color-picker-saved-head{display:flex;align-items:center;justify-content:space-between;font-size:.875rem;font-weight:400}.z-input-color-picker-saved-head .z-button{height:1.75rem;padding-inline:.25rem;font-weight:400}.z-input-color-picker-swatches{display:flex;justify-content:space-between;gap:.375rem}.z-input-color-picker-swatch{width:1.75rem;height:1.75rem;cursor:pointer;border:0;border-radius:var(--radius-sm);background:var(--z-input-color-picker-swatch-color)}.z-input-color-picker-swatch-light{background:linear-gradient(var(--z-input-color-picker-swatch-color),var(--z-input-color-picker-swatch-color)),conic-gradient(#d1d5db 25%,#fff 0 50%,#d1d5db 0 75%,#fff 0);background-size:auto,.5rem .5rem;box-shadow:inset 0 0 0 1px #00000029}.z-input-color-picker-swatch-active{box-shadow:0 0 0 2px var(--background),0 0 0 4px var(--primary)}.z-input-color-picker-swatch-light.z-input-color-picker-swatch-active{box-shadow:inset 0 0 0 1px #00000029,0 0 0 2px var(--background),0 0 0 4px var(--primary)}\n"] }]
|
|
1397
|
+
}], propDecorators: { inputRef: [{ type: i0.ViewChild, args: ['inputEl', { isSignal: true }] }], nativeColorInputRef: [{ type: i0.ViewChild, args: ['nativeColorInputEl', { isSignal: true }] }], zOnSearch: [{ type: i0.Output, args: ["zOnSearch"] }], zOnChange: [{ type: i0.Output, args: ["zOnChange"] }], zOnBlur: [{ type: i0.Output, args: ["zOnBlur"] }], zOnFocus: [{ type: i0.Output, args: ["zOnFocus"] }], zOnKeydown: [{ type: i0.Output, args: ["zOnKeydown"] }], zOnEnter: [{ type: i0.Output, args: ["zOnEnter"] }], zOnColorCollapse: [{ type: i0.Output, args: ["zOnColorCollapse"] }], zControl: [{ type: i0.Output, args: ["zControl"] }], zEvent: [{ type: i0.Output, args: ["zEvent"] }], class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], zType: [{ type: i0.Input, args: [{ isSignal: true, alias: "zType", required: false }] }], zSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "zSize", required: false }] }], zAlign: [{ type: i0.Input, args: [{ isSignal: true, alias: "zAlign", required: false }] }], zLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "zLabel", required: false }] }], zLabelClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "zLabelClass", required: false }] }], zPlaceholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "zPlaceholder", required: false }] }], zRequired: [{ type: i0.Input, args: [{ isSignal: true, alias: "zRequired", required: false }] }], zDisabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "zDisabled", required: false }] }], zReadonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "zReadonly", required: false }] }], zPrefix: [{ type: i0.Input, args: [{ isSignal: true, alias: "zPrefix", required: false }] }], zSuffix: [{ type: i0.Input, args: [{ isSignal: true, alias: "zSuffix", required: false }] }], zMin: [{ type: i0.Input, args: [{ isSignal: true, alias: "zMin", required: false }] }], zMax: [{ type: i0.Input, args: [{ isSignal: true, alias: "zMax", required: false }] }], zStep: [{ type: i0.Input, args: [{ isSignal: true, alias: "zStep", required: false }] }], zShowArrows: [{ type: i0.Input, args: [{ isSignal: true, alias: "zShowArrows", required: false }] }], zMask: [{ type: i0.Input, args: [{ isSignal: true, alias: "zMask", required: false }] }], zDecimalPlaces: [{ type: i0.Input, args: [{ isSignal: true, alias: "zDecimalPlaces", required: false }] }], zAllowNegative: [{ type: i0.Input, args: [{ isSignal: true, alias: "zAllowNegative", required: false }] }], zThousandSeparator: [{ type: i0.Input, args: [{ isSignal: true, alias: "zThousandSeparator", required: false }] }], zDecimalMarker: [{ type: i0.Input, args: [{ isSignal: true, alias: "zDecimalMarker", required: false }] }], zValidators: [{ type: i0.Input, args: [{ isSignal: true, alias: "zValidators", required: false }] }], zAsyncValidators: [{ type: i0.Input, args: [{ isSignal: true, alias: "zAsyncValidators", required: false }] }], zAsyncDebounce: [{ type: i0.Input, args: [{ isSignal: true, alias: "zAsyncDebounce", required: false }] }], zAsyncValidateOn: [{ type: i0.Input, args: [{ isSignal: true, alias: "zAsyncValidateOn", required: false }] }], zShowPasswordToggle: [{ type: i0.Input, args: [{ isSignal: true, alias: "zShowPasswordToggle", required: false }] }], zSearch: [{ type: i0.Input, args: [{ isSignal: true, alias: "zSearch", required: false }] }], zDebounce: [{ type: i0.Input, args: [{ isSignal: true, alias: "zDebounce", required: false }] }], zAutofocus: [{ type: i0.Input, args: [{ isSignal: true, alias: "zAutofocus", required: false }] }], zAutoComplete: [{ type: i0.Input, args: [{ isSignal: true, alias: "zAutoComplete", required: false }] }], zAllowClear: [{ type: i0.Input, args: [{ isSignal: true, alias: "zAllowClear", required: false }] }], zAutoSizeContent: [{ type: i0.Input, args: [{ isSignal: true, alias: "zAutoSizeContent", required: false }] }], zRows: [{ type: i0.Input, args: [{ isSignal: true, alias: "zRows", required: false }] }], zResize: [{ type: i0.Input, args: [{ isSignal: true, alias: "zResize", required: false }] }], zMaxLength: [{ type: i0.Input, args: [{ isSignal: true, alias: "zMaxLength", required: false }] }], zAutoSuggest: [{ type: i0.Input, args: [{ isSignal: true, alias: "zAutoSuggest", required: false }] }], zColorConfig: [{ type: i0.Input, args: [{ isSignal: true, alias: "zColorConfig", required: false }] }] } });
|
|
958
1398
|
|
|
959
1399
|
/**
|
|
960
1400
|
* Generated bundle index. Do not edit.
|