import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { BaseExpression } from "../../BaseExpression";
import { ExpressionValue } from "../../ExpressionValue";
import { ExpressionValueRenderer } from "../../ExpressionValueRenderer";
import { BracketedDiv, ExpressionPiece } from "../../ExpressionStyles";
import { ObserveState } from "../../../CommonUI/StateManagement/ObserveState";
import { DateDataDefinition } from "../../../Common/Data/Definitions/DateDataDefinition";
import { NumberDataDefinition } from "../../../Common/Data/Definitions/NumberDataDefinition";
export class DateGetDayExpression extends BaseExpression {
    constructor() {
        super();
        this.__type = "Date Get Day";
        this.expressionValueType = new NumberDataDefinition();
        this.value1 = ExpressionValue.createExpressionValue(this, "dateValue", new DateDataDefinition());
    }
    render() {
        return (_jsx(ObserveState, { listenTo: this.value1, control: () => (_jsxs(ExpressionPiece, Object.assign({ hasChild: !!this.value1.subExpression }, { children: ["get day", _jsx(BracketedDiv, Object.assign({ hasChild: !!this.value1.subExpression }, { children: _jsx(ExpressionValueRenderer, { el: this.value1 }, void 0) }), void 0)] }), void 0)) }, void 0));
    }
    evaluate(data, testContext) {
        return this.value1.evaluate(data, testContext).getDate();
    }
}
//# sourceMappingURL=DateGetDayExpression.js.map