@adaptabletools/adaptable-cjs
Version:
Powerful data-agnostic HTML5 AG Grid extension which provides advanced, cutting-edge functionality to meet all DataGrid requirements
33 lines (32 loc) • 4.01 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.StateManagementPopup = void 0;
const tslib_1 = require("tslib");
const React = tslib_1.__importStar(require("react"));
const PopupPanel_1 = require("../Components/Popups/AdaptablePopup/PopupPanel");
const HelpBlock_1 = tslib_1.__importDefault(require("../../components/HelpBlock"));
const LoadButton_1 = require("./components/LoadButton");
const ClearButton_1 = require("./components/ClearButton");
const ExportDropdown_1 = require("./components/ExportDropdown");
const Panel_1 = tslib_1.__importDefault(require("../../components/Panel"));
const StateManagementPopup = (props) => {
const baseClassName = 'ab-ManageState';
return (React.createElement(PopupPanel_1.PopupPanel, { className: baseClassName, headerText: props.moduleInfo.FriendlyName, glyphicon: props.moduleInfo.Glyph, infoLink: props.moduleInfo.HelpPage, infoLinkDisabled: !props.api.internalApi.isDocumentationLinksDisplayed() },
React.createElement(Panel_1.default, { className: `${baseClassName}__panel`, "data-name": "user-state", header: 'User State', style: { height: 'auto' }, variant: "default", borderRadius: "none", marginRight: 2, mb: 2 },
React.createElement(HelpBlock_1.default, { marginBottom: 2 }, 'Clear all current user state that has been persisted'),
React.createElement(HelpBlock_1.default, { style: { color: 'var(--ab-color-warn)' } }, 'This will cause this window to close and any State you have previously created will be lost, and the Initial Adaptable State will be reapplied'),
React.createElement(ClearButton_1.ClearButton, { "data-name": "clear-user-state-button", tone: "info", variant: "raised", marginTop: 2, accessLevel: props.accessLevel, onClick: () => props.api.stateApi.reloadInitialState() }, "Clear User State")),
React.createElement(Panel_1.default, { className: `${baseClassName}__panel`, "data-name": "initial-state", header: 'Initial Adaptable State', style: { height: 'auto' }, variant: "default", borderRadius: "none", marginTop: 3, marginRight: 2, mb: 2 },
React.createElement(HelpBlock_1.default, { marginTop: 2 }, 'Load Initial Adaptable State (from a .json file) - this will cause this window to close'),
' ',
React.createElement(LoadButton_1.LoadButton, { tone: "info", variant: "raised", marginTop: 2, accessLevel: props.accessLevel, onLoad: (json) => props.api.stateApi.reloadInitialState(json), "data-name": "load-initial-state-button" }, "Load Initial Adaptable State")),
React.createElement(Panel_1.default, { className: `${baseClassName}__panel`, "data-name": "adaptable-state", header: 'Export Adaptable State', style: { height: 'auto' }, variant: "default", borderRadius: "none", marginTop: 3, marginRight: 2, mb: 2 },
React.createElement(HelpBlock_1.default, { marginTop: 2, marginBottom: 2 }, 'Exports the currently persisted Adaptable State'),
' ',
React.createElement(ExportDropdown_1.ExportDropdown, { api: props.api, type: "adaptableState", marginRight: 3, style: { flex: 1, maxWidth: 'none' }, columns: ['label'], "data-name": "export-adaptable-state-dropdown" }, "Select Export Destination")),
React.createElement(Panel_1.default, { className: `${baseClassName}__panel`, "data-name": "initial-state", header: 'Export Initial Adaptable State', style: { height: 'auto' }, variant: "default", borderRadius: "none", marginTop: 3, marginRight: 2, mb: 2 },
React.createElement(HelpBlock_1.default, { marginTop: 2, marginBottom: 2 }, 'Exports the Initial Adaptable State which was provided at design time'),
' ',
React.createElement(ExportDropdown_1.ExportDropdown, { api: props.api, type: "initialState", marginRight: 3, style: { flex: 1, maxWidth: 'none' }, columns: ['label'], "data-name": "export-initial-state-dropdown" }, "Select Export Destination"))));
};
exports.StateManagementPopup = StateManagementPopup;