import * as React from 'react';
import { delegateCombine, delegateRemove } from "igniteui-react-core/ES2015/type";
import { Visibility_$type } from "igniteui-react-core/ES2015/Visibility";
import { MarkerType_$type } from "./MarkerType";
import { PropertyUpdatedEventArgs } from "igniteui-react-core/ES2015/igr-property-updated-event-args";
import { StackedFragmentSeries } from "./StackedFragmentSeries";
import { getModifiedProps, isValidProp, brushToString, stringToBrush, ensureBool, colorToString, stringToColor, ensureEnum } from "igniteui-react-core/ES2015/componentUtil";
/**
 * Represents a non-visual child of StackedSeriesBase.
*/
export class IgrStackedFragmentSeries extends React.Component {
    constructor(props) {
        super(props);
        this._hasUserValues = new Set();
        this._propertyUpdated = null;
        this._propertyUpdated_wrapped = null;
        this._implementation = this.createImplementation();
        this._implementation.externalObject = this;
        this.onImplementationCreated();
    }
    createImplementation() {
        return new StackedFragmentSeries();
    }
    onImplementationCreated() {
    }
    get hasUserValues() {
        return this._hasUserValues;
    }
    componentDidMount() {
        for (const p of Object.keys(this.props)) {
            if (isValidProp(this, p)) {
                this._hasUserValues.add(p);
                this[p] = this.props[p];
            }
        }
    }
    shouldComponentUpdate(nextProps, nextState) {
        const mod = getModifiedProps(this.props, nextProps);
        for (const p of Object.keys(mod)) {
            if (isValidProp(this, p)) {
                this._hasUserValues.add(p);
                this[p] = mod[p];
            }
        }
        return true;
    }
    render() {
        return null;
    }
    provideRenderer(renderer) {
        this._renderer = renderer;
        this.i.visualSeriesLink.provideRenderer(renderer);
    }
    get i() {
        return this._implementation;
    }
    /**
 * Gets or sets the brush of the stacked fragment.
*/
    get brush() {
        return brushToString(this.i.fu);
    }
    set brush(v) {
        this.i.fu = stringToBrush(v);
    }
    /**
     * Gets the actual brush used by the series.
    */
    get actualBrush() {
        return brushToString(this.i.fp);
    }
    set actualBrush(v) {
        this.i.fp = stringToBrush(v);
    }
    /**
     * Gets or sets whether drop shadow should be enabled for this series.
    */
    get isDropShadowEnabled() {
        return this.i.w;
    }
    set isDropShadowEnabled(v) {
        this.i.w = ensureBool(v);
    }
    /**
     * Gets whether drop shadow is actually enabled for this series.
    */
    get actualIsDropShadowEnabled() {
        return this.i.s;
    }
    set actualIsDropShadowEnabled(v) {
        this.i.s = ensureBool(v);
    }
    /**
     * Gets or sets the shadow blur.
     * This property is ignored when StackedFragmentSeries.UseSingleShadow is set to true.
    */
    get shadowBlur() {
        return this.i.aq;
    }
    set shadowBlur(v) {
        this.i.aq = +v;
    }
    /**
     * Gets the actual shadow blur used by the series.
    */
    get actualShadowBlur() {
        return this.i.ai;
    }
    set actualShadowBlur(v) {
        this.i.ai = +v;
    }
    /**
     * Gets or sets the drop shadow color.
    */
    get shadowColor() {
        return colorToString(this.i.f1);
    }
    set shadowColor(v) {
        this.i.f1 = stringToColor(v);
    }
    /**
     * Gets actual the drop shadow color used by the series.
    */
    get actualShadowColor() {
        return colorToString(this.i.f0);
    }
    set actualShadowColor(v) {
        this.i.f0 = stringToColor(v);
    }
    /**
     * Gets or sets whether drop shadow is applied to the whole StackedFragmentSeries visual or to each of the individual shapes forming the StackedFragmentSeries.
     * When this property is set to true, no StackedFragmentSeries.ShadowBlur is applied.
    */
    get useSingleShadow() {
        return this.i.aa;
    }
    set useSingleShadow(v) {
        this.i.aa = ensureBool(v);
    }
    /**
     * Gets whether drop shadow is actually applied to the whole StackedFragmentSeries visual or to each of the individual shapes forming the StackedFragmentSeries.
    */
    get actualUseSingleShadow() {
        return this.i.v;
    }
    set actualUseSingleShadow(v) {
        this.i.v = ensureBool(v);
    }
    /**
     * Gets or sets the drop shadow x-offset.
    */
    get shadowOffsetX() {
        return this.i.ar;
    }
    set shadowOffsetX(v) {
        this.i.ar = +v;
    }
    /**
     * Gets the actual drop shadow x-offset applied to the series.
    */
    get actualShadowOffsetX() {
        return this.i.aj;
    }
    set actualShadowOffsetX(v) {
        this.i.aj = +v;
    }
    /**
     * Gets or sets the drop shadow y-offset.
    */
    get shadowOffsetY() {
        return this.i.as;
    }
    set shadowOffsetY(v) {
        this.i.as = +v;
    }
    /**
     * Gets the actual drop shadow y-offset applied to the series.
    */
    get actualShadowOffsetY() {
        return this.i.ak;
    }
    set actualShadowOffsetY(v) {
        this.i.ak = +v;
    }
    /**
     * Gets or sets the LegendItemBadgeTemplate property.
     * The legend item badge is created according to the LegendItemBadgeTemplate on-demand by
     * the series object itself.
    */
    get legendItemBadgeTemplate() {
        return this.i.du;
    }
    set legendItemBadgeTemplate(v) {
        this.i.du = v;
    }
    /**
     * Gets the actual legend item badge template used by the series.
    */
    get actualLegendItemBadgeTemplate() {
        return this.i.dr;
    }
    set actualLegendItemBadgeTemplate(v) {
        this.i.dr = v;
    }
    /**
     * Gets or sets the LegendItemTemplate property.
     * The legend item control content is created according to the LegendItemTemplate on-demand by
     * the series object itself.
    */
    get legendItemTemplate() {
        return this.i.dv;
    }
    set legendItemTemplate(v) {
        this.i.dv = v;
    }
    /**
     * Gets the actual legend item template used by the series.
    */
    get actualLegendItemTemplate() {
        return this.i.ds;
    }
    set actualLegendItemTemplate(v) {
        this.i.ds = v;
    }
    /**
     * Gets or sets the legend item visibility for the current series object.
    */
    get legendItemVisibility() {
        return this.i.ge;
    }
    set legendItemVisibility(v) {
        this.i.ge = ensureEnum(Visibility_$type, v);
    }
    /**
     * Gets the actual visibility of the legend items in the series.
    */
    get actualLegendItemVisibility() {
        return this.i.gc;
    }
    set actualLegendItemVisibility(v) {
        this.i.gc = ensureEnum(Visibility_$type, v);
    }
    /**
     * Gets or sets the brush that specifies how the current series object's marker interiors are painted.
    */
    get markerBrush() {
        return brushToString(this.i.fv);
    }
    set markerBrush(v) {
        this.i.fv = stringToBrush(v);
    }
    /**
     * Gets the actual marker brush of the series.
    */
    get actualMarkerBrush() {
        return brushToString(this.i.fq);
    }
    set actualMarkerBrush(v) {
        this.i.fq = stringToBrush(v);
    }
    /**
     * Gets or sets the brush that specifies how the current series object's marker outlines are painted.
    */
    get markerOutline() {
        return brushToString(this.i.fw);
    }
    set markerOutline(v) {
        this.i.fw = stringToBrush(v);
    }
    /**
     * Gets the actual marker outline of the series.
    */
    get actualMarkerOutline() {
        return brushToString(this.i.fr);
    }
    set actualMarkerOutline(v) {
        this.i.fr = stringToBrush(v);
    }
    /**
     * Gets or sets the MarkerTemplate for the current series object.
    */
    get markerTemplate() {
        return this.i.dw;
    }
    set markerTemplate(v) {
        this.i.dw = v;
    }
    /**
     * Gets the actual marker template used by the series.
    */
    get actualMarkerTemplate() {
        return this.i.dt;
    }
    set actualMarkerTemplate(v) {
        this.i.dt = v;
    }
    /**
     * Gets or sets the marker type for the current series object.
     * If the MarkerTemplate property is set, the setting of the MarkerType property will be ignored.
    */
    get markerType() {
        return this.i.l;
    }
    set markerType(v) {
        this.i.l = ensureEnum(MarkerType_$type, v);
    }
    /**
     * Gets the actual marker type set used in the series.
    */
    get actualMarkerType() {
        return this.i.k;
    }
    set actualMarkerType(v) {
        this.i.k = ensureEnum(MarkerType_$type, v);
    }
    /**
     * Gets or sets the Name of the stacked fragment.
    */
    get name() {
        return this.i.b8;
    }
    set name(v) {
        this.i.b8 = v;
    }
    /**
     * Gets or sets the Opacity of the stacked fragment.
    */
    get opacity() {
        return this.i.an;
    }
    set opacity(v) {
        this.i.an = +v;
    }
    /**
     * Gets the series opacity.
    */
    get actualOpacity() {
        return this.i.af;
    }
    set actualOpacity(v) {
        this.i.af = +v;
    }
    /**
     * Gets or sets the brush to use for the outline of the series.
     * Some series types, such as LineSeries, do not display outlines.  Therefore, this property does not affect some charts.
    */
    get outline() {
        return brushToString(this.i.fy);
    }
    set outline(v) {
        this.i.fy = stringToBrush(v);
    }
    /**
     * Gets the series outline.
    */
    get actualOutline() {
        return brushToString(this.i.ft);
    }
    set actualOutline(v) {
        this.i.ft = stringToBrush(v);
    }
    /**
     * Gets or sets the AreaFillOpacity of the stacked fragment. This property only applies for area-like series.
    */
    get areaFillOpacity() {
        return this.i.am;
    }
    set areaFillOpacity(v) {
        this.i.am = +v;
    }
    /**
     * Gets the series ActualAreaFillOpacity.  This property only applies for area-like series.
    */
    get actualAreaFillOpacity() {
        return this.i.ae;
    }
    set actualAreaFillOpacity(v) {
        this.i.ae = +v;
    }
    /**
     * Gets or sets the x-radius of the ellipse that is used to round the corners of the column. This only applies to Bar and Column series.
    */
    get radiusX() {
        return this.i.ao;
    }
    set radiusX(v) {
        this.i.ao = +v;
    }
    /**
     * Gets the actual corner radius of the series
    */
    get actualRadiusX() {
        return this.i.ag;
    }
    set actualRadiusX(v) {
        this.i.ag = +v;
    }
    /**
     * Gets or sets the y-radius of the ellipse that is used to round the corners of the column. This only applies to Bar and Column series.
    */
    get radiusY() {
        return this.i.ap;
    }
    set radiusY(v) {
        this.i.ap = +v;
    }
    /**
     * Gets the actual corner radius of the series
    */
    get actualRadiusY() {
        return this.i.ah;
    }
    set actualRadiusY(v) {
        this.i.ah = +v;
    }
    /**
     * Gets or sets the width of the current series object's line thickness.
    */
    get thickness() {
        return this.i.at;
    }
    set thickness(v) {
        this.i.at = +v;
    }
    /**
     * Gets or sets the thickness of this stacked fragment.
    */
    get actualThickness() {
        return this.i.al;
    }
    set actualThickness(v) {
        this.i.al = +v;
    }
    /**
     * Gets or sets the Title property.
     * The legend item control is created according to the Title on-demand by
     * the series object itself.
    */
    get title() {
        return this.i.ax;
    }
    set title(v) {
        this.i.ax = v;
    }
    /**
     * Gets or sets the value mapping property for the current series object.
    */
    get valueMemberPath() {
        return this.i.cq;
    }
    set valueMemberPath(v) {
        this.i.cq = v;
    }
    /**
     * Gets or sets the Visibility of the stacked fragment.
    */
    get visibility() {
        return this.i.gf;
    }
    set visibility(v) {
        this.i.gf = ensureEnum(Visibility_$type, v);
    }
    /**
     * Gets the actual visibility of the stacked fragment.
    */
    get actualVisibility() {
        return this.i.gd;
    }
    set actualVisibility(v) {
        this.i.gd = ensureEnum(Visibility_$type, v);
    }
    /**
     * Gets the resolved brush used between the local series and the parent series.
    */
    get parentOrLocalBrush() {
        return brushToString(this.i.fz);
    }
    set parentOrLocalBrush(v) {
        this.i.fz = stringToBrush(v);
    }
    /**
     * Event raised when a property (including "effective" and non-dependency property) value changes.
    */
    get propertyUpdated() {
        return this._propertyUpdated;
    }
    set propertyUpdated(ev) {
        if (this._propertyUpdated_wrapped !== null) {
            this.i.propertyUpdated = delegateRemove(this.i.propertyUpdated, this._propertyUpdated_wrapped);
            this._propertyUpdated_wrapped = null;
            this._propertyUpdated = null;
        }
        this._propertyUpdated = ev;
        this._propertyUpdated_wrapped = (o, e) => {
            let outerArgs = new PropertyUpdatedEventArgs();
            outerArgs._provideImplementation(e);
            if (this.beforePropertyUpdated) {
                this.beforePropertyUpdated(this, outerArgs);
            }
            if (this._propertyUpdated) {
                this._propertyUpdated(this, outerArgs);
            }
        };
        this.i.propertyUpdated = delegateCombine(this.i.propertyUpdated, this._propertyUpdated_wrapped);
    }
}
