// @ts-nocheck
import { h } from "@stencil/core";
/*

export interface DateCellProps {
  ;
  onSelect: (date: Date) => void;
  isFirstRangeChild: boolean;
  isLastRangeChild: boolean;
}

const DateCell: React.FC<DateCellProps> = ({
  date,
  isCurrentMonth,
  isSelected,
  isToday,
  midRange = false,
  onSelect,
  isFirstRangeChild = false,
  isLastRangeChild = false,

*/
export class DateCell {
    constructor() {
        this.midRange = false;
        this.isFirstRangeChild = false;
        this.isLastRangeChild = false;
        //   @Event() onSelect: EventEmitter<Date>;
        this.handleClick = () => {
            if (this.isCurrentMonth) {
                //   this.onSelect.emit(this.date);
                if (this.onSelect) {
                    this.onSelect(this.date);
                }
            }
        };
        this.handleAddPressed = (e) => {
            e.currentTarget.classList.add('active');
        };
        this.handleRemovePressed = (e) => {
            e.currentTarget.classList.remove('active');
        };
    }
    render() {
        let className = 'date-cell';
        if (!this.isCurrentMonth)
            className += ' date-cell--not-current-month';
        if (this.isSelected)
            className += ' date-cell--selected';
        if (this.isToday)
            className += ' date-cell--today';
        if (this.midRange)
            className += ' date-cell--mid-range';
        if (this.isFirstRangeChild)
            className += ' date-cell--mid-range--first-child';
        if (this.isLastRangeChild)
            className += ' date-cell--mid-range--last-child';
        return (h("button", { key: 'f556866be3b75748326a34ecf7561bd33d36bced', type: "button", class: className, onClick: () => this.handleClick(), onMouseDown: this.handleAddPressed, onMouseUp: this.handleRemovePressed, onMouseOut: this.handleRemovePressed, disabled: !this.isCurrentMonth }, h("div", { key: '5427bbf39d5370fc96364d8ba9656749d525f839', class: "date-cell__label" }, h("span", { key: 'e5e566755b02496acac48ada3d04d72b954b83a7' }, this.date.getDate()))));
    }
    static get is() { return "date-cell"; }
    static get originalStyleUrls() {
        return {
            "$": ["../../assets/styles/main.scss"]
        };
    }
    static get styleUrls() {
        return {
            "$": ["../../assets/styles/main.css"]
        };
    }
    static get properties() {
        return {
            "date": {
                "type": "unknown",
                "mutable": false,
                "complexType": {
                    "original": "Date",
                    "resolved": "Date",
                    "references": {
                        "Date": {
                            "location": "global",
                            "id": "global::Date"
                        }
                    }
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false
            },
            "isCurrentMonth": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "attribute": "is-current-month",
                "reflect": false
            },
            "isSelected": {
                "type": "boolean",
                "mutable": true,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "attribute": "is-selected",
                "reflect": false
            },
            "isToday": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "attribute": "is-today",
                "reflect": false
            },
            "midRange": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "attribute": "mid-range",
                "reflect": false,
                "defaultValue": "false"
            },
            "isFirstRangeChild": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "attribute": "is-first-range-child",
                "reflect": false,
                "defaultValue": "false"
            },
            "isLastRangeChild": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "attribute": "is-last-range-child",
                "reflect": false,
                "defaultValue": "false"
            },
            "onSelect": {
                "type": "unknown",
                "mutable": false,
                "complexType": {
                    "original": "(date: Date) => void",
                    "resolved": "(date: Date) => void",
                    "references": {
                        "Date": {
                            "location": "global",
                            "id": "global::Date"
                        }
                    }
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false
            }
        };
    }
}
//# sourceMappingURL=DateCell.js.map
