import { AXPColumnWidgetComponent } from '@acorex/platform/layout/widget-core';
import * as i1 from '@angular/common';
import { CommonModule } from '@angular/common';
import * as i0 from '@angular/core';
import { ChangeDetectionStrategy, Component } from '@angular/core';

class AXPColorChooserWidgetColumnComponent extends AXPColumnWidgetComponent {
    constructor() {
        super(...arguments);
        this.parsed = () => {
            const value = this.rawValue;
            if (!value) {
                return null;
            }
            if (typeof value === 'string') {
                const parts = value.trim().split(/\s+/);
                if (parts.length === 3) {
                    const [color, background, border] = parts;
                    return { title: '', name: '', color, background, border };
                }
                return null;
            }
            return value;
        };
        this.title = () => (typeof this.rawValue === 'object' ? this.rawValue?.title || '' : '');
        this.background = () => this.parsed()?.background || '';
        this.color = () => this.parsed()?.color || '';
        this.border = () => this.parsed()?.border || '';
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: AXPColorChooserWidgetColumnComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.16", type: AXPColorChooserWidgetColumnComponent, isStandalone: true, selector: "ax-color-chooser-column", inputs: { rawValue: "rawValue" }, usesInheritance: true, ngImport: i0, template: `
    <div class="ax-flex ax-items-center ax-gap-2">
      <div
        class="ax-w-6 ax-h-6 ax-rounded-md ax-flex ax-items-center ax-justify-center"
        [ngClass]="[background(), border()]"
      >
        <span [ngClass]="color()">Aa</span>
      </div>
      <span>{{ title() }}</span>
    </div>
  `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: AXPColorChooserWidgetColumnComponent, decorators: [{
            type: Component,
            args: [{
                    selector: 'ax-color-chooser-column',
                    template: `
    <div class="ax-flex ax-items-center ax-gap-2">
      <div
        class="ax-w-6 ax-h-6 ax-rounded-md ax-flex ax-items-center ax-justify-center"
        [ngClass]="[background(), border()]"
      >
        <span [ngClass]="color()">Aa</span>
      </div>
      <span>{{ title() }}</span>
    </div>
  `,
                    imports: [CommonModule],
                    inputs: ['rawValue'],
                    changeDetection: ChangeDetectionStrategy.OnPush,
                }]
        }] });

export { AXPColorChooserWidgetColumnComponent };
//# sourceMappingURL=acorex-platform-themes-shared-theme-color-chooser-column.component-BQxoUmYL.mjs.map
