"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.HorizontalStackWrapAdvancedExample = void 0;
var tslib_1 = require("tslib");
var React = require("react");
var Dropdown_1 = require("@fluentui/react/lib-commonjs/Dropdown");
var Slider_1 = require("@fluentui/react/lib-commonjs/Slider");
var Stack_1 = require("@fluentui/react/lib-commonjs/Stack");
var Styling_1 = require("@fluentui/react/lib-commonjs/Styling");
var example_data_1 = require("@fluentui/example-data");
// Non-mutating styles definition
var itemStyles = {
    alignItems: 'center',
    background: Styling_1.DefaultPalette.themePrimary,
    color: Styling_1.DefaultPalette.white,
    display: 'flex',
    height: 50,
    justifyContent: 'center',
    width: 50,
};
// Alignment options
var horizontalAlignmentOptions = [
    { key: 'start', text: 'Left' },
    { key: 'center', text: 'Center' },
    { key: 'end', text: 'Right' },
    { key: 'space-around', text: 'Space around' },
    { key: 'space-between', text: 'Space between' },
    { key: 'space-evenly', text: 'Space evenly' },
];
var verticalAlignmentOptions = [
    { key: 'start', text: 'Top' },
    { key: 'center', text: 'Center' },
    { key: 'end', text: 'Bottom' },
];
var overflowOptions = [
    { key: 'visible', text: 'Visible' },
    { key: 'auto', text: 'Auto' },
    { key: 'hidden', text: 'Hidden' },
];
// Tokens definition
var sectionStackTokens = { childrenGap: 10 };
var configureStackTokens = { childrenGap: 20 };
var wrapStackTokens = { childrenGap: 30 };
var HorizontalStackWrapAdvancedExampleContent = function (props) {
    var stackWidth = props.stackWidth, containerHeight = props.containerHeight, overflow = props.overflow, horizontalAlignment = props.horizontalAlignment, verticalAlignment = props.verticalAlignment;
    // Mutating styles definition
    var stackStyles = {
        root: {
            background: Styling_1.DefaultPalette.themeTertiary,
            width: stackWidth + "%",
            overflow: overflow,
        },
    };
    var containerStyles = { height: containerHeight };
    return (React.createElement("div", { style: containerStyles },
        React.createElement(Stack_1.Stack, { horizontal: true, verticalFill: true, wrap: true, horizontalAlign: horizontalAlignment, verticalAlign: verticalAlignment, styles: stackStyles, tokens: wrapStackTokens }, example_data_1.range(1, 10).map(function (n) { return (React.createElement("span", { style: itemStyles, key: n }, n)); }))));
};
var HorizontalStackWrapAdvancedExample = function () {
    var _a = React.useState(100), stackWidth = _a[0], setStackWidth = _a[1];
    var _b = React.useState(150), containerHeight = _b[0], setContainerHeight = _b[1];
    var _c = React.useState('start'), horizontalAlignment = _c[0], setHorizontalAlignment = _c[1];
    var _d = React.useState('start'), verticalAlignment = _d[0], setVerticalAlignment = _d[1];
    var _e = React.useState('visible'), overflow = _e[0], setOverflow = _e[1];
    return (React.createElement(Stack_1.Stack, { tokens: sectionStackTokens },
        React.createElement(Stack_1.Stack, { horizontal: true },
            React.createElement(Stack_1.Stack.Item, { grow: true },
                React.createElement(Slider_1.Slider, { label: "Stack width:", min: 1, max: 100, step: 1, defaultValue: 100, showValue: true, onChange: setStackWidth })),
            React.createElement(Stack_1.Stack.Item, { grow: true },
                React.createElement(Slider_1.Slider, { label: "Container height:", min: 1, max: 200, step: 1, defaultValue: 150, showValue: true, onChange: setContainerHeight }))),
        React.createElement(Stack_1.Stack, { horizontal: true, tokens: configureStackTokens },
            React.createElement(Stack_1.Stack.Item, { grow: true },
                React.createElement(Dropdown_1.Dropdown, { selectedKey: horizontalAlignment, placeholder: "Select Horizontal Alignment", label: "Horizontal alignment:", options: horizontalAlignmentOptions, 
                    // eslint-disable-next-line react/jsx-no-bind
                    onChange: function (ev, option) {
                        return setHorizontalAlignment(option.key);
                    } })),
            React.createElement(Stack_1.Stack.Item, { grow: true },
                React.createElement(Dropdown_1.Dropdown, { selectedKey: verticalAlignment, placeholder: "Select Vertical Alignment", label: "Vertical alignment:", options: verticalAlignmentOptions, 
                    // eslint-disable-next-line react/jsx-no-bind
                    onChange: function (ev, option) {
                        return setVerticalAlignment(option.key);
                    } })),
            React.createElement(Stack_1.Stack.Item, { grow: true },
                React.createElement(Dropdown_1.Dropdown, { selectedKey: overflow, placeholder: "Select Overflow", label: "Overflow:", options: overflowOptions, 
                    // eslint-disable-next-line react/jsx-no-bind
                    onChange: function (ev, option) {
                        return setOverflow(option.key);
                    } }))),
        React.createElement(HorizontalStackWrapAdvancedExampleContent, tslib_1.__assign({}, { stackWidth: stackWidth, containerHeight: containerHeight, horizontalAlignment: horizontalAlignment, verticalAlignment: verticalAlignment, overflow: overflow }))));
};
exports.HorizontalStackWrapAdvancedExample = HorizontalStackWrapAdvancedExample;
//# sourceMappingURL=Stack.Horizontal.WrapAdvanced.Example.js.map