@wirekyt/angular 0.0.9 → 0.0.10

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.
@@ -0,0 +1,1103 @@
1
+ import * as colorPicker from '@wirekyt/dom/machines/color-picker';
2
+ import { anatomy } from '@wirekyt/dom/machines/color-picker';
3
+ export { parse as parseColor } from '@wirekyt/dom/machines/color-picker';
4
+ import * as i0 from '@angular/core';
5
+ import { InjectionToken, inject, computed, input, DestroyRef, Renderer2, ElementRef, forwardRef, Directive, signal, effect, TemplateRef, ViewContainerRef, model, booleanAttribute, output, EnvironmentInjector, Injector } from '@angular/core';
6
+ import { bindProps, injectLocale, injectEnvironment, createId, useMachine, createCvaController, buildRootCarrier } from '@wirekyt/angular';
7
+ import { injectFieldContextOptional } from '@wirekyt/angular/field';
8
+ import { NG_VALUE_ACCESSOR } from '@angular/forms';
9
+
10
+ const colorPickerAnatomy = anatomy;
11
+
12
+ const COLOR_PICKER_AREA_PROPS = new InjectionToken("WIREKYT.COLOR_PICKER_AREA_PROPS");
13
+ const COLOR_PICKER_CHANNEL_PROPS = new InjectionToken("WIREKYT.COLOR_PICKER_CHANNEL_PROPS");
14
+ const COLOR_PICKER_SWATCH_PROPS = new InjectionToken("WIREKYT.COLOR_PICKER_SWATCH_PROPS");
15
+ const COLOR_PICKER_FORMAT_PROPS = new InjectionToken("WIREKYT.COLOR_PICKER_FORMAT_PROPS");
16
+ function injectColorPickerAreaProps() {
17
+ return inject(COLOR_PICKER_AREA_PROPS);
18
+ }
19
+ function injectColorPickerChannelProps() {
20
+ return inject(COLOR_PICKER_CHANNEL_PROPS);
21
+ }
22
+ function injectColorPickerChannelSliderProps() {
23
+ const channelProps = inject(COLOR_PICKER_CHANNEL_PROPS);
24
+ const formatProps = inject(COLOR_PICKER_FORMAT_PROPS, { optional: true });
25
+ return computed(() => ({
26
+ ...channelProps(),
27
+ ...formatProps?.(),
28
+ }));
29
+ }
30
+ function injectColorPickerSwatchProps() {
31
+ return inject(COLOR_PICKER_SWATCH_PROPS);
32
+ }
33
+
34
+ const COLOR_PICKER_CONTEXT = new InjectionToken("WIREKYT.COLOR_PICKER_CONTEXT");
35
+ function injectColorPickerContext() {
36
+ return inject(COLOR_PICKER_CONTEXT);
37
+ }
38
+ const COLOR_PICKER_CONTEXT_CARRIER = new InjectionToken("WIREKYT.COLOR_PICKER_CONTEXT_CARRIER");
39
+ function injectColorPickerContextCarrier() {
40
+ return inject(COLOR_PICKER_CONTEXT_CARRIER);
41
+ }
42
+
43
+ class ColorPickerArea {
44
+ xChannel = input(undefined, /* @ts-ignore */
45
+ ...(ngDevMode ? [{ debugName: "xChannel" }] : /* istanbul ignore next */ []));
46
+ yChannel = input(undefined, /* @ts-ignore */
47
+ ...(ngDevMode ? [{ debugName: "yChannel" }] : /* istanbul ignore next */ []));
48
+ areaProps = computed(() => ({
49
+ xChannel: this.xChannel(),
50
+ yChannel: this.yChannel(),
51
+ }), /* @ts-ignore */
52
+ ...(ngDevMode ? [{ debugName: "areaProps" }] : /* istanbul ignore next */ []));
53
+ constructor() {
54
+ const context = injectColorPickerContext();
55
+ bindProps({
56
+ elementRef: inject(ElementRef),
57
+ renderer: inject(Renderer2),
58
+ destroyRef: inject(DestroyRef),
59
+ props: () => context.api().getAreaProps(this.areaProps()),
60
+ });
61
+ }
62
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: ColorPickerArea, deps: [], target: i0.ɵɵFactoryTarget.Directive });
63
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.3", type: ColorPickerArea, isStandalone: true, selector: "[colorPickerArea]", inputs: { xChannel: { classPropertyName: "xChannel", publicName: "xChannel", isSignal: true, isRequired: false, transformFunction: null }, yChannel: { classPropertyName: "yChannel", publicName: "yChannel", isSignal: true, isRequired: false, transformFunction: null } }, providers: [
64
+ {
65
+ provide: COLOR_PICKER_AREA_PROPS,
66
+ useFactory: (area) => area.areaProps,
67
+ deps: [forwardRef(() => ColorPickerArea)],
68
+ },
69
+ ], exportAs: ["colorPickerArea"], ngImport: i0 });
70
+ }
71
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: ColorPickerArea, decorators: [{
72
+ type: Directive,
73
+ args: [{
74
+ selector: "[colorPickerArea]",
75
+ standalone: true,
76
+ exportAs: "colorPickerArea",
77
+ providers: [
78
+ {
79
+ provide: COLOR_PICKER_AREA_PROPS,
80
+ useFactory: (area) => area.areaProps,
81
+ deps: [forwardRef(() => ColorPickerArea)],
82
+ },
83
+ ],
84
+ }]
85
+ }], ctorParameters: () => [], propDecorators: { xChannel: [{ type: i0.Input, args: [{ isSignal: true, alias: "xChannel", required: false }] }], yChannel: [{ type: i0.Input, args: [{ isSignal: true, alias: "yChannel", required: false }] }] } });
86
+
87
+ class ColorPickerAreaBackground {
88
+ constructor() {
89
+ const context = injectColorPickerContext();
90
+ const areaProps = injectColorPickerAreaProps();
91
+ bindProps({
92
+ elementRef: inject(ElementRef),
93
+ renderer: inject(Renderer2),
94
+ destroyRef: inject(DestroyRef),
95
+ props: () => context.api().getAreaBackgroundProps(areaProps()),
96
+ });
97
+ }
98
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: ColorPickerAreaBackground, deps: [], target: i0.ɵɵFactoryTarget.Directive });
99
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.3", type: ColorPickerAreaBackground, isStandalone: true, selector: "[colorPickerAreaBackground]", exportAs: ["colorPickerAreaBackground"], ngImport: i0 });
100
+ }
101
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: ColorPickerAreaBackground, decorators: [{
102
+ type: Directive,
103
+ args: [{
104
+ selector: "[colorPickerAreaBackground]",
105
+ standalone: true,
106
+ exportAs: "colorPickerAreaBackground",
107
+ }]
108
+ }], ctorParameters: () => [] });
109
+
110
+ class ColorPickerAreaThumb {
111
+ constructor() {
112
+ const context = injectColorPickerContext();
113
+ const areaProps = injectColorPickerAreaProps();
114
+ bindProps({
115
+ elementRef: inject(ElementRef),
116
+ renderer: inject(Renderer2),
117
+ destroyRef: inject(DestroyRef),
118
+ props: () => context.api().getAreaThumbProps(areaProps()),
119
+ });
120
+ }
121
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: ColorPickerAreaThumb, deps: [], target: i0.ɵɵFactoryTarget.Directive });
122
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.3", type: ColorPickerAreaThumb, isStandalone: true, selector: "[colorPickerAreaThumb]", exportAs: ["colorPickerAreaThumb"], ngImport: i0 });
123
+ }
124
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: ColorPickerAreaThumb, decorators: [{
125
+ type: Directive,
126
+ args: [{
127
+ selector: "[colorPickerAreaThumb]",
128
+ standalone: true,
129
+ exportAs: "colorPickerAreaThumb",
130
+ }]
131
+ }], ctorParameters: () => [] });
132
+
133
+ class ColorPickerChannelInput {
134
+ channel = input.required(/* @ts-ignore */
135
+ ...(ngDevMode ? [{ debugName: "channel" }] : /* istanbul ignore next */ []));
136
+ orientation = input(undefined, /* @ts-ignore */
137
+ ...(ngDevMode ? [{ debugName: "orientation" }] : /* istanbul ignore next */ []));
138
+ constructor() {
139
+ const context = injectColorPickerContext();
140
+ bindProps({
141
+ elementRef: inject(ElementRef),
142
+ renderer: inject(Renderer2),
143
+ destroyRef: inject(DestroyRef),
144
+ props: () => context
145
+ .api()
146
+ .getChannelInputProps({ channel: this.channel(), orientation: this.orientation() }),
147
+ });
148
+ }
149
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: ColorPickerChannelInput, deps: [], target: i0.ɵɵFactoryTarget.Directive });
150
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.3", type: ColorPickerChannelInput, isStandalone: true, selector: "input[colorPickerChannelInput]", inputs: { channel: { classPropertyName: "channel", publicName: "channel", isSignal: true, isRequired: true, transformFunction: null }, orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null } }, exportAs: ["colorPickerChannelInput"], ngImport: i0 });
151
+ }
152
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: ColorPickerChannelInput, decorators: [{
153
+ type: Directive,
154
+ args: [{
155
+ selector: "input[colorPickerChannelInput]",
156
+ standalone: true,
157
+ exportAs: "colorPickerChannelInput",
158
+ }]
159
+ }], ctorParameters: () => [], propDecorators: { channel: [{ type: i0.Input, args: [{ isSignal: true, alias: "channel", required: true }] }], orientation: [{ type: i0.Input, args: [{ isSignal: true, alias: "orientation", required: false }] }] } });
160
+
161
+ class ColorPickerChannelSlider {
162
+ channel = input.required(/* @ts-ignore */
163
+ ...(ngDevMode ? [{ debugName: "channel" }] : /* istanbul ignore next */ []));
164
+ orientation = input(undefined, /* @ts-ignore */
165
+ ...(ngDevMode ? [{ debugName: "orientation" }] : /* istanbul ignore next */ []));
166
+ formatProps = inject(COLOR_PICKER_FORMAT_PROPS, { optional: true });
167
+ channelProps = computed(() => ({
168
+ channel: this.channel(),
169
+ orientation: this.orientation(),
170
+ }), /* @ts-ignore */
171
+ ...(ngDevMode ? [{ debugName: "channelProps" }] : /* istanbul ignore next */ []));
172
+ sliderProps = computed(() => ({
173
+ ...this.channelProps(),
174
+ ...this.formatProps?.(),
175
+ }), /* @ts-ignore */
176
+ ...(ngDevMode ? [{ debugName: "sliderProps" }] : /* istanbul ignore next */ []));
177
+ constructor() {
178
+ const context = injectColorPickerContext();
179
+ bindProps({
180
+ elementRef: inject(ElementRef),
181
+ renderer: inject(Renderer2),
182
+ destroyRef: inject(DestroyRef),
183
+ props: () => context.api().getChannelSliderProps(this.sliderProps()),
184
+ });
185
+ }
186
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: ColorPickerChannelSlider, deps: [], target: i0.ɵɵFactoryTarget.Directive });
187
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.3", type: ColorPickerChannelSlider, isStandalone: true, selector: "[colorPickerChannelSlider]", inputs: { channel: { classPropertyName: "channel", publicName: "channel", isSignal: true, isRequired: true, transformFunction: null }, orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null } }, providers: [
188
+ {
189
+ provide: COLOR_PICKER_CHANNEL_PROPS,
190
+ useFactory: (slider) => slider.channelProps,
191
+ deps: [forwardRef(() => ColorPickerChannelSlider)],
192
+ },
193
+ ], exportAs: ["colorPickerChannelSlider"], ngImport: i0 });
194
+ }
195
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: ColorPickerChannelSlider, decorators: [{
196
+ type: Directive,
197
+ args: [{
198
+ selector: "[colorPickerChannelSlider]",
199
+ standalone: true,
200
+ exportAs: "colorPickerChannelSlider",
201
+ providers: [
202
+ {
203
+ provide: COLOR_PICKER_CHANNEL_PROPS,
204
+ useFactory: (slider) => slider.channelProps,
205
+ deps: [forwardRef(() => ColorPickerChannelSlider)],
206
+ },
207
+ ],
208
+ }]
209
+ }], ctorParameters: () => [], propDecorators: { channel: [{ type: i0.Input, args: [{ isSignal: true, alias: "channel", required: true }] }], orientation: [{ type: i0.Input, args: [{ isSignal: true, alias: "orientation", required: false }] }] } });
210
+
211
+ class ColorPickerChannelSliderLabel {
212
+ ownsTextContent = signal(false, /* @ts-ignore */
213
+ ...(ngDevMode ? [{ debugName: "ownsTextContent" }] : /* istanbul ignore next */ []));
214
+ elementRef = inject(ElementRef);
215
+ constructor() {
216
+ const context = injectColorPickerContext();
217
+ const channelProps = injectColorPickerChannelProps();
218
+ const renderer = inject(Renderer2);
219
+ bindProps({
220
+ elementRef: this.elementRef,
221
+ renderer,
222
+ destroyRef: inject(DestroyRef),
223
+ props: () => context.api().getChannelSliderLabelProps(channelProps()),
224
+ });
225
+ effect(() => {
226
+ if (this.ownsTextContent())
227
+ renderer.setProperty(this.elementRef.nativeElement, "textContent", channelProps().channel);
228
+ });
229
+ }
230
+ ngAfterContentInit() {
231
+ this.ownsTextContent.set(this.elementRef.nativeElement.childNodes.length === 0);
232
+ }
233
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: ColorPickerChannelSliderLabel, deps: [], target: i0.ɵɵFactoryTarget.Directive });
234
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.3", type: ColorPickerChannelSliderLabel, isStandalone: true, selector: "[colorPickerChannelSliderLabel]", exportAs: ["colorPickerChannelSliderLabel"], ngImport: i0 });
235
+ }
236
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: ColorPickerChannelSliderLabel, decorators: [{
237
+ type: Directive,
238
+ args: [{
239
+ selector: "[colorPickerChannelSliderLabel]",
240
+ standalone: true,
241
+ exportAs: "colorPickerChannelSliderLabel",
242
+ }]
243
+ }], ctorParameters: () => [] });
244
+
245
+ class ColorPickerChannelSliderThumb {
246
+ constructor() {
247
+ const context = injectColorPickerContext();
248
+ const sliderProps = injectColorPickerChannelSliderProps();
249
+ bindProps({
250
+ elementRef: inject(ElementRef),
251
+ renderer: inject(Renderer2),
252
+ destroyRef: inject(DestroyRef),
253
+ props: () => context.api().getChannelSliderThumbProps(sliderProps()),
254
+ });
255
+ }
256
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: ColorPickerChannelSliderThumb, deps: [], target: i0.ɵɵFactoryTarget.Directive });
257
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.3", type: ColorPickerChannelSliderThumb, isStandalone: true, selector: "[colorPickerChannelSliderThumb]", exportAs: ["colorPickerChannelSliderThumb"], ngImport: i0 });
258
+ }
259
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: ColorPickerChannelSliderThumb, decorators: [{
260
+ type: Directive,
261
+ args: [{
262
+ selector: "[colorPickerChannelSliderThumb]",
263
+ standalone: true,
264
+ exportAs: "colorPickerChannelSliderThumb",
265
+ }]
266
+ }], ctorParameters: () => [] });
267
+
268
+ class ColorPickerChannelSliderTrack {
269
+ constructor() {
270
+ const context = injectColorPickerContext();
271
+ const sliderProps = injectColorPickerChannelSliderProps();
272
+ bindProps({
273
+ elementRef: inject(ElementRef),
274
+ renderer: inject(Renderer2),
275
+ destroyRef: inject(DestroyRef),
276
+ props: () => context.api().getChannelSliderTrackProps(sliderProps()),
277
+ });
278
+ }
279
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: ColorPickerChannelSliderTrack, deps: [], target: i0.ɵɵFactoryTarget.Directive });
280
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.3", type: ColorPickerChannelSliderTrack, isStandalone: true, selector: "[colorPickerChannelSliderTrack]", exportAs: ["colorPickerChannelSliderTrack"], ngImport: i0 });
281
+ }
282
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: ColorPickerChannelSliderTrack, decorators: [{
283
+ type: Directive,
284
+ args: [{
285
+ selector: "[colorPickerChannelSliderTrack]",
286
+ standalone: true,
287
+ exportAs: "colorPickerChannelSliderTrack",
288
+ }]
289
+ }], ctorParameters: () => [] });
290
+
291
+ class ColorPickerChannelSliderValueText {
292
+ ownsTextContent = signal(false, /* @ts-ignore */
293
+ ...(ngDevMode ? [{ debugName: "ownsTextContent" }] : /* istanbul ignore next */ []));
294
+ elementRef = inject(ElementRef);
295
+ constructor() {
296
+ const locale = injectLocale();
297
+ const context = injectColorPickerContext();
298
+ const channelProps = injectColorPickerChannelProps();
299
+ const renderer = inject(Renderer2);
300
+ bindProps({
301
+ elementRef: this.elementRef,
302
+ renderer,
303
+ destroyRef: inject(DestroyRef),
304
+ props: () => context.api().getChannelSliderValueTextProps(channelProps()),
305
+ });
306
+ effect(() => {
307
+ if (!this.ownsTextContent())
308
+ return;
309
+ renderer.setProperty(this.elementRef.nativeElement, "textContent", context.api().getChannelValueText(channelProps().channel, locale.locale));
310
+ });
311
+ }
312
+ ngAfterContentInit() {
313
+ this.ownsTextContent.set(this.elementRef.nativeElement.childNodes.length === 0);
314
+ }
315
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: ColorPickerChannelSliderValueText, deps: [], target: i0.ɵɵFactoryTarget.Directive });
316
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.3", type: ColorPickerChannelSliderValueText, isStandalone: true, selector: "[colorPickerChannelSliderValueText]", exportAs: ["colorPickerChannelSliderValueText"], ngImport: i0 });
317
+ }
318
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: ColorPickerChannelSliderValueText, decorators: [{
319
+ type: Directive,
320
+ args: [{
321
+ selector: "[colorPickerChannelSliderValueText]",
322
+ standalone: true,
323
+ exportAs: "colorPickerChannelSliderValueText",
324
+ }]
325
+ }], ctorParameters: () => [] });
326
+
327
+ class ColorPickerContent {
328
+ constructor() {
329
+ const context = injectColorPickerContext();
330
+ bindProps({
331
+ elementRef: inject(ElementRef),
332
+ renderer: inject(Renderer2),
333
+ destroyRef: inject(DestroyRef),
334
+ props: () => context.api().getContentProps(),
335
+ });
336
+ }
337
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: ColorPickerContent, deps: [], target: i0.ɵɵFactoryTarget.Directive });
338
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.3", type: ColorPickerContent, isStandalone: true, selector: "[colorPickerContent]", exportAs: ["colorPickerContent"], ngImport: i0 });
339
+ }
340
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: ColorPickerContent, decorators: [{
341
+ type: Directive,
342
+ args: [{
343
+ selector: "[colorPickerContent]",
344
+ standalone: true,
345
+ exportAs: "colorPickerContent",
346
+ }]
347
+ }], ctorParameters: () => [] });
348
+
349
+ class ColorPickerContext {
350
+ static ngTemplateContextGuard(_directive, context) {
351
+ void context;
352
+ return true;
353
+ }
354
+ colorPicker = injectColorPickerContext();
355
+ templateRef = inject(TemplateRef);
356
+ viewContainer = inject(ViewContainerRef);
357
+ constructor() {
358
+ const view = this.viewContainer.createEmbeddedView(this.templateRef, {
359
+ $implicit: this.colorPicker.api,
360
+ api: this.colorPicker.api,
361
+ });
362
+ effect(() => {
363
+ this.colorPicker.api();
364
+ view.detectChanges();
365
+ });
366
+ }
367
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: ColorPickerContext, deps: [], target: i0.ɵɵFactoryTarget.Directive });
368
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.3", type: ColorPickerContext, isStandalone: true, selector: "[colorPickerContext]", exportAs: ["colorPickerContext"], ngImport: i0 });
369
+ }
370
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: ColorPickerContext, decorators: [{
371
+ type: Directive,
372
+ args: [{
373
+ selector: "[colorPickerContext]",
374
+ standalone: true,
375
+ exportAs: "colorPickerContext",
376
+ }]
377
+ }], ctorParameters: () => [] });
378
+
379
+ class ColorPickerControl {
380
+ constructor() {
381
+ const context = injectColorPickerContext();
382
+ bindProps({
383
+ elementRef: inject(ElementRef),
384
+ renderer: inject(Renderer2),
385
+ destroyRef: inject(DestroyRef),
386
+ props: () => context.api().getControlProps(),
387
+ });
388
+ }
389
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: ColorPickerControl, deps: [], target: i0.ɵɵFactoryTarget.Directive });
390
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.3", type: ColorPickerControl, isStandalone: true, selector: "[colorPickerControl]", exportAs: ["colorPickerControl"], ngImport: i0 });
391
+ }
392
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: ColorPickerControl, decorators: [{
393
+ type: Directive,
394
+ args: [{
395
+ selector: "[colorPickerControl]",
396
+ standalone: true,
397
+ exportAs: "colorPickerControl",
398
+ }]
399
+ }], ctorParameters: () => [] });
400
+
401
+ class ColorPickerEyeDropperTrigger {
402
+ constructor() {
403
+ const context = injectColorPickerContext();
404
+ bindProps({
405
+ elementRef: inject(ElementRef),
406
+ renderer: inject(Renderer2),
407
+ destroyRef: inject(DestroyRef),
408
+ props: () => context.api().getEyeDropperTriggerProps(),
409
+ });
410
+ }
411
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: ColorPickerEyeDropperTrigger, deps: [], target: i0.ɵɵFactoryTarget.Directive });
412
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.3", type: ColorPickerEyeDropperTrigger, isStandalone: true, selector: "button[colorPickerEyeDropperTrigger]", exportAs: ["colorPickerEyeDropperTrigger"], ngImport: i0 });
413
+ }
414
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: ColorPickerEyeDropperTrigger, decorators: [{
415
+ type: Directive,
416
+ args: [{
417
+ selector: "button[colorPickerEyeDropperTrigger]",
418
+ standalone: true,
419
+ exportAs: "colorPickerEyeDropperTrigger",
420
+ }]
421
+ }], ctorParameters: () => [] });
422
+
423
+ class ColorPickerFormatSelect {
424
+ constructor() {
425
+ const context = injectColorPickerContext();
426
+ bindProps({
427
+ elementRef: inject(ElementRef),
428
+ renderer: inject(Renderer2),
429
+ destroyRef: inject(DestroyRef),
430
+ props: () => context.api().getFormatSelectProps(),
431
+ });
432
+ }
433
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: ColorPickerFormatSelect, deps: [], target: i0.ɵɵFactoryTarget.Directive });
434
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.3", type: ColorPickerFormatSelect, isStandalone: true, selector: "select[colorPickerFormatSelect]", exportAs: ["colorPickerFormatSelect"], ngImport: i0 });
435
+ }
436
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: ColorPickerFormatSelect, decorators: [{
437
+ type: Directive,
438
+ args: [{
439
+ selector: "select[colorPickerFormatSelect]",
440
+ standalone: true,
441
+ exportAs: "colorPickerFormatSelect",
442
+ }]
443
+ }], ctorParameters: () => [] });
444
+
445
+ class ColorPickerFormatTrigger {
446
+ constructor() {
447
+ const context = injectColorPickerContext();
448
+ bindProps({
449
+ elementRef: inject(ElementRef),
450
+ renderer: inject(Renderer2),
451
+ destroyRef: inject(DestroyRef),
452
+ props: () => context.api().getFormatTriggerProps(),
453
+ });
454
+ }
455
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: ColorPickerFormatTrigger, deps: [], target: i0.ɵɵFactoryTarget.Directive });
456
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.3", type: ColorPickerFormatTrigger, isStandalone: true, selector: "button[colorPickerFormatTrigger]", exportAs: ["colorPickerFormatTrigger"], ngImport: i0 });
457
+ }
458
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: ColorPickerFormatTrigger, decorators: [{
459
+ type: Directive,
460
+ args: [{
461
+ selector: "button[colorPickerFormatTrigger]",
462
+ standalone: true,
463
+ exportAs: "colorPickerFormatTrigger",
464
+ }]
465
+ }], ctorParameters: () => [] });
466
+
467
+ class ColorPickerHiddenInput {
468
+ constructor() {
469
+ const context = injectColorPickerContext();
470
+ const field = injectFieldContextOptional();
471
+ bindProps({
472
+ elementRef: inject(ElementRef),
473
+ renderer: inject(Renderer2),
474
+ destroyRef: inject(DestroyRef),
475
+ props: () => ({
476
+ "aria-describedby": field?.ariaDescribedby(),
477
+ ...context.api().getHiddenInputProps(),
478
+ }),
479
+ });
480
+ }
481
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: ColorPickerHiddenInput, deps: [], target: i0.ɵɵFactoryTarget.Directive });
482
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.3", type: ColorPickerHiddenInput, isStandalone: true, selector: "input[colorPickerHiddenInput]", exportAs: ["colorPickerHiddenInput"], ngImport: i0 });
483
+ }
484
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: ColorPickerHiddenInput, decorators: [{
485
+ type: Directive,
486
+ args: [{
487
+ selector: "input[colorPickerHiddenInput]",
488
+ standalone: true,
489
+ exportAs: "colorPickerHiddenInput",
490
+ }]
491
+ }], ctorParameters: () => [] });
492
+
493
+ class ColorPickerLabel {
494
+ constructor() {
495
+ const context = injectColorPickerContext();
496
+ bindProps({
497
+ elementRef: inject(ElementRef),
498
+ renderer: inject(Renderer2),
499
+ destroyRef: inject(DestroyRef),
500
+ props: () => context.api().getLabelProps(),
501
+ });
502
+ }
503
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: ColorPickerLabel, deps: [], target: i0.ɵɵFactoryTarget.Directive });
504
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.3", type: ColorPickerLabel, isStandalone: true, selector: "[colorPickerLabel]", exportAs: ["colorPickerLabel"], ngImport: i0 });
505
+ }
506
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: ColorPickerLabel, decorators: [{
507
+ type: Directive,
508
+ args: [{
509
+ selector: "[colorPickerLabel]",
510
+ standalone: true,
511
+ exportAs: "colorPickerLabel",
512
+ }]
513
+ }], ctorParameters: () => [] });
514
+
515
+ class ColorPickerPositioner {
516
+ constructor() {
517
+ const context = injectColorPickerContext();
518
+ bindProps({
519
+ elementRef: inject(ElementRef),
520
+ renderer: inject(Renderer2),
521
+ destroyRef: inject(DestroyRef),
522
+ props: () => context.api().getPositionerProps(),
523
+ });
524
+ }
525
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: ColorPickerPositioner, deps: [], target: i0.ɵɵFactoryTarget.Directive });
526
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.3", type: ColorPickerPositioner, isStandalone: true, selector: "[colorPickerPositioner]", exportAs: ["colorPickerPositioner"], ngImport: i0 });
527
+ }
528
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: ColorPickerPositioner, decorators: [{
529
+ type: Directive,
530
+ args: [{
531
+ selector: "[colorPickerPositioner]",
532
+ standalone: true,
533
+ exportAs: "colorPickerPositioner",
534
+ }]
535
+ }], ctorParameters: () => [] });
536
+
537
+ function useColorPicker(options) {
538
+ const locale = injectLocale();
539
+ const environment = injectEnvironment();
540
+ const field = injectFieldContextOptional();
541
+ const fallbackId = createId();
542
+ return useMachine({
543
+ machine: colorPicker.machine,
544
+ context: () => {
545
+ const props = options.context();
546
+ const merged = {
547
+ ...props,
548
+ dir: locale.dir,
549
+ getRootNode: environment.getRootNode,
550
+ id: props.id ?? fallbackId,
551
+ };
552
+ if (field) {
553
+ merged.ids = {
554
+ label: field.ids.label,
555
+ hiddenInput: field.ids.control,
556
+ ...props.ids,
557
+ };
558
+ merged.disabled = Boolean(props.disabled) || field.disabled() || undefined;
559
+ merged.readOnly = Boolean(props.readOnly) || field.readOnly() || undefined;
560
+ merged.required = Boolean(props.required) || field.required() || undefined;
561
+ merged.invalid = Boolean(props.invalid) || field.invalid() || undefined;
562
+ }
563
+ return merged;
564
+ },
565
+ connect: (service, normalize) => colorPicker.connect(service, normalize),
566
+ });
567
+ }
568
+
569
+ class ColorPickerRoot {
570
+ id = input(undefined, /* @ts-ignore */
571
+ ...(ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []));
572
+ ids = input(undefined, /* @ts-ignore */
573
+ ...(ngDevMode ? [{ debugName: "ids" }] : /* istanbul ignore next */ []));
574
+ value = model(undefined, /* @ts-ignore */
575
+ ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
576
+ defaultValue = input(undefined, /* @ts-ignore */
577
+ ...(ngDevMode ? [{ debugName: "defaultValue" }] : /* istanbul ignore next */ []));
578
+ format = model(undefined, /* @ts-ignore */
579
+ ...(ngDevMode ? [{ debugName: "format" }] : /* istanbul ignore next */ []));
580
+ defaultFormat = input(undefined, /* @ts-ignore */
581
+ ...(ngDevMode ? [{ debugName: "defaultFormat" }] : /* istanbul ignore next */ []));
582
+ open = model(undefined, /* @ts-ignore */
583
+ ...(ngDevMode ? [{ debugName: "open" }] : /* istanbul ignore next */ []));
584
+ defaultOpen = input(false, { ...(ngDevMode ? { debugName: "defaultOpen" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
585
+ disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
586
+ readOnly = input(false, { ...(ngDevMode ? { debugName: "readOnly" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
587
+ required = input(false, { ...(ngDevMode ? { debugName: "required" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
588
+ invalid = input(false, { ...(ngDevMode ? { debugName: "invalid" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
589
+ inline = input(false, { ...(ngDevMode ? { debugName: "inline" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
590
+ closeOnSelect = input(false, { ...(ngDevMode ? { debugName: "closeOnSelect" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
591
+ openAutoFocus = input(true, { ...(ngDevMode ? { debugName: "openAutoFocus" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
592
+ name = input(undefined, /* @ts-ignore */
593
+ ...(ngDevMode ? [{ debugName: "name" }] : /* istanbul ignore next */ []));
594
+ positioning = input(undefined, /* @ts-ignore */
595
+ ...(ngDevMode ? [{ debugName: "positioning" }] : /* istanbul ignore next */ []));
596
+ initialFocusEl = input(undefined, /* @ts-ignore */
597
+ ...(ngDevMode ? [{ debugName: "initialFocusEl" }] : /* istanbul ignore next */ []));
598
+ valueChangeEnd = output();
599
+ focusOutside = output();
600
+ pointerDownOutside = output();
601
+ interactOutside = output();
602
+ formDisabled = signal(false, /* @ts-ignore */
603
+ ...(ngDevMode ? [{ debugName: "formDisabled" }] : /* istanbul ignore next */ []));
604
+ pendingInternalWrites = 0;
605
+ hasExternalBinding = false;
606
+ hasReceivedFormWrite = false;
607
+ cva = createCvaController({
608
+ value: this.value,
609
+ setDisabled: (disabled) => this.formDisabled.set(disabled),
610
+ componentName: "ColorPickerRoot",
611
+ hasExternalModelBinding: () => this.hasExternalBinding,
612
+ });
613
+ machine = useColorPicker({
614
+ context: () => ({
615
+ id: this.id(),
616
+ ids: this.ids(),
617
+ value: this.value(),
618
+ defaultValue: this.defaultValue(),
619
+ format: this.format(),
620
+ defaultFormat: this.defaultFormat(),
621
+ open: this.open(),
622
+ defaultOpen: this.defaultOpen(),
623
+ disabled: this.disabled() || this.formDisabled(),
624
+ readOnly: this.readOnly(),
625
+ required: this.required(),
626
+ invalid: this.invalid(),
627
+ inline: this.inline(),
628
+ closeOnSelect: this.closeOnSelect(),
629
+ openAutoFocus: this.openAutoFocus(),
630
+ name: this.name(),
631
+ positioning: this.positioning(),
632
+ initialFocusEl: this.initialFocusEl(),
633
+ onValueChange: (details) => this.syncValue(details),
634
+ onValueChangeEnd: (details) => this.valueChangeEnd.emit(details),
635
+ onFormatChange: (details) => {
636
+ if (this.format() === details.format)
637
+ return;
638
+ this.format.set(details.format);
639
+ },
640
+ onOpenChange: (details) => {
641
+ if (this.open() !== details.open)
642
+ this.open.set(details.open);
643
+ if (!details.open)
644
+ this.cva.markTouched();
645
+ },
646
+ onFocusOutside: (event) => this.focusOutside.emit(event),
647
+ onPointerDownOutside: (event) => this.pointerDownOutside.emit(event),
648
+ onInteractOutside: (event) => this.interactOutside.emit(event),
649
+ }),
650
+ });
651
+ state = this.machine.state;
652
+ api = this.machine.api;
653
+ service = this.machine.service;
654
+ send = this.machine.send;
655
+ contextCarrier = buildRootCarrier({
656
+ root: this,
657
+ rootToken: COLOR_PICKER_CONTEXT,
658
+ originInjector: inject(Injector),
659
+ environmentInjector: inject(EnvironmentInjector),
660
+ });
661
+ constructor() {
662
+ let firstRun = true;
663
+ effect(() => {
664
+ void this.value();
665
+ if (firstRun) {
666
+ firstRun = false;
667
+ this.pendingInternalWrites = 0;
668
+ return;
669
+ }
670
+ if (this.pendingInternalWrites > 0) {
671
+ this.pendingInternalWrites--;
672
+ return;
673
+ }
674
+ this.hasExternalBinding = true;
675
+ });
676
+ bindProps({
677
+ elementRef: inject(ElementRef),
678
+ renderer: inject(Renderer2),
679
+ destroyRef: inject(DestroyRef),
680
+ props: () => this.api().getRootProps(),
681
+ });
682
+ }
683
+ writeValue(value) {
684
+ const next = value === null ? undefined : value;
685
+ const current = this.value();
686
+ if (!this.hasReceivedFormWrite && current !== undefined) {
687
+ this.hasExternalBinding = true;
688
+ }
689
+ this.hasReceivedFormWrite = true;
690
+ if (!colorsEqual(current, next)) {
691
+ this.pendingInternalWrites++;
692
+ }
693
+ this.cva.writeValue(value);
694
+ }
695
+ registerOnChange(fn) {
696
+ this.cva.registerOnChange(fn);
697
+ }
698
+ registerOnTouched(fn) {
699
+ this.cva.registerOnTouched(fn);
700
+ }
701
+ setDisabledState(disabled) {
702
+ this.cva.setDisabledState(disabled);
703
+ }
704
+ getContextCarrier() {
705
+ return this.contextCarrier;
706
+ }
707
+ syncValue(details) {
708
+ if (colorsEqual(this.value(), details.value))
709
+ return;
710
+ this.pendingInternalWrites++;
711
+ this.value.set(details.value);
712
+ this.cva.notifyValueChange(details.value);
713
+ this.cva.markTouched();
714
+ }
715
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: ColorPickerRoot, deps: [], target: i0.ɵɵFactoryTarget.Directive });
716
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.3", type: ColorPickerRoot, isStandalone: true, selector: "[colorPickerRoot]", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, ids: { classPropertyName: "ids", publicName: "ids", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, defaultValue: { classPropertyName: "defaultValue", publicName: "defaultValue", isSignal: true, isRequired: false, transformFunction: null }, format: { classPropertyName: "format", publicName: "format", isSignal: true, isRequired: false, transformFunction: null }, defaultFormat: { classPropertyName: "defaultFormat", publicName: "defaultFormat", isSignal: true, isRequired: false, transformFunction: null }, open: { classPropertyName: "open", publicName: "open", isSignal: true, isRequired: false, transformFunction: null }, defaultOpen: { classPropertyName: "defaultOpen", publicName: "defaultOpen", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, readOnly: { classPropertyName: "readOnly", publicName: "readOnly", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, inline: { classPropertyName: "inline", publicName: "inline", isSignal: true, isRequired: false, transformFunction: null }, closeOnSelect: { classPropertyName: "closeOnSelect", publicName: "closeOnSelect", isSignal: true, isRequired: false, transformFunction: null }, openAutoFocus: { classPropertyName: "openAutoFocus", publicName: "openAutoFocus", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, positioning: { classPropertyName: "positioning", publicName: "positioning", isSignal: true, isRequired: false, transformFunction: null }, initialFocusEl: { classPropertyName: "initialFocusEl", publicName: "initialFocusEl", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", format: "formatChange", open: "openChange", valueChangeEnd: "valueChangeEnd", focusOutside: "focusOutside", pointerDownOutside: "pointerDownOutside", interactOutside: "interactOutside" }, providers: [
717
+ { provide: COLOR_PICKER_CONTEXT, useExisting: forwardRef(() => ColorPickerRoot) },
718
+ {
719
+ provide: COLOR_PICKER_CONTEXT_CARRIER,
720
+ useFactory: (root) => root.getContextCarrier(),
721
+ deps: [forwardRef(() => ColorPickerRoot)],
722
+ },
723
+ {
724
+ provide: NG_VALUE_ACCESSOR,
725
+ useExisting: forwardRef(() => ColorPickerRoot),
726
+ multi: true,
727
+ },
728
+ ], exportAs: ["colorPickerRoot"], ngImport: i0 });
729
+ }
730
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: ColorPickerRoot, decorators: [{
731
+ type: Directive,
732
+ args: [{
733
+ selector: "[colorPickerRoot]",
734
+ standalone: true,
735
+ exportAs: "colorPickerRoot",
736
+ providers: [
737
+ { provide: COLOR_PICKER_CONTEXT, useExisting: forwardRef(() => ColorPickerRoot) },
738
+ {
739
+ provide: COLOR_PICKER_CONTEXT_CARRIER,
740
+ useFactory: (root) => root.getContextCarrier(),
741
+ deps: [forwardRef(() => ColorPickerRoot)],
742
+ },
743
+ {
744
+ provide: NG_VALUE_ACCESSOR,
745
+ useExisting: forwardRef(() => ColorPickerRoot),
746
+ multi: true,
747
+ },
748
+ ],
749
+ }]
750
+ }], ctorParameters: () => [], propDecorators: { id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], ids: [{ type: i0.Input, args: [{ isSignal: true, alias: "ids", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], defaultValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "defaultValue", required: false }] }], format: [{ type: i0.Input, args: [{ isSignal: true, alias: "format", required: false }] }, { type: i0.Output, args: ["formatChange"] }], defaultFormat: [{ type: i0.Input, args: [{ isSignal: true, alias: "defaultFormat", required: false }] }], open: [{ type: i0.Input, args: [{ isSignal: true, alias: "open", required: false }] }, { type: i0.Output, args: ["openChange"] }], defaultOpen: [{ type: i0.Input, args: [{ isSignal: true, alias: "defaultOpen", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], readOnly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readOnly", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], inline: [{ type: i0.Input, args: [{ isSignal: true, alias: "inline", required: false }] }], closeOnSelect: [{ type: i0.Input, args: [{ isSignal: true, alias: "closeOnSelect", required: false }] }], openAutoFocus: [{ type: i0.Input, args: [{ isSignal: true, alias: "openAutoFocus", required: false }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], positioning: [{ type: i0.Input, args: [{ isSignal: true, alias: "positioning", required: false }] }], initialFocusEl: [{ type: i0.Input, args: [{ isSignal: true, alias: "initialFocusEl", required: false }] }], valueChangeEnd: [{ type: i0.Output, args: ["valueChangeEnd"] }], focusOutside: [{ type: i0.Output, args: ["focusOutside"] }], pointerDownOutside: [{ type: i0.Output, args: ["pointerDownOutside"] }], interactOutside: [{ type: i0.Output, args: ["interactOutside"] }] } });
751
+ function colorsEqual(a, b) {
752
+ if (a === b)
753
+ return true;
754
+ if (!a || !b)
755
+ return false;
756
+ return a.toString("css") === b.toString("css");
757
+ }
758
+
759
+ class ColorPickerRootProvider {
760
+ value = input.required(/* @ts-ignore */
761
+ ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
762
+ state = computed(() => this.value().state(), /* @ts-ignore */
763
+ ...(ngDevMode ? [{ debugName: "state" }] : /* istanbul ignore next */ []));
764
+ api = computed(() => this.value().api(), /* @ts-ignore */
765
+ ...(ngDevMode ? [{ debugName: "api" }] : /* istanbul ignore next */ []));
766
+ send = (event) => this.value().send(event);
767
+ get service() {
768
+ return this.value().service;
769
+ }
770
+ contextCarrier = buildRootCarrier({
771
+ root: this,
772
+ rootToken: COLOR_PICKER_CONTEXT,
773
+ originInjector: inject(Injector),
774
+ environmentInjector: inject(EnvironmentInjector),
775
+ });
776
+ constructor() {
777
+ bindProps({
778
+ elementRef: inject(ElementRef),
779
+ renderer: inject(Renderer2),
780
+ destroyRef: inject(DestroyRef),
781
+ props: () => this.api().getRootProps(),
782
+ });
783
+ }
784
+ getContextCarrier() {
785
+ return this.contextCarrier;
786
+ }
787
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: ColorPickerRootProvider, deps: [], target: i0.ɵɵFactoryTarget.Directive });
788
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.3", type: ColorPickerRootProvider, isStandalone: true, selector: "[colorPickerRootProvider]", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: true, transformFunction: null } }, providers: [
789
+ { provide: COLOR_PICKER_CONTEXT, useExisting: forwardRef(() => ColorPickerRootProvider) },
790
+ {
791
+ provide: COLOR_PICKER_CONTEXT_CARRIER,
792
+ useFactory: (provider) => provider.getContextCarrier(),
793
+ deps: [forwardRef(() => ColorPickerRootProvider)],
794
+ },
795
+ ], exportAs: ["colorPickerRootProvider"], ngImport: i0 });
796
+ }
797
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: ColorPickerRootProvider, decorators: [{
798
+ type: Directive,
799
+ args: [{
800
+ selector: "[colorPickerRootProvider]",
801
+ standalone: true,
802
+ exportAs: "colorPickerRootProvider",
803
+ providers: [
804
+ { provide: COLOR_PICKER_CONTEXT, useExisting: forwardRef(() => ColorPickerRootProvider) },
805
+ {
806
+ provide: COLOR_PICKER_CONTEXT_CARRIER,
807
+ useFactory: (provider) => provider.getContextCarrier(),
808
+ deps: [forwardRef(() => ColorPickerRootProvider)],
809
+ },
810
+ ],
811
+ }]
812
+ }], ctorParameters: () => [], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: true }] }] } });
813
+
814
+ class ColorPickerSwatch {
815
+ value = input.required(/* @ts-ignore */
816
+ ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
817
+ respectAlpha = input(true, { ...(ngDevMode ? { debugName: "respectAlpha" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
818
+ swatchProps = computed(() => ({
819
+ value: this.value(),
820
+ respectAlpha: this.respectAlpha(),
821
+ }), /* @ts-ignore */
822
+ ...(ngDevMode ? [{ debugName: "swatchProps" }] : /* istanbul ignore next */ []));
823
+ constructor() {
824
+ const context = injectColorPickerContext();
825
+ bindProps({
826
+ elementRef: inject(ElementRef),
827
+ renderer: inject(Renderer2),
828
+ destroyRef: inject(DestroyRef),
829
+ props: () => context.api().getSwatchProps(this.swatchProps()),
830
+ });
831
+ }
832
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: ColorPickerSwatch, deps: [], target: i0.ɵɵFactoryTarget.Directive });
833
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.3", type: ColorPickerSwatch, isStandalone: true, selector: "[colorPickerSwatch]", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: true, transformFunction: null }, respectAlpha: { classPropertyName: "respectAlpha", publicName: "respectAlpha", isSignal: true, isRequired: false, transformFunction: null } }, providers: [
834
+ {
835
+ provide: COLOR_PICKER_SWATCH_PROPS,
836
+ useFactory: (swatch) => swatch.swatchProps,
837
+ deps: [forwardRef(() => ColorPickerSwatch)],
838
+ },
839
+ ], exportAs: ["colorPickerSwatch"], ngImport: i0 });
840
+ }
841
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: ColorPickerSwatch, decorators: [{
842
+ type: Directive,
843
+ args: [{
844
+ selector: "[colorPickerSwatch]",
845
+ standalone: true,
846
+ exportAs: "colorPickerSwatch",
847
+ providers: [
848
+ {
849
+ provide: COLOR_PICKER_SWATCH_PROPS,
850
+ useFactory: (swatch) => swatch.swatchProps,
851
+ deps: [forwardRef(() => ColorPickerSwatch)],
852
+ },
853
+ ],
854
+ }]
855
+ }], ctorParameters: () => [], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: true }] }], respectAlpha: [{ type: i0.Input, args: [{ isSignal: true, alias: "respectAlpha", required: false }] }] } });
856
+
857
+ class ColorPickerSwatchGroup {
858
+ constructor() {
859
+ const context = injectColorPickerContext();
860
+ bindProps({
861
+ elementRef: inject(ElementRef),
862
+ renderer: inject(Renderer2),
863
+ destroyRef: inject(DestroyRef),
864
+ props: () => context.api().getSwatchGroupProps(),
865
+ });
866
+ }
867
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: ColorPickerSwatchGroup, deps: [], target: i0.ɵɵFactoryTarget.Directive });
868
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.3", type: ColorPickerSwatchGroup, isStandalone: true, selector: "[colorPickerSwatchGroup]", exportAs: ["colorPickerSwatchGroup"], ngImport: i0 });
869
+ }
870
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: ColorPickerSwatchGroup, decorators: [{
871
+ type: Directive,
872
+ args: [{
873
+ selector: "[colorPickerSwatchGroup]",
874
+ standalone: true,
875
+ exportAs: "colorPickerSwatchGroup",
876
+ }]
877
+ }], ctorParameters: () => [] });
878
+
879
+ class ColorPickerSwatchIndicator {
880
+ constructor() {
881
+ const context = injectColorPickerContext();
882
+ const swatchProps = injectColorPickerSwatchProps();
883
+ bindProps({
884
+ elementRef: inject(ElementRef),
885
+ renderer: inject(Renderer2),
886
+ destroyRef: inject(DestroyRef),
887
+ props: () => context.api().getSwatchIndicatorProps(swatchProps()),
888
+ });
889
+ }
890
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: ColorPickerSwatchIndicator, deps: [], target: i0.ɵɵFactoryTarget.Directive });
891
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.3", type: ColorPickerSwatchIndicator, isStandalone: true, selector: "[colorPickerSwatchIndicator]", exportAs: ["colorPickerSwatchIndicator"], ngImport: i0 });
892
+ }
893
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: ColorPickerSwatchIndicator, decorators: [{
894
+ type: Directive,
895
+ args: [{
896
+ selector: "[colorPickerSwatchIndicator]",
897
+ standalone: true,
898
+ exportAs: "colorPickerSwatchIndicator",
899
+ }]
900
+ }], ctorParameters: () => [] });
901
+
902
+ class ColorPickerSwatchTrigger {
903
+ value = input.required(/* @ts-ignore */
904
+ ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
905
+ disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
906
+ constructor() {
907
+ const context = injectColorPickerContext();
908
+ bindProps({
909
+ elementRef: inject(ElementRef),
910
+ renderer: inject(Renderer2),
911
+ destroyRef: inject(DestroyRef),
912
+ props: () => context.api().getSwatchTriggerProps({ value: this.value(), disabled: this.disabled() }),
913
+ });
914
+ }
915
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: ColorPickerSwatchTrigger, deps: [], target: i0.ɵɵFactoryTarget.Directive });
916
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.3", type: ColorPickerSwatchTrigger, isStandalone: true, selector: "button[colorPickerSwatchTrigger]", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: true, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, exportAs: ["colorPickerSwatchTrigger"], ngImport: i0 });
917
+ }
918
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: ColorPickerSwatchTrigger, decorators: [{
919
+ type: Directive,
920
+ args: [{
921
+ selector: "button[colorPickerSwatchTrigger]",
922
+ standalone: true,
923
+ exportAs: "colorPickerSwatchTrigger",
924
+ }]
925
+ }], ctorParameters: () => [], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: true }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }] } });
926
+
927
+ class ColorPickerTransparencyGrid {
928
+ size = input(undefined, /* @ts-ignore */
929
+ ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
930
+ constructor() {
931
+ const context = injectColorPickerContext();
932
+ bindProps({
933
+ elementRef: inject(ElementRef),
934
+ renderer: inject(Renderer2),
935
+ destroyRef: inject(DestroyRef),
936
+ props: () => context.api().getTransparencyGridProps({ size: this.size() }),
937
+ });
938
+ }
939
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: ColorPickerTransparencyGrid, deps: [], target: i0.ɵɵFactoryTarget.Directive });
940
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.3", type: ColorPickerTransparencyGrid, isStandalone: true, selector: "[colorPickerTransparencyGrid]", inputs: { size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null } }, exportAs: ["colorPickerTransparencyGrid"], ngImport: i0 });
941
+ }
942
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: ColorPickerTransparencyGrid, decorators: [{
943
+ type: Directive,
944
+ args: [{
945
+ selector: "[colorPickerTransparencyGrid]",
946
+ standalone: true,
947
+ exportAs: "colorPickerTransparencyGrid",
948
+ }]
949
+ }], ctorParameters: () => [], propDecorators: { size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }] } });
950
+
951
+ class ColorPickerTrigger {
952
+ constructor() {
953
+ const context = injectColorPickerContext();
954
+ bindProps({
955
+ elementRef: inject(ElementRef),
956
+ renderer: inject(Renderer2),
957
+ destroyRef: inject(DestroyRef),
958
+ props: () => context.api().getTriggerProps(),
959
+ });
960
+ }
961
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: ColorPickerTrigger, deps: [], target: i0.ɵɵFactoryTarget.Directive });
962
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.3", type: ColorPickerTrigger, isStandalone: true, selector: "button[colorPickerTrigger]", exportAs: ["colorPickerTrigger"], ngImport: i0 });
963
+ }
964
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: ColorPickerTrigger, decorators: [{
965
+ type: Directive,
966
+ args: [{
967
+ selector: "button[colorPickerTrigger]",
968
+ standalone: true,
969
+ exportAs: "colorPickerTrigger",
970
+ }]
971
+ }], ctorParameters: () => [] });
972
+
973
+ class ColorPickerValueSwatch {
974
+ respectAlpha = input(true, { ...(ngDevMode ? { debugName: "respectAlpha" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
975
+ context = injectColorPickerContext();
976
+ swatchProps = computed(() => ({
977
+ value: this.context.api().valueAsString,
978
+ respectAlpha: this.respectAlpha(),
979
+ }), /* @ts-ignore */
980
+ ...(ngDevMode ? [{ debugName: "swatchProps" }] : /* istanbul ignore next */ []));
981
+ constructor() {
982
+ bindProps({
983
+ elementRef: inject(ElementRef),
984
+ renderer: inject(Renderer2),
985
+ destroyRef: inject(DestroyRef),
986
+ props: () => this.context.api().getSwatchProps(this.swatchProps()),
987
+ });
988
+ }
989
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: ColorPickerValueSwatch, deps: [], target: i0.ɵɵFactoryTarget.Directive });
990
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.3", type: ColorPickerValueSwatch, isStandalone: true, selector: "[colorPickerValueSwatch]", inputs: { respectAlpha: { classPropertyName: "respectAlpha", publicName: "respectAlpha", isSignal: true, isRequired: false, transformFunction: null } }, providers: [
991
+ {
992
+ provide: COLOR_PICKER_SWATCH_PROPS,
993
+ useFactory: (swatch) => swatch.swatchProps,
994
+ deps: [forwardRef(() => ColorPickerValueSwatch)],
995
+ },
996
+ ], exportAs: ["colorPickerValueSwatch"], ngImport: i0 });
997
+ }
998
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: ColorPickerValueSwatch, decorators: [{
999
+ type: Directive,
1000
+ args: [{
1001
+ selector: "[colorPickerValueSwatch]",
1002
+ standalone: true,
1003
+ exportAs: "colorPickerValueSwatch",
1004
+ providers: [
1005
+ {
1006
+ provide: COLOR_PICKER_SWATCH_PROPS,
1007
+ useFactory: (swatch) => swatch.swatchProps,
1008
+ deps: [forwardRef(() => ColorPickerValueSwatch)],
1009
+ },
1010
+ ],
1011
+ }]
1012
+ }], ctorParameters: () => [], propDecorators: { respectAlpha: [{ type: i0.Input, args: [{ isSignal: true, alias: "respectAlpha", required: false }] }] } });
1013
+
1014
+ class ColorPickerValueText {
1015
+ format = input(undefined, /* @ts-ignore */
1016
+ ...(ngDevMode ? [{ debugName: "format" }] : /* istanbul ignore next */ []));
1017
+ ownsTextContent = signal(false, /* @ts-ignore */
1018
+ ...(ngDevMode ? [{ debugName: "ownsTextContent" }] : /* istanbul ignore next */ []));
1019
+ elementRef = inject(ElementRef);
1020
+ constructor() {
1021
+ const context = injectColorPickerContext();
1022
+ const renderer = inject(Renderer2);
1023
+ bindProps({
1024
+ elementRef: this.elementRef,
1025
+ renderer,
1026
+ destroyRef: inject(DestroyRef),
1027
+ props: () => context.api().getValueTextProps(),
1028
+ });
1029
+ effect(() => {
1030
+ if (!this.ownsTextContent())
1031
+ return;
1032
+ const api = context.api();
1033
+ const value = this.format() ? api.value.toString(this.format()) : api.valueAsString;
1034
+ renderer.setProperty(this.elementRef.nativeElement, "textContent", value);
1035
+ });
1036
+ }
1037
+ ngAfterContentInit() {
1038
+ this.ownsTextContent.set(this.elementRef.nativeElement.childNodes.length === 0);
1039
+ }
1040
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: ColorPickerValueText, deps: [], target: i0.ɵɵFactoryTarget.Directive });
1041
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.3", type: ColorPickerValueText, isStandalone: true, selector: "[colorPickerValueText]", inputs: { format: { classPropertyName: "format", publicName: "format", isSignal: true, isRequired: false, transformFunction: null } }, exportAs: ["colorPickerValueText"], ngImport: i0 });
1042
+ }
1043
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: ColorPickerValueText, decorators: [{
1044
+ type: Directive,
1045
+ args: [{
1046
+ selector: "[colorPickerValueText]",
1047
+ standalone: true,
1048
+ exportAs: "colorPickerValueText",
1049
+ }]
1050
+ }], ctorParameters: () => [], propDecorators: { format: [{ type: i0.Input, args: [{ isSignal: true, alias: "format", required: false }] }] } });
1051
+
1052
+ class ColorPickerView {
1053
+ format = input.required(/* @ts-ignore */
1054
+ ...(ngDevMode ? [{ debugName: "format" }] : /* istanbul ignore next */ []));
1055
+ formatProps = computed(() => ({
1056
+ format: this.format(),
1057
+ }), /* @ts-ignore */
1058
+ ...(ngDevMode ? [{ debugName: "formatProps" }] : /* istanbul ignore next */ []));
1059
+ constructor() {
1060
+ const context = injectColorPickerContext();
1061
+ bindProps({
1062
+ elementRef: inject(ElementRef),
1063
+ renderer: inject(Renderer2),
1064
+ destroyRef: inject(DestroyRef),
1065
+ props: () => ({
1066
+ "data-scope": "color-picker",
1067
+ "data-part": "view",
1068
+ "data-format": this.format(),
1069
+ hidden: context.api().format !== this.format(),
1070
+ }),
1071
+ });
1072
+ }
1073
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: ColorPickerView, deps: [], target: i0.ɵɵFactoryTarget.Directive });
1074
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.3", type: ColorPickerView, isStandalone: true, selector: "[colorPickerView]", inputs: { format: { classPropertyName: "format", publicName: "format", isSignal: true, isRequired: true, transformFunction: null } }, providers: [
1075
+ {
1076
+ provide: COLOR_PICKER_FORMAT_PROPS,
1077
+ useFactory: (view) => view.formatProps,
1078
+ deps: [forwardRef(() => ColorPickerView)],
1079
+ },
1080
+ ], exportAs: ["colorPickerView"], ngImport: i0 });
1081
+ }
1082
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: ColorPickerView, decorators: [{
1083
+ type: Directive,
1084
+ args: [{
1085
+ selector: "[colorPickerView]",
1086
+ standalone: true,
1087
+ exportAs: "colorPickerView",
1088
+ providers: [
1089
+ {
1090
+ provide: COLOR_PICKER_FORMAT_PROPS,
1091
+ useFactory: (view) => view.formatProps,
1092
+ deps: [forwardRef(() => ColorPickerView)],
1093
+ },
1094
+ ],
1095
+ }]
1096
+ }], ctorParameters: () => [], propDecorators: { format: [{ type: i0.Input, args: [{ isSignal: true, alias: "format", required: true }] }] } });
1097
+
1098
+ /**
1099
+ * Generated bundle index. Do not edit.
1100
+ */
1101
+
1102
+ export { COLOR_PICKER_CONTEXT, COLOR_PICKER_CONTEXT_CARRIER, ColorPickerArea, ColorPickerAreaBackground, ColorPickerAreaThumb, ColorPickerChannelInput, ColorPickerChannelSlider, ColorPickerChannelSliderLabel, ColorPickerChannelSliderThumb, ColorPickerChannelSliderTrack, ColorPickerChannelSliderValueText, ColorPickerContent, ColorPickerContext, ColorPickerControl, ColorPickerEyeDropperTrigger, ColorPickerFormatSelect, ColorPickerFormatTrigger, ColorPickerHiddenInput, ColorPickerLabel, ColorPickerPositioner, ColorPickerRoot, ColorPickerRootProvider, ColorPickerSwatch, ColorPickerSwatchGroup, ColorPickerSwatchIndicator, ColorPickerSwatchTrigger, ColorPickerTransparencyGrid, ColorPickerTrigger, ColorPickerValueSwatch, ColorPickerValueText, ColorPickerView, colorPickerAnatomy, injectColorPickerContext, injectColorPickerContextCarrier, useColorPicker };
1103
+ //# sourceMappingURL=wirekyt-angular-color-picker.mjs.map