@adaptabletools/adaptable-cjs
Version:
Powerful data-agnostic HTML5 AG Grid extension which provides advanced, cutting-edge functionality to meet all DataGrid requirements
81 lines (80 loc) • 4.74 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ScheduleSettingsReminder = void 0;
const tslib_1 = require("tslib");
const React = tslib_1.__importStar(require("react"));
const Tabs_1 = require("../../../../components/Tabs");
const FormLayout_1 = tslib_1.__importStar(require("../../../../components/FormLayout"));
const Input_1 = tslib_1.__importDefault(require("../../../../components/Input"));
const CheckBox_1 = require("../../../../components/CheckBox");
const Select_1 = require("../../../../components/Select");
const Flex_1 = require("../../../../components/Flex");
const MESSAGE_TYPES = ['Success', 'Info', 'Warning', 'Error'];
const ScheduleSettingsReminder = (props) => {
const messageTypes = MESSAGE_TYPES.map((messageType) => ({
label: messageType,
value: messageType,
onClick: () => {
props.onChange({
...props.reminderSchedule,
MessageType: messageType,
});
},
}));
const handleNameChange = (event) => {
props.onChange({
...props.reminderSchedule,
Name: event.target.value,
});
};
const handleHeaderChange = (event) => {
props.onChange({
...props.reminderSchedule,
Header: event.target.value,
});
};
const handleMessageChange = (event) => {
props.onChange({
...props.reminderSchedule,
Message: event.target.value,
});
};
const handleDisplayNotificationChange = (checked) => {
props.onChange({
...props.reminderSchedule,
DisplayNotification: checked,
});
};
const handleDisplaySystemStatusChange = (checked) => {
props.onChange({
...props.reminderSchedule,
DisplaySystemStatusMessage: checked,
});
};
return (React.createElement(Flex_1.Box, { "data-name": "schedule-settings-reminder" },
React.createElement(Tabs_1.Tabs, { autoFocus: false },
React.createElement(Tabs_1.Tabs.Tab, null, "Settings"),
React.createElement(Tabs_1.Tabs.Content, null,
React.createElement(FormLayout_1.default, null,
React.createElement(FormLayout_1.FormRow, { label: "Name" },
React.createElement(Input_1.default, { "data-name": "schedule-name", className: "twa:w-[300px]", onChange: handleNameChange, placeholder: "Enter Reminder Name", type: "string", value: props.reminderSchedule?.Name ?? '' })),
React.createElement(FormLayout_1.FormRow, { label: "" },
React.createElement(Flex_1.Box, { className: "twa:h-2" })),
React.createElement(FormLayout_1.FormRow, { label: "Header" },
React.createElement(Input_1.default, { "data-name": "header", className: "twa:w-[300px]", onChange: handleHeaderChange, placeholder: "Enter Reminder Header", type: "string", value: props.reminderSchedule?.Header })),
React.createElement(FormLayout_1.FormRow, { label: "Message" },
React.createElement(Input_1.default, { "data-name": "message", className: "twa:w-[300px]", onChange: handleMessageChange, placeholder: "Enter Reminder Message", type: "string", value: props.reminderSchedule?.Message })),
React.createElement(FormLayout_1.FormRow, { label: "Type" },
React.createElement(Flex_1.Box, { className: "twa:max-w-[300px]" },
React.createElement(Select_1.Select, { "data-name": "message-type", placeholder: "Select Option", options: messageTypes, value: props.reminderSchedule?.MessageType, onChange: (value) => {
props.onChange({
...props.reminderSchedule,
MessageType: value,
});
} }))),
React.createElement(FormLayout_1.FormRow, { label: "" },
React.createElement(CheckBox_1.CheckBox, { "data-name": "display-notification", checked: props.reminderSchedule?.DisplayNotification, onChange: handleDisplayNotificationChange }, "Show the Reminder as a Notification")),
React.createElement(FormLayout_1.FormRow, { label: "" },
React.createElement(CheckBox_1.CheckBox, { "data-name": "display-system-status", checked: props.reminderSchedule?.DisplaySystemStatusMessage, onChange: handleDisplaySystemStatusChange }, "Display a System Status Message")))))));
};
exports.ScheduleSettingsReminder = ScheduleSettingsReminder;