﻿@import '../default.less';
@import '../mixins.less';
//DON'T ADD IMPORTS, ABOVE ARE TO MAKE INTELLISENSE WORK

//https://github.com/twbs/bootstrap/blob/master/less/dropdowns.less

//
// Dropdown menus
// --------------------------------------------------


// Dropdown arrow/caret
.caret
{
	display: inline-block;
	width: 0;
	height: 0;
	margin-left: 2px;
	vertical-align: middle;
	border-top: 4px dashed;
	border-top: 4px solid ~"\9"; // IE8
	border-right: 4px solid transparent;
	border-left: 4px solid transparent;
}

// The dropdown wrapper (div)
.dropup,
.dropdown
{
	position: relative;
}

// Prevent the focus on the dropdown toggle when closing dropdowns
.dropdown-toggle:focus
{
	outline: 0;
}

// The dropdown menu (ul)
@gray-dark: lighten(#000, 20%); // #333
.dropdown-menu
{
	position: absolute;
	top: 100%;
	left: 0;
	z-index: 1000;
	display: none; // none by default, but block on "open" of the menu
	float: left;
	min-width: 160px;
	padding: 5px 0;
	margin: 2px 0 0; // override default ul
	list-style: none;
	font-size: 14px;
	text-align: left; // Ensures proper alignment if parent has it changed (e.g., modal footer)
	background-color: #fff;
	border: 1px solid #ccc; // IE8 fallback
	border: 1px solid rgba(0,0,0,.15);
	border-radius: 0;
	-webkit-box-shadow: 0 6px 12px rgba(0,0,0,.175);
	box-shadow: 0 6px 12px rgba(0,0,0,.175);
	background-clip: padding-box;
	// Aligns the dropdown menu to right
	//
	// Deprecated as of 3.1.0 in favor of `.dropdown-menu-[dir]`
	&.pull-right
	{
		right: 0;
		left: auto;
	}
	// Dividers (basically an hr) within the dropdown
	.divider
	{
		height: 1px;
		margin: 9px 0;
		overflow: hidden;
		background-color: #e5e5e5;
	}

	// Links within the dropdown menu
	> li > a
	{
		display: block;
		padding: 3px 20px;
		clear: both;
		font-weight: normal;
		line-height: 20/14;
		color: @gray-dark;
		white-space: nowrap; // prevent links from randomly breaking onto new lines
	}
}

// Hover/Focus state
.dropdown-menu > li > a
{
	&:hover,
	&:focus
	{
		text-decoration: none;
		color: darken(@gray-dark, 5%);
		background-color: #f5f5f5;
	}
}

// Active state
.dropdown-menu > .active > a
{
	&,
	&:hover,
	&:focus
	{
		color: #fff;
		text-decoration: none;
		outline: 0;
		background-color: @accent-color;
	}
}

// Disabled state
//
// Gray out text and ensure the hover/focus state remains gray

.dropdown-menu > .disabled > a
{
	&,
	&:hover,
	&:focus
	{
		color: lighten(#000, 46.7%);
	}
	// Nuke hover/focus effects
	&:hover,
	&:focus
	{
		text-decoration: none;
		background-color: transparent;
		background-image: none; // Remove CSS gradient
		filter: e(%("progid:DXImageTransform.Microsoft.gradient(enabled = false)"));
		cursor: not-allowed;
	}
}

// Open state for the dropdown
.open
{
	// Show the menu
	> .dropdown-menu
	{
		display: block;
	}
	// Remove the outline when :focus is triggered
	> a
	{
		outline: 0;
	}
}

// Menu positioning
//
// Add extra class to `.dropdown-menu` to flip the alignment of the dropdown
// menu with the parent.
.dropdown-menu-right
{
	left: auto; // Reset the default from `.dropdown-menu`
	right: 0;
}
// With v3, we enabled auto-flipping if you have a dropdown within a right
// aligned nav component. To enable the undoing of that, we provide an override
// to restore the default dropdown menu alignment.
//
// This is only for left-aligning a dropdown menu within a `.navbar-right` or
// `.pull-right` nav component.
.dropdown-menu-left
{
	left: 0;
	right: auto;
}

// Dropdown section headers
.dropdown-header
{
	display: block;
	padding: 3px 20px;
	font-size: 12px;
	line-height: 20/14;
	color: lighten(#000, 46.7%);
	white-space: nowrap; // as with > li > a
}

// Backdrop to catch body clicks on mobile, etc.
.dropdown-backdrop
{
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	top: 0;
	z-index: (1000 - 10);
}

.dropdown
{
	font-family: @title-font;

	.selected-value
	{
		margin-right: 8px;
	}

	.dropdown-toggle
	{
		min-width: 60px;
		max-width: 60px;
	}

	@dropdown-width: 110px;

	ul.dropdown-menu
	{
		min-width: @dropdown-width;
		max-width: @dropdown-width;
		position: absolute;
		z-index: 1000000;

		li.custom-value-input-holder
		{
			padding: 0 2px 3px 2px;
		}

		a
		{
			text-decoration: none;

			html[dir='rtl'] &
			{
				text-align: right;
			}
		}

		html[dir='rtl'] &
		{
			left: inherit;
			padding: 0;
		}
	}

	input.custom-value
	{
		margin-top: -3px;
		width: @dropdown-width - 22px; //78px;
		padding: 4px 8px;
		height: inherit;
		font-size: 9pt;
		display: block;
		line-height: 20/14;
		color: #555555;
		background-color: white;
		background-image: none;
		border: 1px solid #cccccc;
		border-radius: 0;
		-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
		box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);

		html[dir='rtl'] &
		{
			margin-top: 3px;
		}
	}


	@icon-padding-left: 24px;
	@input-width: @dropdown-width + 50 + @icon-padding-left - 22px;
	&.icon-select-dropdown
	{
		
		min-width: @input-width;
		max-width: @input-width;

		padding-left: 24px;

		.ui-element.dropdown-toggle:active
		{
			background-color: white;
		}

		ul.dropdown-menu
		{
			min-width: @input-width + 38;
			max-width: @input-width + 38;
		}

		input.custom-value
		{
			padding-left: @icon-padding-left;
			width: @input-width;
		}

		.selected-value
		{
			font-size: 1.3em;
		}

		.icons-holder
		{
			overflow-y: auto;
			overflow-x: hidden;
			line-height: 24px;

			max-height: (24 + 8) * 4px;//fit 4 icons
			div.icon
			{
				white-space: nowrap;
				cursor: pointer;
				padding: 4px 8px;
				html[dir='rtl'] &
				{
					text-align: right;
				}

				&:hover
				{
					background-color: #e5e5e5;
				}

				&.active
				{
					background-color: red;
					background-color: #efefef;
				}

				//this is 'fa fa-check'
				.checked-indicator {
					color: green;
					margin-top: 5px;

					float: right;
					html[dir='rtl'] &
					{
						float: left;
					}					
				}
			}

		}

		.custom-value-input-holder
		{
			.fa-search
			{
				position: absolute;
				top: 8px;
				left: 8px;
				color: @accent-color;
			}
		}
	}
}
