UNPKG

react-dropdown-advanced

Version:

An advanced pure React Dropdown control with many customisable options.

1 lines 4.94 kB
"use strict";function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(exports,"__esModule",{value:!0});var DropDownItems_1=require("./components/DropDownItems"),TestData=function e(){_classCallCheck(this,e)};TestData.getItems=function(){var e,t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"",o=[];"action-img-items"==t&&((e=new DropDownItems_1.ActionItem("A","Logout","fa-download",!0)).data={pos:t},e.addRightImage("fa-cog","settings"),e.addRightImage("fa-window-close-o","exit the application"),o.push(e),o.push(new DropDownItems_1.SeperatorItem),(e=new DropDownItems_1.ActionItem("profile","Show User Profile","fa-user-o")).addRightImage("fa-mail-forward","forward this item"),e.textMarginRight=32,o.push(e),o.push(new DropDownItems_1.ActionItem("bell","Show outstanding alerts","fa-bell")),o.push(new DropDownItems_1.ActionItem("shortcuts","Show Bitcoin Valuation","fa-btc")),o.push(new DropDownItems_1.ActionItem("setting","System Settings","fa-cog")));("simple items"==t&&(o.push(new DropDownItems_1.ActionItem("A","Holiday in France","",!1,function(e){return alert(e.key)})),o.push(new DropDownItems_1.ActionItem("B","Go to California")),o.push(new DropDownItems_1.ActionItem("C","Visit London"))),"left-top"!=t&&"radiooption"!=t||(o.push(new DropDownItems_1.OptionItem("keyZ","My Option 1","A")),o.push(new DropDownItems_1.OptionItem("keyA","My Option 2","A",!0)),o.push(new DropDownItems_1.SeperatorItem),o.push(new DropDownItems_1.ActionItem("keyB","Take Action A")),o.push(new DropDownItems_1.ActionItem("keyC","Take Action B")),o.push(new DropDownItems_1.SeperatorItem),o.push(new DropDownItems_1.OptionItem("keyA2","Buy Apples","",!0)),o.push(new DropDownItems_1.OptionItem("keyB2","Buy Bananas","",!0)),o.push(new DropDownItems_1.OptionItem("keyC2","Buy Pomegranates")),o.push(new DropDownItems_1.SeperatorItem),o.push(new DropDownItems_1.OptionItem("keyO2","Haarlem is the best place to live","C")),o.push(new DropDownItems_1.OptionItem("keyO3","Amsterdam is the best place to live","C"))),"right-top"!=t&&"dynamic items"!=t||(o.push(new DropDownItems_1.ActionItem("logout","Logout","fa-window-close-o")),o.push(new DropDownItems_1.SeperatorItem),o.push(new DropDownItems_1.ActionItem("profile","Show Profile","fa-user-o")),o.push(new DropDownItems_1.ActionItem("shortcuts","Show Shortcuts","fa-mail-forward")),o.push(new DropDownItems_1.ActionItem("setting","System Settings","fa-cog"))),"right-top-2"==t&&(o.push(new DropDownItems_1.ActionItem("logout","Logout","fa-window-close-o")),o.push(new DropDownItems_1.SeperatorItem),o.push(new DropDownItems_1.ActionItem("profile","Show Profile")),o.push(new DropDownItems_1.ActionItem("shortcuts","Show Shortcuts")),o.push(new DropDownItems_1.ActionItem("setting","System Settings (Admin)"))),"right-top-3"==t&&(o.push(new DropDownItems_1.ActionItem("logout","Logout","fa-window-close-o")),o.push(new DropDownItems_1.SeperatorItem),o.push(new DropDownItems_1.ActionItem("profile","Show Profile")),o.push(new DropDownItems_1.ActionItem("shortcuts","Show Shortcuts")),o.push(new DropDownItems_1.ActionItem("setting","System Settings (Admin)"))),"right-bottom"==t&&(o.push(new DropDownItems_1.HeaderItem("Choose your activities:")),o.push(new DropDownItems_1.OptionItem("beach","Visit the beach")),o.push(new DropDownItems_1.OptionItem("town","Walk through town")),o.push(new DropDownItems_1.OptionItem("museum","Visit musea")),o.push(new DropDownItems_1.OptionItem("hirecar","Hire a car")),o.push(new DropDownItems_1.OptionItem("nothing","Do absolutely nothing and less then that!"))),"left-bottom"==t||"showcase"==t)&&((e=new DropDownItems_1.ActionItem("booknow","Book now!","fa-plane")).data={pos:t},e.addRightImage("fa-cog","settings"),e.addRightImage("fa-window-close-o","exit the application"),o.push(e),o.push(new DropDownItems_1.SeperatorItem),o.push(new DropDownItems_1.HeaderItem("Choose your destination:")),o.push(new DropDownItems_1.OptionItem("california","California and Santa Monica","A")),o.push(new DropDownItems_1.OptionItem("newyork","New York","A")),o.push(new DropDownItems_1.OptionItem("miami","Miami","A")),o.push(new DropDownItems_1.SeperatorItem),o.push(new DropDownItems_1.HeaderItem("Mode of transport:")),o.push(new DropDownItems_1.OptionItem("car","By car","B")),o.push(new DropDownItems_1.OptionItem("boat","By boat","B")),o.push(new DropDownItems_1.OptionItem("plane","By plane","B")),o.push(new DropDownItems_1.SeperatorItem),o.push(new DropDownItems_1.HeaderItem("Choose your activities:")),o.push(new DropDownItems_1.OptionItem("beach","Visit the beach")),o.push(new DropDownItems_1.OptionItem("town","Walk through town")),o.push(new DropDownItems_1.OptionItem("park","Visit Parks")),o.push(new DropDownItems_1.OptionItem("hirecar","Hire a car")),o.push(new DropDownItems_1.OptionItem("nothing","Do absolutely nothing !")));return o},exports.TestData=TestData;