@ng-nest/ui 18.0.15 → 18.0.16

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,28 @@
1
+ import { Directive, HostListener, inject, input } from '@angular/core';
2
+ import { XColorPickerComponent } from './color-picker.component';
3
+ import { XColorPickerColorMap } from './color-map.data';
4
+ import * as i0 from "@angular/core";
5
+ export class XColorPickerOptionDirective {
6
+ constructor() {
7
+ this.color = input.required({ alias: 'x-color-picker-option' });
8
+ this.colorPicker = inject(XColorPickerComponent, { optional: true });
9
+ }
10
+ onSelectClick() {
11
+ if (!this.colorPicker)
12
+ return;
13
+ this.colorPicker.value.set(XColorPickerColorMap[this.color()] || this.color());
14
+ }
15
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: XColorPickerOptionDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
16
+ /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "18.2.2", type: XColorPickerOptionDirective, isStandalone: true, selector: "[x-color-picker-option], x-color-picker-option", inputs: { color: { classPropertyName: "color", publicName: "x-color-picker-option", isSignal: true, isRequired: true, transformFunction: null } }, host: { listeners: { "click": "onSelectClick($event)" } }, ngImport: i0 }); }
17
+ }
18
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: XColorPickerOptionDirective, decorators: [{
19
+ type: Directive,
20
+ args: [{
21
+ standalone: true,
22
+ selector: `[x-color-picker-option], x-color-picker-option`
23
+ }]
24
+ }], propDecorators: { onSelectClick: [{
25
+ type: HostListener,
26
+ args: ['click', ['$event']]
27
+ }] } });
28
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29sb3ItcGlja2VyLmRpcmVjdGl2ZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL2xpYi9uZy1uZXN0L3VpL2NvbG9yLXBpY2tlci9jb2xvci1waWNrZXIuZGlyZWN0aXZlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxTQUFTLEVBQUUsWUFBWSxFQUFFLE1BQU0sRUFBRSxLQUFLLEVBQUUsTUFBTSxlQUFlLENBQUM7QUFDdkUsT0FBTyxFQUFFLHFCQUFxQixFQUFFLE1BQU0sMEJBQTBCLENBQUM7QUFDakUsT0FBTyxFQUFFLG9CQUFvQixFQUFFLE1BQU0sa0JBQWtCLENBQUM7O0FBTXhELE1BQU0sT0FBTywyQkFBMkI7SUFKeEM7UUFLRSxVQUFLLEdBQUcsS0FBSyxDQUFDLFFBQVEsQ0FBUyxFQUFFLEtBQUssRUFBRSx1QkFBdUIsRUFBRSxDQUFDLENBQUM7UUFNbkUsZ0JBQVcsR0FBRyxNQUFNLENBQUMscUJBQXFCLEVBQUUsRUFBRSxRQUFRLEVBQUUsSUFBSSxFQUFFLENBQUMsQ0FBQztLQUNqRTtJQUxvQyxhQUFhO1FBQzlDLElBQUksQ0FBQyxJQUFJLENBQUMsV0FBVztZQUFFLE9BQU87UUFDOUIsSUFBSSxDQUFDLFdBQVcsQ0FBQyxLQUFLLENBQUMsR0FBRyxDQUFDLG9CQUFvQixDQUFDLElBQUksQ0FBQyxLQUFLLEVBQUUsQ0FBQyxJQUFJLElBQUksQ0FBQyxLQUFLLEVBQUUsQ0FBQyxDQUFDO0lBQ2pGLENBQUM7aUlBTlUsMkJBQTJCO3FIQUEzQiwyQkFBMkI7OzJGQUEzQiwyQkFBMkI7a0JBSnZDLFNBQVM7bUJBQUM7b0JBQ1QsVUFBVSxFQUFFLElBQUk7b0JBQ2hCLFFBQVEsRUFBRSxnREFBZ0Q7aUJBQzNEOzhCQUlvQyxhQUFhO3NCQUEvQyxZQUFZO3VCQUFDLE9BQU8sRUFBRSxDQUFDLFFBQVEsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IERpcmVjdGl2ZSwgSG9zdExpc3RlbmVyLCBpbmplY3QsIGlucHV0IH0gZnJvbSAnQGFuZ3VsYXIvY29yZSc7XHJcbmltcG9ydCB7IFhDb2xvclBpY2tlckNvbXBvbmVudCB9IGZyb20gJy4vY29sb3ItcGlja2VyLmNvbXBvbmVudCc7XHJcbmltcG9ydCB7IFhDb2xvclBpY2tlckNvbG9yTWFwIH0gZnJvbSAnLi9jb2xvci1tYXAuZGF0YSc7XHJcblxyXG5ARGlyZWN0aXZlKHtcclxuICBzdGFuZGFsb25lOiB0cnVlLFxyXG4gIHNlbGVjdG9yOiBgW3gtY29sb3ItcGlja2VyLW9wdGlvbl0sIHgtY29sb3ItcGlja2VyLW9wdGlvbmBcclxufSlcclxuZXhwb3J0IGNsYXNzIFhDb2xvclBpY2tlck9wdGlvbkRpcmVjdGl2ZSB7XHJcbiAgY29sb3IgPSBpbnB1dC5yZXF1aXJlZDxzdHJpbmc+KHsgYWxpYXM6ICd4LWNvbG9yLXBpY2tlci1vcHRpb24nIH0pO1xyXG5cclxuICBASG9zdExpc3RlbmVyKCdjbGljaycsIFsnJGV2ZW50J10pIG9uU2VsZWN0Q2xpY2soKSB7XHJcbiAgICBpZiAoIXRoaXMuY29sb3JQaWNrZXIpIHJldHVybjtcclxuICAgIHRoaXMuY29sb3JQaWNrZXIudmFsdWUuc2V0KFhDb2xvclBpY2tlckNvbG9yTWFwW3RoaXMuY29sb3IoKV0gfHwgdGhpcy5jb2xvcigpKTtcclxuICB9XHJcbiAgY29sb3JQaWNrZXIgPSBpbmplY3QoWENvbG9yUGlja2VyQ29tcG9uZW50LCB7IG9wdGlvbmFsOiB0cnVlIH0pO1xyXG59XHJcbiJdfQ==
@@ -1,16 +1,17 @@
1
1
  import { NgModule } from '@angular/core';
2
2
  import { XColorPickerComponent } from './color-picker.component';
3
+ import { XColorPickerOptionDirective } from './color-picker.directive';
3
4
  import * as i0 from "@angular/core";
4
5
  export class XColorPickerModule {
5
6
  /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: XColorPickerModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
6
- /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.2", ngImport: i0, type: XColorPickerModule, imports: [XColorPickerComponent], exports: [XColorPickerComponent] }); }
7
+ /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.2", ngImport: i0, type: XColorPickerModule, imports: [XColorPickerComponent, XColorPickerOptionDirective], exports: [XColorPickerComponent, XColorPickerOptionDirective] }); }
7
8
  /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: XColorPickerModule, imports: [XColorPickerComponent] }); }
8
9
  }
9
10
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: XColorPickerModule, decorators: [{
10
11
  type: NgModule,
11
12
  args: [{
12
- imports: [XColorPickerComponent],
13
- exports: [XColorPickerComponent]
13
+ imports: [XColorPickerComponent, XColorPickerOptionDirective],
14
+ exports: [XColorPickerComponent, XColorPickerOptionDirective]
14
15
  }]
15
16
  }] });
16
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29sb3ItcGlja2VyLm1vZHVsZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL2xpYi9uZy1uZXN0L3VpL2NvbG9yLXBpY2tlci9jb2xvci1waWNrZXIubW9kdWxlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxRQUFRLEVBQUUsTUFBTSxlQUFlLENBQUM7QUFDekMsT0FBTyxFQUFFLHFCQUFxQixFQUFFLE1BQU0sMEJBQTBCLENBQUM7O0FBTWpFLE1BQU0sT0FBTyxrQkFBa0I7aUlBQWxCLGtCQUFrQjtrSUFBbEIsa0JBQWtCLFlBSG5CLHFCQUFxQixhQUNyQixxQkFBcUI7a0lBRXBCLGtCQUFrQixZQUhuQixxQkFBcUI7OzJGQUdwQixrQkFBa0I7a0JBSjlCLFFBQVE7bUJBQUM7b0JBQ1IsT0FBTyxFQUFFLENBQUMscUJBQXFCLENBQUM7b0JBQ2hDLE9BQU8sRUFBRSxDQUFDLHFCQUFxQixDQUFDO2lCQUNqQyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IE5nTW9kdWxlIH0gZnJvbSAnQGFuZ3VsYXIvY29yZSc7XHJcbmltcG9ydCB7IFhDb2xvclBpY2tlckNvbXBvbmVudCB9IGZyb20gJy4vY29sb3ItcGlja2VyLmNvbXBvbmVudCc7XHJcblxyXG5ATmdNb2R1bGUoe1xyXG4gIGltcG9ydHM6IFtYQ29sb3JQaWNrZXJDb21wb25lbnRdLFxyXG4gIGV4cG9ydHM6IFtYQ29sb3JQaWNrZXJDb21wb25lbnRdXHJcbn0pXHJcbmV4cG9ydCBjbGFzcyBYQ29sb3JQaWNrZXJNb2R1bGUge31cclxuIl19
17
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29sb3ItcGlja2VyLm1vZHVsZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL2xpYi9uZy1uZXN0L3VpL2NvbG9yLXBpY2tlci9jb2xvci1waWNrZXIubW9kdWxlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxRQUFRLEVBQUUsTUFBTSxlQUFlLENBQUM7QUFDekMsT0FBTyxFQUFFLHFCQUFxQixFQUFFLE1BQU0sMEJBQTBCLENBQUM7QUFDakUsT0FBTyxFQUFFLDJCQUEyQixFQUFFLE1BQU0sMEJBQTBCLENBQUM7O0FBTXZFLE1BQU0sT0FBTyxrQkFBa0I7aUlBQWxCLGtCQUFrQjtrSUFBbEIsa0JBQWtCLFlBSG5CLHFCQUFxQixFQUFFLDJCQUEyQixhQUNsRCxxQkFBcUIsRUFBRSwyQkFBMkI7a0lBRWpELGtCQUFrQixZQUhuQixxQkFBcUI7OzJGQUdwQixrQkFBa0I7a0JBSjlCLFFBQVE7bUJBQUM7b0JBQ1IsT0FBTyxFQUFFLENBQUMscUJBQXFCLEVBQUUsMkJBQTJCLENBQUM7b0JBQzdELE9BQU8sRUFBRSxDQUFDLHFCQUFxQixFQUFFLDJCQUEyQixDQUFDO2lCQUM5RCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IE5nTW9kdWxlIH0gZnJvbSAnQGFuZ3VsYXIvY29yZSc7XHJcbmltcG9ydCB7IFhDb2xvclBpY2tlckNvbXBvbmVudCB9IGZyb20gJy4vY29sb3ItcGlja2VyLmNvbXBvbmVudCc7XHJcbmltcG9ydCB7IFhDb2xvclBpY2tlck9wdGlvbkRpcmVjdGl2ZSB9IGZyb20gJy4vY29sb3ItcGlja2VyLmRpcmVjdGl2ZSc7XHJcblxyXG5ATmdNb2R1bGUoe1xyXG4gIGltcG9ydHM6IFtYQ29sb3JQaWNrZXJDb21wb25lbnQsIFhDb2xvclBpY2tlck9wdGlvbkRpcmVjdGl2ZV0sXHJcbiAgZXhwb3J0czogW1hDb2xvclBpY2tlckNvbXBvbmVudCwgWENvbG9yUGlja2VyT3B0aW9uRGlyZWN0aXZlXVxyXG59KVxyXG5leHBvcnQgY2xhc3MgWENvbG9yUGlja2VyTW9kdWxlIHt9XHJcbiJdfQ==
@@ -2,4 +2,5 @@ export * from './color-picker.component';
2
2
  export * from './color-picker-portal.component';
3
3
  export * from './color-picker.module';
4
4
  export * from './color-picker.property';
5
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljLWFwaS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL2xpYi9uZy1uZXN0L3VpL2NvbG9yLXBpY2tlci9wdWJsaWMtYXBpLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLGNBQWMsMEJBQTBCLENBQUM7QUFDekMsY0FBYyxpQ0FBaUMsQ0FBQztBQUNoRCxjQUFjLHVCQUF1QixDQUFDO0FBQ3RDLGNBQWMseUJBQXlCLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgKiBmcm9tICcuL2NvbG9yLXBpY2tlci5jb21wb25lbnQnO1xyXG5leHBvcnQgKiBmcm9tICcuL2NvbG9yLXBpY2tlci1wb3J0YWwuY29tcG9uZW50JztcclxuZXhwb3J0ICogZnJvbSAnLi9jb2xvci1waWNrZXIubW9kdWxlJztcclxuZXhwb3J0ICogZnJvbSAnLi9jb2xvci1waWNrZXIucHJvcGVydHknO1xyXG4iXX0=
5
+ export * from './color-picker.directive';
6
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljLWFwaS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL2xpYi9uZy1uZXN0L3VpL2NvbG9yLXBpY2tlci9wdWJsaWMtYXBpLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLGNBQWMsMEJBQTBCLENBQUM7QUFDekMsY0FBYyxpQ0FBaUMsQ0FBQztBQUNoRCxjQUFjLHVCQUF1QixDQUFDO0FBQ3RDLGNBQWMseUJBQXlCLENBQUM7QUFDeEMsY0FBYywwQkFBMEIsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCAqIGZyb20gJy4vY29sb3ItcGlja2VyLmNvbXBvbmVudCc7XHJcbmV4cG9ydCAqIGZyb20gJy4vY29sb3ItcGlja2VyLXBvcnRhbC5jb21wb25lbnQnO1xyXG5leHBvcnQgKiBmcm9tICcuL2NvbG9yLXBpY2tlci5tb2R1bGUnO1xyXG5leHBvcnQgKiBmcm9tICcuL2NvbG9yLXBpY2tlci5wcm9wZXJ0eSc7XHJcbmV4cG9ydCAqIGZyb20gJy4vY29sb3ItcGlja2VyLmRpcmVjdGl2ZSc7XHJcbiJdfQ==
@@ -1,10 +1,10 @@
1
1
  import * as i0 from '@angular/core';
2
- import { input, model, Component, viewChild, ElementRef, output, signal, inject, DestroyRef, Renderer2, ViewEncapsulation, ChangeDetectionStrategy, HostBinding, HostListener, computed, ViewContainerRef, effect, NgModule } from '@angular/core';
3
- import { XToBoolean, XToCssPixelValue, XConnectBaseAnimation, XComputed, XIsEmpty, XParents } from '@ng-nest/ui/core';
2
+ import { input, model, Component, viewChild, ElementRef, output, signal, inject, DestroyRef, Renderer2, ViewEncapsulation, ChangeDetectionStrategy, HostBinding, HostListener, computed, ViewContainerRef, effect, Directive, NgModule } from '@angular/core';
3
+ import { XToBoolean, XToCssPixelValue, XIsChange, XConnectBaseAnimation, XComputed, XIsEmpty, XParents } from '@ng-nest/ui/core';
4
4
  import { XFormControlFunction, XValueAccessor } from '@ng-nest/ui/base-form';
5
5
  import { XSliderSelectComponent } from '@ng-nest/ui/slider-select';
6
6
  import { Subject, fromEvent } from 'rxjs';
7
- import { DecimalPipe, PercentPipe, DOCUMENT } from '@angular/common';
7
+ import { DecimalPipe, PercentPipe, NgTemplateOutlet, DOCUMENT } from '@angular/common';
8
8
  import { XInputComponent } from '@ng-nest/ui/input';
9
9
  import * as i2 from '@angular/cdk/drag-drop';
10
10
  import { DragDropModule } from '@angular/cdk/drag-drop';
@@ -161,6 +161,7 @@ class XColorPickerPortalComponent {
161
161
  this.value = model('');
162
162
  this.inputCom = input();
163
163
  this.placement = input();
164
+ this.panelTemplate = input();
164
165
  this.animating = output();
165
166
  this.nodeClick = output();
166
167
  this.transparentRail = signal(null);
@@ -201,7 +202,6 @@ class XColorPickerPortalComponent {
201
202
  this.animating.emit(true);
202
203
  }
203
204
  ngOnInit() {
204
- this.colorConvert();
205
205
  this.destroyRef.onDestroy(() => {
206
206
  this.destroy.set(true);
207
207
  this.unSubject.next();
@@ -213,6 +213,14 @@ class XColorPickerPortalComponent {
213
213
  this.plate.set(this.plateRef().nativeElement.getBoundingClientRect());
214
214
  this.offset.set((this.panel().width - this.plate().width) / 2);
215
215
  this.transparentRail.set(this.transparentCom().elementRef.nativeElement.querySelector('.x-slider-select-rail div'));
216
+ this.setPanelValue();
217
+ }
218
+ ngOnChanges(simples) {
219
+ const { value } = simples;
220
+ if (XIsChange(value))
221
+ this.colorConvert();
222
+ }
223
+ setPanelValue() {
216
224
  this.setTransform();
217
225
  this.setPlateBackground();
218
226
  this.setRailBackground();
@@ -252,6 +260,7 @@ class XColorPickerPortalComponent {
252
260
  this.hex.set(this.rgbaToHex(this.rgba()));
253
261
  this.type.set('hsla');
254
262
  }
263
+ this.setPanelValue();
255
264
  }
256
265
  rgbaConvert(str) {
257
266
  let rgba = str
@@ -299,6 +308,8 @@ class XColorPickerPortalComponent {
299
308
  this.setLetfTop(left, top);
300
309
  }
301
310
  setTransform() {
311
+ if (!this.plate())
312
+ return;
302
313
  let hsv = this.hslToHsv(this.hsla().h, this.hsla().s, this.hsla().l);
303
314
  this.transformX.set(hsv.s * this.plate().width - this.offset());
304
315
  this.transformY.set((1 - hsv.v) * this.plate().height - this.offset());
@@ -366,9 +377,13 @@ class XColorPickerPortalComponent {
366
377
  this.setValue();
367
378
  }
368
379
  setPlateBackground() {
380
+ if (!this.plateRef())
381
+ return;
369
382
  this.renderer.setStyle(this.plateRef().nativeElement, 'background-color', `hsl(${this.hsla().h}, 100%, 50%)`);
370
383
  }
371
384
  setRailBackground() {
385
+ if (!this.transparentRail())
386
+ return;
372
387
  this.renderer.setStyle(this.transparentRail(), 'background', `linear-gradient(to right, rgba(${this.rgba().r}, ${this.rgba().g}, ${this.rgba().b}, 0) 0%, rgba(${this.rgba().r}, ${this.rgba().g}, ${this.rgba().b}, 1) 100%)`);
373
388
  }
374
389
  transparentChange() {
@@ -520,11 +535,19 @@ class XColorPickerPortalComponent {
520
535
  return result;
521
536
  }
522
537
  /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: XColorPickerPortalComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
523
- /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "18.2.2", type: XColorPickerPortalComponent, isStandalone: true, selector: "x-color-picker-portal", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, inputCom: { classPropertyName: "inputCom", publicName: "inputCom", isSignal: true, isRequired: false, transformFunction: null }, placement: { classPropertyName: "placement", publicName: "placement", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", animating: "animating", nodeClick: "nodeClick" }, host: { listeners: { "@x-connect-base-animation.done": "done($event)", "@x-connect-base-animation.start": "start($event)" }, properties: { "@x-connect-base-animation": "this.getPlacement" } }, providers: [DecimalPipe, PercentPipe], viewQueries: [{ propertyName: "panelRef", first: true, predicate: ["panelRef"], descendants: true, read: ElementRef, isSignal: true }, { propertyName: "plateRef", first: true, predicate: ["plateRef"], descendants: true, read: ElementRef, isSignal: true }, { propertyName: "transparentCom", first: true, predicate: ["transparentCom"], descendants: true, read: XSliderSelectComponent, isSignal: true }], ngImport: i0, template: "<div class=\"x-color-picker-portal\" tabindex=\"-1\" (click)=\"stopPropagation($event)\">\r\n <div #panelRef class=\"x-color-picker-portal-panel\">\r\n <div #plateRef class=\"x-color-picker-portal-plate\" (click)=\"plateClick($event)\">\r\n <div class=\"x-color-picker-portal-white\"></div>\r\n <div class=\"x-color-picker-portal-black\"></div>\r\n <div\r\n #dragCom\r\n class=\"x-color-picker-portal-cursor\"\r\n [style.left.px]=\"transformX()\"\r\n [style.top.px]=\"transformY()\"\r\n cdkDrag\r\n [cdkDragBoundary]=\"panelRef\"\r\n (cdkDragStarted)=\"started()\"\r\n (cdkDragEnded)=\"ended()\"\r\n (cdkDragMoved)=\"moved($event)\"\r\n ></div>\r\n </div>\r\n </div>\r\n <div class=\"x-color-picker-portal-tool\">\r\n <div class=\"x-color-picker-portal-operations\">\r\n <!-- <x-button icon=\"fto-edit-2\" onlyIcon></x-button> -->\r\n <div class=\"x-color-picker-portal-selected\">\r\n <div [style.background-color]=\"value()\"></div>\r\n </div>\r\n <div class=\"x-color-picker-portal-area\">\r\n <div class=\"x-color-picker-portal-slider\">\r\n <x-slider-select\r\n [style.width.%]=\"100\"\r\n [(ngModel)]=\"hsla().h\"\r\n min=\"0\"\r\n max=\"360\"\r\n step=\"1\"\r\n (dragStartEmit)=\"started()\"\r\n (dragEndEmit)=\"ended()\"\r\n (ngModelChange)=\"hueChange()\"\r\n ></x-slider-select>\r\n </div>\r\n <div class=\"x-color-picker-portal-transparent\">\r\n <x-slider-select\r\n [style.width.%]=\"100\"\r\n #transparentCom\r\n [(ngModel)]=\"hsla().a\"\r\n min=\"0\"\r\n max=\"1\"\r\n step=\"0.01\"\r\n (dragStarted)=\"started()\"\r\n (dragEnded)=\"ended()\"\r\n (ngModelChange)=\"transparentChange()\"\r\n ></x-slider-select>\r\n <div class=\"x-color-picker-portal-alpha\"></div>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"x-color-picker-portal-type\">\r\n <x-tabs animated=\"false\" justify=\"center\">\r\n <x-tab label=\"HEX\">\r\n <div class=\"x-color-picker-portal-type-content\">\r\n <x-input [style.width.%]=\"100\" [(ngModel)]=\"hex\" (ngModelChange)=\"hexChange()\"></x-input>\r\n </div>\r\n </x-tab>\r\n <x-tab label=\"RGBA\">\r\n <div class=\"x-color-picker-portal-type-content\">\r\n <x-input [(ngModel)]=\"rgba().r\" disabled></x-input>\r\n <x-input [(ngModel)]=\"rgba().g\" disabled></x-input>\r\n <x-input [(ngModel)]=\"rgba().b\" disabled></x-input>\r\n <x-input [(ngModel)]=\"rgba().a\" disabled></x-input>\r\n </div>\r\n </x-tab>\r\n <x-tab label=\"HSLA\">\r\n <div class=\"x-color-picker-portal-type-content\">\r\n <x-input [(ngModel)]=\"hsla().h\" disabled></x-input>\r\n <x-input [(ngModel)]=\"hsla().sp\" disabled></x-input>\r\n <x-input [(ngModel)]=\"hsla().lp\" disabled></x-input>\r\n <x-input [(ngModel)]=\"hsla().a\" disabled></x-input>\r\n </div>\r\n </x-tab>\r\n </x-tabs>\r\n </div>\r\n </div>\r\n</div>\r\n", styles: ["@charset \"UTF-8\";.x-color-picker-portal{margin:.0625rem 0;font-size:var(--x-font-size);color:var(--x-text);border-radius:var(--x-border-small-radius);box-shadow:var(--x-box-shadow);background-color:var(--x-background-100);width:17rem;overflow:hidden}.x-color-picker-portal:focus{outline:none}.x-color-picker-portal-panel{padding:.375rem;margin:-.375rem}.x-color-picker-portal-plate{width:100%;height:8rem;display:flex;border-radius:var(--x-border-small-radius);position:relative}.x-color-picker-portal-white,.x-color-picker-portal-black{position:absolute;inset:0}.x-color-picker-portal-white{background:linear-gradient(90deg,#fff,#fff0)}.x-color-picker-portal-black{background:linear-gradient(0deg,#000,transparent)}.x-color-picker-portal-cursor{position:absolute;width:.75rem;height:.75rem;display:inline-block;border-radius:50%;border:.0625rem solid var(--x-background-100)}.x-color-picker-portal-tool{padding:.4rem}.x-color-picker-portal-operations{display:flex;align-items:center;padding:.4rem 0}.x-color-picker-portal-selected{margin-left:.4rem;width:2rem;height:2rem;border-radius:2rem;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAIAAADZF8uwAAAAGUlEQVQYV2M4gwH+YwCGIasIUwhT25BVBADtzYNYrHvv4gAAAABJRU5ErkJggg==)}.x-color-picker-portal-selected>div{width:2rem;height:2rem;border-radius:2rem}.x-color-picker-portal-area{margin-left:.4rem;position:relative;flex:1}.x-color-picker-portal-area .x-slider-select:hover:not(.x-disabled) .x-slider-select-process{background-color:transparent}.x-color-picker-portal-area .x-slider-select>.x-slider-select-inner .x-slider-select-rail{height:.75rem}.x-color-picker-portal-area .x-slider-select>.x-slider-select-inner .x-slider-select-process{background-color:transparent}.x-color-picker-portal-area .x-slider-select>.x-slider-select-inner>.x-slider-select-drags>.x-slider-select-drag>.x-slider-select-button{border-color:var(--x-border);box-shadow:var(--x-box-shadow)}.x-color-picker-portal-slider{position:relative;width:100%;display:flex;align-items:center}.x-color-picker-portal-slider .x-slider-select>.x-slider-select-inner>.x-slider-select-rail{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff,#00f 67%,#f0f 83%,red)}.x-color-picker-portal-transparent{position:relative;width:100%;display:flex;align-items:center}.x-color-picker-portal-transparent .x-slider-select>.x-slider-select-inner>.x-slider-select-rail{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAIAAADZF8uwAAAAGUlEQVQYV2M4gwH+YwCGIasIUwhT25BVBADtzYNYrHvv4gAAAABJRU5ErkJggg==)}.x-color-picker-portal-type .x-tabs .x-tabs-list{display:flex;justify-content:center}.x-color-picker-portal-type-content{padding:.25rem;display:flex}.x-color-picker-portal-type-content .x-input .x-input-row input{text-align:center}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: DragDropModule }, { kind: "directive", type: i2.CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer", "cdkDragScale"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "component", type: XSliderSelectComponent, selector: "x-slider-select" }, { kind: "component", type: XTabsComponent, selector: "x-tabs" }, { kind: "component", type: XTabComponent, selector: "x-tab" }, { kind: "component", type: XInputComponent, selector: "x-input" }], animations: [XConnectBaseAnimation], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
538
+ /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "18.2.2", type: XColorPickerPortalComponent, isStandalone: true, selector: "x-color-picker-portal", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, inputCom: { classPropertyName: "inputCom", publicName: "inputCom", isSignal: true, isRequired: false, transformFunction: null }, placement: { classPropertyName: "placement", publicName: "placement", isSignal: true, isRequired: false, transformFunction: null }, panelTemplate: { classPropertyName: "panelTemplate", publicName: "panelTemplate", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", animating: "animating", nodeClick: "nodeClick" }, host: { listeners: { "@x-connect-base-animation.done": "done($event)", "@x-connect-base-animation.start": "start($event)" }, properties: { "@x-connect-base-animation": "this.getPlacement" } }, providers: [DecimalPipe, PercentPipe], viewQueries: [{ propertyName: "panelRef", first: true, predicate: ["panelRef"], descendants: true, read: ElementRef, isSignal: true }, { propertyName: "plateRef", first: true, predicate: ["plateRef"], descendants: true, read: ElementRef, isSignal: true }, { propertyName: "transparentCom", first: true, predicate: ["transparentCom"], descendants: true, read: XSliderSelectComponent, isSignal: true }], usesOnChanges: true, ngImport: i0, template: "<div class=\"x-color-picker-portal\" tabindex=\"-1\" (click)=\"stopPropagation($event)\">\r\n <div #panelRef class=\"x-color-picker-portal-panel\">\r\n <div #plateRef class=\"x-color-picker-portal-plate\" (click)=\"plateClick($event)\">\r\n <div class=\"x-color-picker-portal-white\"></div>\r\n <div class=\"x-color-picker-portal-black\"></div>\r\n <div\r\n #dragCom\r\n class=\"x-color-picker-portal-cursor\"\r\n [style.left.px]=\"transformX()\"\r\n [style.top.px]=\"transformY()\"\r\n cdkDrag\r\n [cdkDragBoundary]=\"panelRef\"\r\n (cdkDragStarted)=\"started()\"\r\n (cdkDragEnded)=\"ended()\"\r\n (cdkDragMoved)=\"moved($event)\"\r\n ></div>\r\n </div>\r\n </div>\r\n <div class=\"x-color-picker-portal-tool\">\r\n <div class=\"x-color-picker-portal-operations\">\r\n <!-- <x-button icon=\"fto-edit-2\" onlyIcon></x-button> -->\r\n <div class=\"x-color-picker-portal-selected\">\r\n <div [style.background-color]=\"value()\"></div>\r\n </div>\r\n <div class=\"x-color-picker-portal-area\">\r\n <div class=\"x-color-picker-portal-slider\">\r\n <x-slider-select\r\n [style.width.%]=\"100\"\r\n [(ngModel)]=\"hsla().h\"\r\n min=\"0\"\r\n max=\"360\"\r\n step=\"1\"\r\n (dragStartEmit)=\"started()\"\r\n (dragEndEmit)=\"ended()\"\r\n (ngModelChange)=\"hueChange()\"\r\n ></x-slider-select>\r\n </div>\r\n <div class=\"x-color-picker-portal-transparent\">\r\n <x-slider-select\r\n [style.width.%]=\"100\"\r\n #transparentCom\r\n [(ngModel)]=\"hsla().a\"\r\n min=\"0\"\r\n max=\"1\"\r\n step=\"0.01\"\r\n (dragStarted)=\"started()\"\r\n (dragEnded)=\"ended()\"\r\n (ngModelChange)=\"transparentChange()\"\r\n ></x-slider-select>\r\n <div class=\"x-color-picker-portal-alpha\"></div>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"x-color-picker-portal-type\">\r\n <x-tabs animated=\"false\" justify=\"center\">\r\n <x-tab label=\"HEX\">\r\n <div class=\"x-color-picker-portal-type-content\">\r\n <x-input [style.width.%]=\"100\" [(ngModel)]=\"hex\" (ngModelChange)=\"hexChange()\"></x-input>\r\n </div>\r\n </x-tab>\r\n <x-tab label=\"RGBA\">\r\n <div class=\"x-color-picker-portal-type-content\">\r\n <x-input [(ngModel)]=\"rgba().r\" disabled></x-input>\r\n <x-input [(ngModel)]=\"rgba().g\" disabled></x-input>\r\n <x-input [(ngModel)]=\"rgba().b\" disabled></x-input>\r\n <x-input [(ngModel)]=\"rgba().a\" disabled></x-input>\r\n </div>\r\n </x-tab>\r\n <x-tab label=\"HSLA\">\r\n <div class=\"x-color-picker-portal-type-content\">\r\n <x-input [(ngModel)]=\"hsla().h\" disabled></x-input>\r\n <x-input [(ngModel)]=\"hsla().sp\" disabled></x-input>\r\n <x-input [(ngModel)]=\"hsla().lp\" disabled></x-input>\r\n <x-input [(ngModel)]=\"hsla().a\" disabled></x-input>\r\n </div>\r\n </x-tab>\r\n </x-tabs>\r\n </div>\r\n <div class=\"x-color-picker-panel\">\r\n <ng-container *ngTemplateOutlet=\"panelTemplate()!\"></ng-container>\r\n </div>\r\n </div>\r\n</div>\r\n", styles: ["@charset \"UTF-8\";.x-color-picker-portal{margin:.0625rem 0;font-size:var(--x-font-size);color:var(--x-text);border-radius:var(--x-border-small-radius);box-shadow:var(--x-box-shadow);background-color:var(--x-background-100);width:17rem;overflow:hidden}.x-color-picker-portal:focus{outline:none}.x-color-picker-portal-panel{padding:.375rem;margin:-.375rem}.x-color-picker-portal-plate{width:100%;height:8rem;display:flex;border-radius:var(--x-border-small-radius);position:relative}.x-color-picker-portal-white,.x-color-picker-portal-black{position:absolute;inset:0}.x-color-picker-portal-white{background:linear-gradient(90deg,#fff,#fff0)}.x-color-picker-portal-black{background:linear-gradient(0deg,#000,transparent)}.x-color-picker-portal-cursor{position:absolute;width:.75rem;height:.75rem;display:inline-block;border-radius:50%;border:.0625rem solid var(--x-background-100)}.x-color-picker-portal-tool{padding:.4rem}.x-color-picker-portal-operations{display:flex;align-items:center;padding:.4rem 0}.x-color-picker-portal-selected{margin-left:.4rem;width:2rem;height:2rem;border-radius:2rem;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAIAAADZF8uwAAAAGUlEQVQYV2M4gwH+YwCGIasIUwhT25BVBADtzYNYrHvv4gAAAABJRU5ErkJggg==)}.x-color-picker-portal-selected>div{width:2rem;height:2rem;border-radius:2rem}.x-color-picker-portal-area{margin-left:.4rem;position:relative;flex:1}.x-color-picker-portal-area .x-slider-select:hover:not(.x-disabled) .x-slider-select-process{background-color:transparent}.x-color-picker-portal-area .x-slider-select>.x-slider-select-inner .x-slider-select-rail{height:.75rem}.x-color-picker-portal-area .x-slider-select>.x-slider-select-inner .x-slider-select-process{background-color:transparent}.x-color-picker-portal-area .x-slider-select>.x-slider-select-inner>.x-slider-select-drags>.x-slider-select-drag>.x-slider-select-button{border-color:var(--x-border);box-shadow:var(--x-box-shadow)}.x-color-picker-portal-slider{position:relative;width:100%;display:flex;align-items:center}.x-color-picker-portal-slider .x-slider-select>.x-slider-select-inner>.x-slider-select-rail{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff,#00f 67%,#f0f 83%,red)}.x-color-picker-portal-transparent{position:relative;width:100%;display:flex;align-items:center}.x-color-picker-portal-transparent .x-slider-select>.x-slider-select-inner>.x-slider-select-rail{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAIAAADZF8uwAAAAGUlEQVQYV2M4gwH+YwCGIasIUwhT25BVBADtzYNYrHvv4gAAAABJRU5ErkJggg==)}.x-color-picker-portal-type .x-tabs .x-tabs-list{display:flex;justify-content:center}.x-color-picker-portal-type-content{padding:.25rem;display:flex}.x-color-picker-portal-type-content .x-input .x-input-row input{text-align:center}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: DragDropModule }, { kind: "directive", type: i2.CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer", "cdkDragScale"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: XSliderSelectComponent, selector: "x-slider-select" }, { kind: "component", type: XTabsComponent, selector: "x-tabs" }, { kind: "component", type: XTabComponent, selector: "x-tab" }, { kind: "component", type: XInputComponent, selector: "x-input" }], animations: [XConnectBaseAnimation], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
524
539
  }
525
540
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: XColorPickerPortalComponent, decorators: [{
526
541
  type: Component,
527
- args: [{ selector: `${XColorPickerPortalPrefix}`, standalone: true, imports: [FormsModule, DragDropModule, XSliderSelectComponent, XTabsComponent, XTabComponent, XInputComponent], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, providers: [DecimalPipe, PercentPipe], animations: [XConnectBaseAnimation], template: "<div class=\"x-color-picker-portal\" tabindex=\"-1\" (click)=\"stopPropagation($event)\">\r\n <div #panelRef class=\"x-color-picker-portal-panel\">\r\n <div #plateRef class=\"x-color-picker-portal-plate\" (click)=\"plateClick($event)\">\r\n <div class=\"x-color-picker-portal-white\"></div>\r\n <div class=\"x-color-picker-portal-black\"></div>\r\n <div\r\n #dragCom\r\n class=\"x-color-picker-portal-cursor\"\r\n [style.left.px]=\"transformX()\"\r\n [style.top.px]=\"transformY()\"\r\n cdkDrag\r\n [cdkDragBoundary]=\"panelRef\"\r\n (cdkDragStarted)=\"started()\"\r\n (cdkDragEnded)=\"ended()\"\r\n (cdkDragMoved)=\"moved($event)\"\r\n ></div>\r\n </div>\r\n </div>\r\n <div class=\"x-color-picker-portal-tool\">\r\n <div class=\"x-color-picker-portal-operations\">\r\n <!-- <x-button icon=\"fto-edit-2\" onlyIcon></x-button> -->\r\n <div class=\"x-color-picker-portal-selected\">\r\n <div [style.background-color]=\"value()\"></div>\r\n </div>\r\n <div class=\"x-color-picker-portal-area\">\r\n <div class=\"x-color-picker-portal-slider\">\r\n <x-slider-select\r\n [style.width.%]=\"100\"\r\n [(ngModel)]=\"hsla().h\"\r\n min=\"0\"\r\n max=\"360\"\r\n step=\"1\"\r\n (dragStartEmit)=\"started()\"\r\n (dragEndEmit)=\"ended()\"\r\n (ngModelChange)=\"hueChange()\"\r\n ></x-slider-select>\r\n </div>\r\n <div class=\"x-color-picker-portal-transparent\">\r\n <x-slider-select\r\n [style.width.%]=\"100\"\r\n #transparentCom\r\n [(ngModel)]=\"hsla().a\"\r\n min=\"0\"\r\n max=\"1\"\r\n step=\"0.01\"\r\n (dragStarted)=\"started()\"\r\n (dragEnded)=\"ended()\"\r\n (ngModelChange)=\"transparentChange()\"\r\n ></x-slider-select>\r\n <div class=\"x-color-picker-portal-alpha\"></div>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"x-color-picker-portal-type\">\r\n <x-tabs animated=\"false\" justify=\"center\">\r\n <x-tab label=\"HEX\">\r\n <div class=\"x-color-picker-portal-type-content\">\r\n <x-input [style.width.%]=\"100\" [(ngModel)]=\"hex\" (ngModelChange)=\"hexChange()\"></x-input>\r\n </div>\r\n </x-tab>\r\n <x-tab label=\"RGBA\">\r\n <div class=\"x-color-picker-portal-type-content\">\r\n <x-input [(ngModel)]=\"rgba().r\" disabled></x-input>\r\n <x-input [(ngModel)]=\"rgba().g\" disabled></x-input>\r\n <x-input [(ngModel)]=\"rgba().b\" disabled></x-input>\r\n <x-input [(ngModel)]=\"rgba().a\" disabled></x-input>\r\n </div>\r\n </x-tab>\r\n <x-tab label=\"HSLA\">\r\n <div class=\"x-color-picker-portal-type-content\">\r\n <x-input [(ngModel)]=\"hsla().h\" disabled></x-input>\r\n <x-input [(ngModel)]=\"hsla().sp\" disabled></x-input>\r\n <x-input [(ngModel)]=\"hsla().lp\" disabled></x-input>\r\n <x-input [(ngModel)]=\"hsla().a\" disabled></x-input>\r\n </div>\r\n </x-tab>\r\n </x-tabs>\r\n </div>\r\n </div>\r\n</div>\r\n", styles: ["@charset \"UTF-8\";.x-color-picker-portal{margin:.0625rem 0;font-size:var(--x-font-size);color:var(--x-text);border-radius:var(--x-border-small-radius);box-shadow:var(--x-box-shadow);background-color:var(--x-background-100);width:17rem;overflow:hidden}.x-color-picker-portal:focus{outline:none}.x-color-picker-portal-panel{padding:.375rem;margin:-.375rem}.x-color-picker-portal-plate{width:100%;height:8rem;display:flex;border-radius:var(--x-border-small-radius);position:relative}.x-color-picker-portal-white,.x-color-picker-portal-black{position:absolute;inset:0}.x-color-picker-portal-white{background:linear-gradient(90deg,#fff,#fff0)}.x-color-picker-portal-black{background:linear-gradient(0deg,#000,transparent)}.x-color-picker-portal-cursor{position:absolute;width:.75rem;height:.75rem;display:inline-block;border-radius:50%;border:.0625rem solid var(--x-background-100)}.x-color-picker-portal-tool{padding:.4rem}.x-color-picker-portal-operations{display:flex;align-items:center;padding:.4rem 0}.x-color-picker-portal-selected{margin-left:.4rem;width:2rem;height:2rem;border-radius:2rem;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAIAAADZF8uwAAAAGUlEQVQYV2M4gwH+YwCGIasIUwhT25BVBADtzYNYrHvv4gAAAABJRU5ErkJggg==)}.x-color-picker-portal-selected>div{width:2rem;height:2rem;border-radius:2rem}.x-color-picker-portal-area{margin-left:.4rem;position:relative;flex:1}.x-color-picker-portal-area .x-slider-select:hover:not(.x-disabled) .x-slider-select-process{background-color:transparent}.x-color-picker-portal-area .x-slider-select>.x-slider-select-inner .x-slider-select-rail{height:.75rem}.x-color-picker-portal-area .x-slider-select>.x-slider-select-inner .x-slider-select-process{background-color:transparent}.x-color-picker-portal-area .x-slider-select>.x-slider-select-inner>.x-slider-select-drags>.x-slider-select-drag>.x-slider-select-button{border-color:var(--x-border);box-shadow:var(--x-box-shadow)}.x-color-picker-portal-slider{position:relative;width:100%;display:flex;align-items:center}.x-color-picker-portal-slider .x-slider-select>.x-slider-select-inner>.x-slider-select-rail{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff,#00f 67%,#f0f 83%,red)}.x-color-picker-portal-transparent{position:relative;width:100%;display:flex;align-items:center}.x-color-picker-portal-transparent .x-slider-select>.x-slider-select-inner>.x-slider-select-rail{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAIAAADZF8uwAAAAGUlEQVQYV2M4gwH+YwCGIasIUwhT25BVBADtzYNYrHvv4gAAAABJRU5ErkJggg==)}.x-color-picker-portal-type .x-tabs .x-tabs-list{display:flex;justify-content:center}.x-color-picker-portal-type-content{padding:.25rem;display:flex}.x-color-picker-portal-type-content .x-input .x-input-row input{text-align:center}\n"] }]
542
+ args: [{ selector: `${XColorPickerPortalPrefix}`, standalone: true, imports: [
543
+ FormsModule,
544
+ DragDropModule,
545
+ NgTemplateOutlet,
546
+ XSliderSelectComponent,
547
+ XTabsComponent,
548
+ XTabComponent,
549
+ XInputComponent
550
+ ], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, providers: [DecimalPipe, PercentPipe], animations: [XConnectBaseAnimation], template: "<div class=\"x-color-picker-portal\" tabindex=\"-1\" (click)=\"stopPropagation($event)\">\r\n <div #panelRef class=\"x-color-picker-portal-panel\">\r\n <div #plateRef class=\"x-color-picker-portal-plate\" (click)=\"plateClick($event)\">\r\n <div class=\"x-color-picker-portal-white\"></div>\r\n <div class=\"x-color-picker-portal-black\"></div>\r\n <div\r\n #dragCom\r\n class=\"x-color-picker-portal-cursor\"\r\n [style.left.px]=\"transformX()\"\r\n [style.top.px]=\"transformY()\"\r\n cdkDrag\r\n [cdkDragBoundary]=\"panelRef\"\r\n (cdkDragStarted)=\"started()\"\r\n (cdkDragEnded)=\"ended()\"\r\n (cdkDragMoved)=\"moved($event)\"\r\n ></div>\r\n </div>\r\n </div>\r\n <div class=\"x-color-picker-portal-tool\">\r\n <div class=\"x-color-picker-portal-operations\">\r\n <!-- <x-button icon=\"fto-edit-2\" onlyIcon></x-button> -->\r\n <div class=\"x-color-picker-portal-selected\">\r\n <div [style.background-color]=\"value()\"></div>\r\n </div>\r\n <div class=\"x-color-picker-portal-area\">\r\n <div class=\"x-color-picker-portal-slider\">\r\n <x-slider-select\r\n [style.width.%]=\"100\"\r\n [(ngModel)]=\"hsla().h\"\r\n min=\"0\"\r\n max=\"360\"\r\n step=\"1\"\r\n (dragStartEmit)=\"started()\"\r\n (dragEndEmit)=\"ended()\"\r\n (ngModelChange)=\"hueChange()\"\r\n ></x-slider-select>\r\n </div>\r\n <div class=\"x-color-picker-portal-transparent\">\r\n <x-slider-select\r\n [style.width.%]=\"100\"\r\n #transparentCom\r\n [(ngModel)]=\"hsla().a\"\r\n min=\"0\"\r\n max=\"1\"\r\n step=\"0.01\"\r\n (dragStarted)=\"started()\"\r\n (dragEnded)=\"ended()\"\r\n (ngModelChange)=\"transparentChange()\"\r\n ></x-slider-select>\r\n <div class=\"x-color-picker-portal-alpha\"></div>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"x-color-picker-portal-type\">\r\n <x-tabs animated=\"false\" justify=\"center\">\r\n <x-tab label=\"HEX\">\r\n <div class=\"x-color-picker-portal-type-content\">\r\n <x-input [style.width.%]=\"100\" [(ngModel)]=\"hex\" (ngModelChange)=\"hexChange()\"></x-input>\r\n </div>\r\n </x-tab>\r\n <x-tab label=\"RGBA\">\r\n <div class=\"x-color-picker-portal-type-content\">\r\n <x-input [(ngModel)]=\"rgba().r\" disabled></x-input>\r\n <x-input [(ngModel)]=\"rgba().g\" disabled></x-input>\r\n <x-input [(ngModel)]=\"rgba().b\" disabled></x-input>\r\n <x-input [(ngModel)]=\"rgba().a\" disabled></x-input>\r\n </div>\r\n </x-tab>\r\n <x-tab label=\"HSLA\">\r\n <div class=\"x-color-picker-portal-type-content\">\r\n <x-input [(ngModel)]=\"hsla().h\" disabled></x-input>\r\n <x-input [(ngModel)]=\"hsla().sp\" disabled></x-input>\r\n <x-input [(ngModel)]=\"hsla().lp\" disabled></x-input>\r\n <x-input [(ngModel)]=\"hsla().a\" disabled></x-input>\r\n </div>\r\n </x-tab>\r\n </x-tabs>\r\n </div>\r\n <div class=\"x-color-picker-panel\">\r\n <ng-container *ngTemplateOutlet=\"panelTemplate()!\"></ng-container>\r\n </div>\r\n </div>\r\n</div>\r\n", styles: ["@charset \"UTF-8\";.x-color-picker-portal{margin:.0625rem 0;font-size:var(--x-font-size);color:var(--x-text);border-radius:var(--x-border-small-radius);box-shadow:var(--x-box-shadow);background-color:var(--x-background-100);width:17rem;overflow:hidden}.x-color-picker-portal:focus{outline:none}.x-color-picker-portal-panel{padding:.375rem;margin:-.375rem}.x-color-picker-portal-plate{width:100%;height:8rem;display:flex;border-radius:var(--x-border-small-radius);position:relative}.x-color-picker-portal-white,.x-color-picker-portal-black{position:absolute;inset:0}.x-color-picker-portal-white{background:linear-gradient(90deg,#fff,#fff0)}.x-color-picker-portal-black{background:linear-gradient(0deg,#000,transparent)}.x-color-picker-portal-cursor{position:absolute;width:.75rem;height:.75rem;display:inline-block;border-radius:50%;border:.0625rem solid var(--x-background-100)}.x-color-picker-portal-tool{padding:.4rem}.x-color-picker-portal-operations{display:flex;align-items:center;padding:.4rem 0}.x-color-picker-portal-selected{margin-left:.4rem;width:2rem;height:2rem;border-radius:2rem;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAIAAADZF8uwAAAAGUlEQVQYV2M4gwH+YwCGIasIUwhT25BVBADtzYNYrHvv4gAAAABJRU5ErkJggg==)}.x-color-picker-portal-selected>div{width:2rem;height:2rem;border-radius:2rem}.x-color-picker-portal-area{margin-left:.4rem;position:relative;flex:1}.x-color-picker-portal-area .x-slider-select:hover:not(.x-disabled) .x-slider-select-process{background-color:transparent}.x-color-picker-portal-area .x-slider-select>.x-slider-select-inner .x-slider-select-rail{height:.75rem}.x-color-picker-portal-area .x-slider-select>.x-slider-select-inner .x-slider-select-process{background-color:transparent}.x-color-picker-portal-area .x-slider-select>.x-slider-select-inner>.x-slider-select-drags>.x-slider-select-drag>.x-slider-select-button{border-color:var(--x-border);box-shadow:var(--x-box-shadow)}.x-color-picker-portal-slider{position:relative;width:100%;display:flex;align-items:center}.x-color-picker-portal-slider .x-slider-select>.x-slider-select-inner>.x-slider-select-rail{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff,#00f 67%,#f0f 83%,red)}.x-color-picker-portal-transparent{position:relative;width:100%;display:flex;align-items:center}.x-color-picker-portal-transparent .x-slider-select>.x-slider-select-inner>.x-slider-select-rail{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAIAAADZF8uwAAAAGUlEQVQYV2M4gwH+YwCGIasIUwhT25BVBADtzYNYrHvv4gAAAABJRU5ErkJggg==)}.x-color-picker-portal-type .x-tabs .x-tabs-list{display:flex;justify-content:center}.x-color-picker-portal-type-content{padding:.25rem;display:flex}.x-color-picker-portal-type-content .x-input .x-input-row input{text-align:center}\n"] }]
528
551
  }], propDecorators: { getPlacement: [{
529
552
  type: HostBinding,
530
553
  args: ['@x-connect-base-animation']
@@ -536,11 +559,163 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImpor
536
559
  args: ['@x-connect-base-animation.start', ['$event']]
537
560
  }] } });
538
561
 
562
+ const XColorPickerColorMap = {
563
+ aliceblue: '#f0f8ff',
564
+ antiquewhite: '#faebd7',
565
+ aqua: '#00ffff',
566
+ aquamarine: '#7fffd4',
567
+ azure: '#f0ffff',
568
+ beige: '#f5f5dc',
569
+ bisque: '#ffe4c4',
570
+ black: '#000000',
571
+ blanchedalmond: '#ffebcd',
572
+ blue: '#0000ff',
573
+ blueviolet: '#8a2be2',
574
+ brown: '#a52a2a',
575
+ burlywood: '#deb887',
576
+ cadetblue: '#5f9ea0',
577
+ chartreuse: '#7fff00',
578
+ chocolate: '#d2691e',
579
+ coral: '#ff7f50',
580
+ cornflowerblue: '#6495ed',
581
+ cornsilk: '#fff8dc',
582
+ crimson: '#dc143c',
583
+ cyan: '#00ffff',
584
+ darkblue: '#00008b',
585
+ darkcyan: '#008b8b',
586
+ darkgoldenrod: '#b8860b',
587
+ darkgray: '#a9a9a9',
588
+ darkgreen: '#006400',
589
+ darkgrey: '#a9a9a9',
590
+ darkkhaki: '#bdb76b',
591
+ darkmagenta: '#8b008b',
592
+ darkolivegreen: '#556b2f',
593
+ darkorange: '#ff8c00',
594
+ darkorchid: '#9932cc',
595
+ darkred: '#8b0000',
596
+ darksalmon: '#e9967a',
597
+ darkseagreen: '#8fbc8f',
598
+ darkslateblue: '#483d8b',
599
+ darkslategray: '#2f4f4f',
600
+ darkslategrey: '#2f4f4f',
601
+ darkturquoise: '#00ced1',
602
+ darkviolet: '#9400d3',
603
+ deeppink: '#ff1493',
604
+ deepskyblue: '#00bfff',
605
+ dimgray: '#696969',
606
+ dimgrey: '#696969',
607
+ dodgerblue: '#1e90ff',
608
+ firebrick: '#b22222',
609
+ floralwhite: '#fffaf0',
610
+ forestgreen: '#228b22',
611
+ fuchsia: '#ff00ff',
612
+ gainsboro: '#dcdcdc',
613
+ ghostwhite: '#f8f8ff',
614
+ gold: '#ffd700',
615
+ goldenrod: '#daa520',
616
+ gray: '#808080',
617
+ green: '#008000',
618
+ greenyellow: '#adff2f',
619
+ grey: '#808080',
620
+ honeydew: '#f0fff0',
621
+ hotpink: '#ff69b4',
622
+ indianred: '#cd5c5c',
623
+ indigo: '#4b0082',
624
+ ivory: '#fffff0',
625
+ khaki: '#f0e68c',
626
+ lavender: '#e6e6fa',
627
+ lavenderblush: '#fff0f5',
628
+ lawngreen: '#7cfc00',
629
+ lemonchiffon: '#fffacd',
630
+ lightblue: '#add8e6',
631
+ lightcoral: '#f08080',
632
+ lightcyan: '#e0ffff',
633
+ lightgoldenrodyellow: '#fafad2',
634
+ lightgray: '#d3d3d3',
635
+ lightgreen: '#90ee90',
636
+ lightgrey: '#d3d3d3',
637
+ lightpink: '#ffb6c1',
638
+ lightsalmon: '#ffa07a',
639
+ lightseagreen: '#20b2aa',
640
+ lightskyblue: '#87cefa',
641
+ lightslategray: '#778899',
642
+ lightslategrey: '#778899',
643
+ lightsteelblue: '#b0c4de',
644
+ lightyellow: '#ffffe0',
645
+ lime: '#00ff00',
646
+ limegreen: '#32cd32',
647
+ linen: '#faf0e6',
648
+ magenta: '#ff00ff',
649
+ maroon: '#800000',
650
+ mediumaquamarine: '#66cdaa',
651
+ mediumblue: '#0000cd',
652
+ mediumorchid: '#ba55d3',
653
+ mediumpurple: '#9370db',
654
+ mediumseagreen: '#3cb371',
655
+ mediumslateblue: '#7b68ee',
656
+ mediumspringgreen: '#00fa9a',
657
+ mediumturquoise: '#48d1cc',
658
+ mediumvioletred: '#c71585',
659
+ midnightblue: '#191970',
660
+ mintcream: '#f5fffa',
661
+ mistyrose: '#ffe4e1',
662
+ moccasin: '#ffe4b5',
663
+ navajowhite: '#ffdead',
664
+ navy: '#000080',
665
+ oldlace: '#fdf5e6',
666
+ olive: '#808000',
667
+ olivedrab: '#6b8e23',
668
+ orange: '#ffa500',
669
+ orangered: '#ff4500',
670
+ orchid: '#da70d6',
671
+ palegoldenrod: '#eee8aa',
672
+ palegreen: '#98fb98',
673
+ paleturquoise: '#afeeee',
674
+ palevioletred: '#db7093',
675
+ papayawhip: '#ffefd5',
676
+ peachpuff: '#ffdab9',
677
+ peru: '#cd853f',
678
+ pink: '#ffc0cb',
679
+ plum: '#dda0dd',
680
+ powderblue: '#b0e0e6',
681
+ purple: '#800080',
682
+ rebeccapurple: '#663399',
683
+ red: '#ff0000',
684
+ rosybrown: '#bc8f8f',
685
+ royalblue: '#4169e1',
686
+ saddlebrown: '#8b4513',
687
+ salmon: '#fa8072',
688
+ sandybrown: '#f4a460',
689
+ seagreen: '#2e8b57',
690
+ seashell: '#fff5ee',
691
+ sienna: '#a0522d',
692
+ silver: '#c0c0c0',
693
+ skyblue: '#87ceeb',
694
+ slateblue: '#6a5acd',
695
+ slategray: '#708090',
696
+ slategrey: '#708090',
697
+ snow: '#fffafa',
698
+ springgreen: '#00ff7f',
699
+ steelblue: '#4682b4',
700
+ tan: '#d2b48c',
701
+ teal: '#008080',
702
+ thistle: '#d8bfd8',
703
+ tomato: '#ff6347',
704
+ turquoise: '#40e0d0',
705
+ violet: '#ee82ee',
706
+ wheat: '#f5deb3',
707
+ white: '#ffffff',
708
+ whitesmoke: '#f5f5f5',
709
+ yellow: '#ffff00',
710
+ yellowgreen: '#9acd32'
711
+ };
712
+
539
713
  class XColorPickerComponent extends XColorPickerProperty {
540
714
  constructor() {
541
715
  super();
542
716
  this.colorPicker = viewChild.required('colorPicker', { read: (ElementRef) });
543
717
  this.inputCom = viewChild.required('inputCom', { read: XInputComponent });
718
+ this.panelTemplate = viewChild.required('panelTemplate');
544
719
  this.doc = inject(DOCUMENT);
545
720
  this.primaryColor = XComputed(this.doc.documentElement).getPropertyValue('--x-primary').trim();
546
721
  this.inputStyle = computed(() => ({
@@ -562,9 +737,10 @@ class XColorPickerComponent extends XColorPickerProperty {
562
737
  this.realPlacement = signal(null);
563
738
  this.portalComponent = signal(null);
564
739
  this.portalOverlayRef = signal(null);
565
- effect(() => this.portalComponent()?.setInput('value', this.value() || this.primaryColor));
740
+ effect(() => this.portalComponent()?.setInput('value', XColorPickerColorMap[this.value()] || this.value() || this.primaryColor));
566
741
  effect(() => this.portalComponent()?.setInput('placement', this.realPlacement()));
567
742
  effect(() => this.portalComponent()?.setInput('inputCom', this.inputCom()));
743
+ effect(() => this.portalComponent()?.setInput('panelTemplate', this.panelTemplate()));
568
744
  }
569
745
  ngOnInit() {
570
746
  this.setSubject();
@@ -706,23 +882,47 @@ class XColorPickerComponent extends XColorPickerProperty {
706
882
  this.portalAttached() && this.portalOverlayRef()?.updatePositionStrategy(this.setPlacement());
707
883
  }
708
884
  /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: XColorPickerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
709
- /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "18.2.2", type: XColorPickerComponent, isStandalone: true, selector: "x-color-picker", providers: [XValueAccessor(XColorPickerComponent)], viewQueries: [{ propertyName: "colorPicker", first: true, predicate: ["colorPicker"], descendants: true, read: ElementRef, isSignal: true }, { propertyName: "inputCom", first: true, predicate: ["inputCom"], descendants: true, read: XInputComponent, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<div #colorPicker class=\"x-color-picker\">\r\n <div class=\"x-color-picker-row\">\r\n <x-input\r\n #inputCom\r\n type=\"text\"\r\n [label]=\"label()\"\r\n [labelWidth]=\"labelWidth()\"\r\n [labelAlign]=\"labelAlign()\"\r\n [justify]=\"justify()\"\r\n [align]=\"align()\"\r\n [direction]=\"direction()\"\r\n [disabled]=\"disabledComputed()\"\r\n [required]=\"requiredComputed()\"\r\n [validator]=\"validatorComputed()\"\r\n [inputValidator]=\"inputValidator()\"\r\n [icon]=\"icon()\"\r\n [placeholder]=\"placeholder()\"\r\n [readonly]=\"readonly()\"\r\n [clearable]=\"clearable()\"\r\n [(ngModel)]=\"value\"\r\n [valueTpl]=\"valueTpl() ? valueTpl() : valueTemplate\"\r\n [valueTplContext]=\"valueTplContext()\"\r\n [size]=\"size()\"\r\n [bordered]=\"bordered()\"\r\n [before]=\"before()\"\r\n [after]=\"after()\"\r\n [pattern]=\"patternComputed()\"\r\n [message]=\"messageComputed()\"\r\n [pointer]=\"pointer()\"\r\n [(active)]=\"active\"\r\n (clearEmit)=\"clearEmit()\"\r\n (xClick)=\"showPortal()\"\r\n (xMouseenter)=\"menter()\"\r\n (xMouseleave)=\"mleave()\"\r\n ></x-input>\r\n\r\n <ng-template #valueTemplate>\r\n <div class=\"x-color-picker-template-value\">\r\n <div class=\"x-color-picker-template-color\" [style]=\"inputStyle()\"></div>\r\n </div>\r\n </ng-template>\r\n </div>\r\n</div>\r\n", styles: ["@charset \"UTF-8\";x-color-picker{display:inline-block;width:12rem}.x-color-picker{margin:0;padding:0}.x-color-picker{width:100%}.x-color-picker x-input{width:100%}.x-color-picker x-input .x-input-value-template-value{left:.25rem!important;width:calc(100% - 2.4rem)!important}.x-color-picker-template-value{width:100%;height:100%;padding:.25rem 0;content:\" \";position:absolute;display:flex;align-items:center;justify-content:center}.x-color-picker-template-color{width:100%;height:100%;border-radius:var(--x-border-small-radius)}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1.PatternValidator, selector: "[pattern][formControlName],[pattern][formControl],[pattern][ngModel]", inputs: ["pattern"] }, { 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: "component", type: XInputComponent, selector: "x-input" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
885
+ /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "18.2.2", type: XColorPickerComponent, isStandalone: true, selector: "x-color-picker", providers: [XValueAccessor(XColorPickerComponent)], viewQueries: [{ propertyName: "colorPicker", first: true, predicate: ["colorPicker"], descendants: true, read: ElementRef, isSignal: true }, { propertyName: "inputCom", first: true, predicate: ["inputCom"], descendants: true, read: XInputComponent, isSignal: true }, { propertyName: "panelTemplate", first: true, predicate: ["panelTemplate"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<div #colorPicker class=\"x-color-picker\">\r\n <div class=\"x-color-picker-row\">\r\n <x-input\r\n #inputCom\r\n type=\"text\"\r\n [label]=\"label()\"\r\n [labelWidth]=\"labelWidth()\"\r\n [labelAlign]=\"labelAlign()\"\r\n [justify]=\"justify()\"\r\n [align]=\"align()\"\r\n [direction]=\"direction()\"\r\n [disabled]=\"disabledComputed()\"\r\n [required]=\"requiredComputed()\"\r\n [validator]=\"validatorComputed()\"\r\n [inputValidator]=\"inputValidator()\"\r\n [icon]=\"icon()\"\r\n [placeholder]=\"placeholder()\"\r\n [readonly]=\"readonly()\"\r\n [clearable]=\"clearable()\"\r\n [(ngModel)]=\"value\"\r\n [valueTpl]=\"valueTpl() ? valueTpl() : valueTemplate\"\r\n [valueTplContext]=\"valueTplContext()\"\r\n [size]=\"size()\"\r\n [bordered]=\"bordered()\"\r\n [before]=\"before()\"\r\n [after]=\"after()\"\r\n [pattern]=\"patternComputed()\"\r\n [message]=\"messageComputed()\"\r\n [pointer]=\"pointer()\"\r\n [(active)]=\"active\"\r\n (clearEmit)=\"clearEmit()\"\r\n (xClick)=\"showPortal()\"\r\n (xMouseenter)=\"menter()\"\r\n (xMouseleave)=\"mleave()\"\r\n ></x-input>\r\n\r\n <ng-template #valueTemplate>\r\n <div class=\"x-color-picker-template-value\">\r\n <div class=\"x-color-picker-template-color\" [style]=\"inputStyle()\"></div>\r\n </div>\r\n </ng-template>\r\n\r\n <ng-template #panelTemplate>\r\n <ng-content select=\"[xColorPickerPanel]\"></ng-content>\r\n </ng-template>\r\n </div>\r\n</div>\r\n", styles: ["@charset \"UTF-8\";x-color-picker{display:inline-block;width:12rem}.x-color-picker{margin:0;padding:0}.x-color-picker{width:100%}.x-color-picker x-input{width:100%}.x-color-picker x-input .x-input-value-template-value{left:.25rem!important;width:calc(100% - 2.4rem)!important}.x-color-picker-template-value{width:100%;height:100%;padding:.25rem 0;content:\" \";position:absolute;display:flex;align-items:center;justify-content:center}.x-color-picker-template-color{width:100%;height:100%;border-radius:var(--x-border-small-radius)}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1.PatternValidator, selector: "[pattern][formControlName],[pattern][formControl],[pattern][ngModel]", inputs: ["pattern"] }, { 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: "component", type: XInputComponent, selector: "x-input" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
710
886
  }
711
887
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: XColorPickerComponent, decorators: [{
712
888
  type: Component,
713
- args: [{ selector: 'x-color-picker', standalone: true, imports: [FormsModule, ReactiveFormsModule, XInputComponent], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, providers: [XValueAccessor(XColorPickerComponent)], template: "<div #colorPicker class=\"x-color-picker\">\r\n <div class=\"x-color-picker-row\">\r\n <x-input\r\n #inputCom\r\n type=\"text\"\r\n [label]=\"label()\"\r\n [labelWidth]=\"labelWidth()\"\r\n [labelAlign]=\"labelAlign()\"\r\n [justify]=\"justify()\"\r\n [align]=\"align()\"\r\n [direction]=\"direction()\"\r\n [disabled]=\"disabledComputed()\"\r\n [required]=\"requiredComputed()\"\r\n [validator]=\"validatorComputed()\"\r\n [inputValidator]=\"inputValidator()\"\r\n [icon]=\"icon()\"\r\n [placeholder]=\"placeholder()\"\r\n [readonly]=\"readonly()\"\r\n [clearable]=\"clearable()\"\r\n [(ngModel)]=\"value\"\r\n [valueTpl]=\"valueTpl() ? valueTpl() : valueTemplate\"\r\n [valueTplContext]=\"valueTplContext()\"\r\n [size]=\"size()\"\r\n [bordered]=\"bordered()\"\r\n [before]=\"before()\"\r\n [after]=\"after()\"\r\n [pattern]=\"patternComputed()\"\r\n [message]=\"messageComputed()\"\r\n [pointer]=\"pointer()\"\r\n [(active)]=\"active\"\r\n (clearEmit)=\"clearEmit()\"\r\n (xClick)=\"showPortal()\"\r\n (xMouseenter)=\"menter()\"\r\n (xMouseleave)=\"mleave()\"\r\n ></x-input>\r\n\r\n <ng-template #valueTemplate>\r\n <div class=\"x-color-picker-template-value\">\r\n <div class=\"x-color-picker-template-color\" [style]=\"inputStyle()\"></div>\r\n </div>\r\n </ng-template>\r\n </div>\r\n</div>\r\n", styles: ["@charset \"UTF-8\";x-color-picker{display:inline-block;width:12rem}.x-color-picker{margin:0;padding:0}.x-color-picker{width:100%}.x-color-picker x-input{width:100%}.x-color-picker x-input .x-input-value-template-value{left:.25rem!important;width:calc(100% - 2.4rem)!important}.x-color-picker-template-value{width:100%;height:100%;padding:.25rem 0;content:\" \";position:absolute;display:flex;align-items:center;justify-content:center}.x-color-picker-template-color{width:100%;height:100%;border-radius:var(--x-border-small-radius)}\n"] }]
889
+ args: [{ selector: 'x-color-picker', standalone: true, imports: [FormsModule, ReactiveFormsModule, XInputComponent], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, providers: [XValueAccessor(XColorPickerComponent)], template: "<div #colorPicker class=\"x-color-picker\">\r\n <div class=\"x-color-picker-row\">\r\n <x-input\r\n #inputCom\r\n type=\"text\"\r\n [label]=\"label()\"\r\n [labelWidth]=\"labelWidth()\"\r\n [labelAlign]=\"labelAlign()\"\r\n [justify]=\"justify()\"\r\n [align]=\"align()\"\r\n [direction]=\"direction()\"\r\n [disabled]=\"disabledComputed()\"\r\n [required]=\"requiredComputed()\"\r\n [validator]=\"validatorComputed()\"\r\n [inputValidator]=\"inputValidator()\"\r\n [icon]=\"icon()\"\r\n [placeholder]=\"placeholder()\"\r\n [readonly]=\"readonly()\"\r\n [clearable]=\"clearable()\"\r\n [(ngModel)]=\"value\"\r\n [valueTpl]=\"valueTpl() ? valueTpl() : valueTemplate\"\r\n [valueTplContext]=\"valueTplContext()\"\r\n [size]=\"size()\"\r\n [bordered]=\"bordered()\"\r\n [before]=\"before()\"\r\n [after]=\"after()\"\r\n [pattern]=\"patternComputed()\"\r\n [message]=\"messageComputed()\"\r\n [pointer]=\"pointer()\"\r\n [(active)]=\"active\"\r\n (clearEmit)=\"clearEmit()\"\r\n (xClick)=\"showPortal()\"\r\n (xMouseenter)=\"menter()\"\r\n (xMouseleave)=\"mleave()\"\r\n ></x-input>\r\n\r\n <ng-template #valueTemplate>\r\n <div class=\"x-color-picker-template-value\">\r\n <div class=\"x-color-picker-template-color\" [style]=\"inputStyle()\"></div>\r\n </div>\r\n </ng-template>\r\n\r\n <ng-template #panelTemplate>\r\n <ng-content select=\"[xColorPickerPanel]\"></ng-content>\r\n </ng-template>\r\n </div>\r\n</div>\r\n", styles: ["@charset \"UTF-8\";x-color-picker{display:inline-block;width:12rem}.x-color-picker{margin:0;padding:0}.x-color-picker{width:100%}.x-color-picker x-input{width:100%}.x-color-picker x-input .x-input-value-template-value{left:.25rem!important;width:calc(100% - 2.4rem)!important}.x-color-picker-template-value{width:100%;height:100%;padding:.25rem 0;content:\" \";position:absolute;display:flex;align-items:center;justify-content:center}.x-color-picker-template-color{width:100%;height:100%;border-radius:var(--x-border-small-radius)}\n"] }]
714
890
  }], ctorParameters: () => [] });
715
891
 
892
+ class XColorPickerOptionDirective {
893
+ constructor() {
894
+ this.color = input.required({ alias: 'x-color-picker-option' });
895
+ this.colorPicker = inject(XColorPickerComponent, { optional: true });
896
+ }
897
+ onSelectClick() {
898
+ if (!this.colorPicker)
899
+ return;
900
+ this.colorPicker.value.set(XColorPickerColorMap[this.color()] || this.color());
901
+ }
902
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: XColorPickerOptionDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
903
+ /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "18.2.2", type: XColorPickerOptionDirective, isStandalone: true, selector: "[x-color-picker-option], x-color-picker-option", inputs: { color: { classPropertyName: "color", publicName: "x-color-picker-option", isSignal: true, isRequired: true, transformFunction: null } }, host: { listeners: { "click": "onSelectClick($event)" } }, ngImport: i0 }); }
904
+ }
905
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: XColorPickerOptionDirective, decorators: [{
906
+ type: Directive,
907
+ args: [{
908
+ standalone: true,
909
+ selector: `[x-color-picker-option], x-color-picker-option`
910
+ }]
911
+ }], propDecorators: { onSelectClick: [{
912
+ type: HostListener,
913
+ args: ['click', ['$event']]
914
+ }] } });
915
+
716
916
  class XColorPickerModule {
717
917
  /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: XColorPickerModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
718
- /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.2", ngImport: i0, type: XColorPickerModule, imports: [XColorPickerComponent], exports: [XColorPickerComponent] }); }
918
+ /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.2", ngImport: i0, type: XColorPickerModule, imports: [XColorPickerComponent, XColorPickerOptionDirective], exports: [XColorPickerComponent, XColorPickerOptionDirective] }); }
719
919
  /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: XColorPickerModule, imports: [XColorPickerComponent] }); }
720
920
  }
721
921
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: XColorPickerModule, decorators: [{
722
922
  type: NgModule,
723
923
  args: [{
724
- imports: [XColorPickerComponent],
725
- exports: [XColorPickerComponent]
924
+ imports: [XColorPickerComponent, XColorPickerOptionDirective],
925
+ exports: [XColorPickerComponent, XColorPickerOptionDirective]
726
926
  }]
727
927
  }] });
728
928
 
@@ -730,5 +930,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImpor
730
930
  * Generated bundle index. Do not edit.
731
931
  */
732
932
 
733
- export { XColorPickerComponent, XColorPickerModule, XColorPickerPortalComponent, XColorPickerPortalPrefix, XColorPickerPrefix, XColorPickerProperty };
933
+ export { XColorPickerComponent, XColorPickerModule, XColorPickerOptionDirective, XColorPickerPortalComponent, XColorPickerPortalPrefix, XColorPickerPrefix, XColorPickerProperty };
734
934
  //# sourceMappingURL=ng-nest-ui-color-picker.mjs.map